contrib: integrate RPM spec

Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.

Related: OS#4550
Change-Id: Ibec1a22952ecfb0578bb4611e65ad819f5984fd8
diff --git a/.gitignore b/.gitignore
index e32000c..7041f69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,3 +49,5 @@
 doc/manuals/common
 doc/manuals/generated
 doc/manuals/*.pdf
+
+contrib/osmo-iuh.spec
diff --git a/configure.ac b/configure.ac
index 1875d5e..692db57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,4 +167,5 @@
 	doc/manuals/Makefile
 	contrib/Makefile
 	contrib/systemd/Makefile
+	contrib/osmo-iuh.spec
 	)
diff --git a/contrib/osmo-iuh.spec b/contrib/osmo-iuh.spec.in
similarity index 94%
rename from contrib/osmo-iuh.spec
rename to contrib/osmo-iuh.spec.in
index e2abd35..82046fe 100644
--- a/contrib/osmo-iuh.spec
+++ b/contrib/osmo-iuh.spec.in
@@ -12,17 +12,13 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-
 Name:           osmo-iuh
-Version:        0.6.0.13
+Version:        @VERSION@
 Release:        0
 Summary:        Osmocom code for the Iuh interface (HNBAP, RUA, RANAP)
 License:        AGPL-3.0-or-later AND GPL-2.0-or-later
 Group:          Hardware/Mobile
-URL:            https://osmocom.org/projects/osmohnbgw/wiki
+URL:            https://osmocom.org/projects/osmohnbgw
 Source:         %{name}-%{version}.tar.xz
 BuildRequires:  automake >= 1.9
 BuildRequires:  libtool >= 2
@@ -30,6 +26,9 @@
 BuildRequires:  pkgconfig >= 0.20
 # python3 for asn1tostruct.py
 BuildRequires:  python3
+%if 0%{?suse_version}
+BuildRequires:  systemd-rpm-macros
+%endif
 BuildRequires:  pkgconfig(libasn1c) >= 0.9.30
 BuildRequires:  pkgconfig(libosmo-netif) >= 0.3.0
 BuildRequires:  pkgconfig(libosmo-sigtran) >= 0.10.0
@@ -38,6 +37,7 @@
 BuildRequires:  pkgconfig(libosmogb)
 BuildRequires:  pkgconfig(libosmogsm) >= 0.12.0
 BuildRequires:  pkgconfig(libosmovty) >= 0.12.0
+%{?systemd_requires}
 
 %description
 Osmocom code for the Iuh interface (HNBAP, RUA, RANAP)
@@ -103,10 +103,13 @@
 %postun -n libosmo-ranap3 -p /sbin/ldconfig
 %post   -n libosmo-sabp0 -p /sbin/ldconfig
 %postun -n libosmo-sabp0 -p /sbin/ldconfig
+
+%if 0%{?suse_version}
 %pre     %service_add_pre    osmo-hnbgw.service
 %post    %service_add_post   osmo-hnbgw.service
 %preun   %service_del_preun  osmo-hnbgw.service
 %postun  %service_del_postun osmo-hnbgw.service
+%endif
 
 %files
 %license COPYING