packaging: rpmlint fixes, added systemd service files.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Wed, 14 Aug 2013 15:05:21 +0000 (18:05 +0300)
committerKrisztian Litkey <kli@iki.fi>
Fri, 27 Sep 2013 08:07:38 +0000 (11:07 +0300)
Reduced rpmlint badness below the currently accepted threshold (2000).
Added service files and a simple config/env file for starting up the
daemons via systemd.

packaging/gptp.service [new file with mode: 0644]
packaging/mrpd.service [new file with mode: 0644]
packaging/openavb.changes
packaging/openavb.env [new file with mode: 0644]
packaging/openavb.spec

diff --git a/packaging/gptp.service b/packaging/gptp.service
new file mode 100644 (file)
index 0000000..82c80e4
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenAVB GPTP daemon
+After=network.target
+
+[Service]
+EnvironmentFile=/etc/sysconfig/openavb
+ExecStart=/usr/sbin/daemon_cl $AVB_IFNAME
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/mrpd.service b/packaging/mrpd.service
new file mode 100644 (file)
index 0000000..783a0b7
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenAVB MMRP/MVRP/MSRP daemon
+After=network.target
+
+[Service]
+EnvironmentFile=/etc/sysconfig/openavb
+ExecStart=/usr/sbin/mrpd -mvs -i $AVB_IFNAME -l
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
index 4f24b93..38b5bb0 100644 (file)
@@ -1,2 +1,6 @@
 * Mon Apr 15 10:20:28 EEST 2013 Krisztian Litkey <krisztian.litkey@intel.com> - 20130418
 - Preliminary packaging for tizen.
+
+* Wed Aug 14 10:20:28 EEST 2013 Krisztian Litkey <krisztian.litkey@intel.com> - 20130814
+- Rebased on upstream 41a0ca76 to compile on 3.10.4.
+- Packaging fixes to reduce rpmlint badness below the allowed threshold.
diff --git a/packaging/openavb.env b/packaging/openavb.env
new file mode 100644 (file)
index 0000000..682fa8d
--- /dev/null
@@ -0,0 +1,2 @@
+# Name of the network interface to use.
+AVB_IFNAME=enp2s0
index 827e5ab..14c4cd8 100644 (file)
@@ -9,10 +9,10 @@
 
 Summary: OpenAVB
 Name: openavb
-Version: 20130418
+Version: 20130814
 Release: 1
-License: Other
-Group: System Environment/Daemons
+License: Intel and GPL-2.0
+Group: Base/Utilities
 URL: https://github.com/intel-ethernet/Open-AVB
 Source0: %{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -24,26 +24,27 @@ BuildRequires: pkgconfig(libpci)
 BuildRequires: pkgconfig(zlib)
 
 %package kmod-igb
-Summary: OpenAVB kernel module for Intel ethernet cards.
-Group: System Environment/Kernel
-Requires: %{kernel}-%{kernel_release}
+Summary: kernel module for Intel ethernet cards
+Group: System/Kernel
+Requires: %{kernel} = %{kernel_release}
 
 %package libigb
-Summary: igb runtime library from the OpenAVB distribution.
-Group: System Environment/Libraries
+Summary: IGB runtime library
+Group: System/Libraries
 
 %package examples
-Summary: Example clients from the OpenAVB distribution.
-Group: Applications/Communications
+Summary: Example clients
+Group: Applications/System
 Requires: openavb-libigb = %{version}
 
 %package devel
-Summary: Headers and libraries from the OpenAVB distribution.
+Summary: Headers and libraries
 Group: Development/Libraries
+Requires: %{name} = %{version}
 
 %package doc
-Summary: Documentation from theOpenAVB distribution.
-Group: Documentation
+Summary: Documentation
+Group: Development/Tools
 
 %description
 This package contains the basic OpenAVB userspace daemons.
@@ -69,10 +70,11 @@ This package contains some documentation from the OpenAVB distribution.
 %setup -q
 
 %build
-%if %{?_with_debug:1}%{!?_with_debug:0}
+# For now, always compile for debugging...
+#%if %{?_with_debug:1}%{!?_with_debug:0}
 export CFLAGS="-O0 -g3"
 export CXXFLAGS="-O0 -g3"
-%endif
+#%endif
 
 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
                grep '^processor *:' | wc -l`"
@@ -92,12 +94,23 @@ make DESTDIR=$RPM_BUILD_ROOT \
 
 rm -f $RPM_BUILD_ROOT%{_libdir}/libigb.la
 
+# Install systemd and sample 'configuration' files.
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig \
+    $RPM_BUILD_ROOT/lib/systemd/system
+/usr/bin/install -m 644 packaging/openavb.env \
+    $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/openavb
+/usr/bin/install -m 644 -t $RPM_BUILD_ROOT/lib/systemd/system \
+    packaging/mrpd.service packaging/gptp.service
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post libigb
 ldconfig
 
+%postun libigb
+ldconfig
+
 %post kmod-igb
 depmod -a %{kernel_moddir}
 
@@ -106,6 +119,9 @@ depmod -a %{kernel_moddir}
 %{_sbindir}/daemon_cl
 %{_sbindir}/mrpd
 %{_bindir}/mrpctl
+%{_sysconfdir}/sysconfig/openavb
+/lib/systemd/system/mrpd.service
+/lib/systemd/system/gptp.service
 
 %files kmod-igb
 %defattr(-,root,root,-)
@@ -129,8 +145,6 @@ depmod -a %{kernel_moddir}
 
 %files doc
 %defattr(-,root,root,-)
-%doc README.rst documents examples
-
-%changelog
-* Tue Nov 27 2012 Krisztian Litkey <krisztian.litkey@intel.com> -
-- Initial build for 2.0alpha.
+%doc README.rst documents
+%license examples/LICENSE
+%doc examples/mrp_client examples/simple_listener examples/simple_talker