Support RPM building via contrib/osmo-e1-recorder.spec.in

Change-Id: I1851b5c2a68ec9559e42c9da3f04d43c0fc7cdfe
diff --git a/Makefile.am b/Makefile.am
index 24f0b24..d8c83a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,7 @@
 	$(NULL)
 
 BUILT_SOURCES = $(top_srcdir)/.version
-EXTRA_DIST = git-version-gen osmoappdesc.py .version
+EXTRA_DIST = git-version-gen osmoappdesc.py .version contrib/osmo-e1-recorder.spec.in
 
 AM_DISTCHECK_CONFIGURE_FLAGS = \
 	--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
diff --git a/configure.ac b/configure.ac
index 65a2c7f..568584d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,4 +192,5 @@
     doc/Makefile
     tests/Makefile
     doc/examples/Makefile
+    contrib/osmo-e1-recorder.spec
     Makefile)
diff --git a/contrib/osmo-e1-recorder.spec.in b/contrib/osmo-e1-recorder.spec.in
new file mode 100644
index 0000000..e7f1dba
--- /dev/null
+++ b/contrib/osmo-e1-recorder.spec.in
@@ -0,0 +1,68 @@
+#
+# spec file for package osmo-e1-recorder
+#
+# Copyright (c) 2018, Martin Hauke <mardnh@gmx.de>
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+Name:           osmo-e1-recorder
+Version:        @VERSION@
+Release:        0
+Summary:        Osmocom E1/T1 span recorder
+License:        GPL-2.0-or-later
+Group:          Productivity/Telephony/Utilities
+URL:            https://gitea.osmocom.org/cellular-infrastructure/osmo-e1-recorder
+Source:         %{name}-%{version}.tar.xz
+BuildRequires:  autoconf
+BuildRequires:  autoconf-archive
+BuildRequires:  automake
+BuildRequires:  libtool
+BuildRequires:  pkgconfig
+BuildRequires:  pkgconfig(libosmoabis)
+BuildRequires:  pkgconfig(libosmocore)
+BuildRequires:  pkgconfig(libosmogsm)
+BuildRequires:  pkgconfig(libosmovty)
+BuildRequires:  pkgconfig(talloc)
+
+%description
+The idea of this program is to be able to passively record E1/T1 based
+communications for purposes of data analysis.
+
+Recording of a single E1 link always requires two E1 interface cards,
+one for each direction.
+
+%prep
+%setup -q
+
+%build
+echo "%{version}" >.tarball-version
+autoreconf -fi
+%configure \
+  --docdir=%{_docdir}/%{name}
+make %{?_smp_mflags}
+
+%install
+%make_install
+
+%check
+make %{?_smp_mflags} check
+
+%files
+%doc README
+%{_docdir}/osmo-e1-recorder/examples/osmo-e1-recorder.cfg
+%dir %{_docdir}/%{name}/examples
+%{_docdir}/%{name}/examples/osmo-e1-recorder.cfg
+%dir %{_sysconfdir}/osmocom
+%config %{_sysconfdir}/osmocom/osmo-e1-recorder.cfg
+%{_bindir}//hdlc-test
+%{_bindir}/osmo-e1-recorder
+%{_bindir}/osmo-e1cap-dump
+
+%changelog