[ladvd/f15/master] - provide systemd and tmpfiles integration bits

Tomasz Torcz ttorcz at fedoraproject.org
Sun Feb 13 15:48:14 UTC 2011


commit dde11604ac23d742369f19ceadf17662887d825c
Author: Tomasz Torcz <zdzichu at irc.pl>
Date:   Sun Feb 13 16:48:00 2011 +0100

    - provide systemd and tmpfiles integration bits

 ladvd.service  |   12 ++++++++++++
 ladvd.spec     |   21 ++++++++++++++++++++-
 ladvd.tmpfiles |    1 +
 3 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/ladvd.service b/ladvd.service
new file mode 100644
index 0000000..439c334
--- /dev/null
+++ b/ladvd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=uses cdp / lldp frames to inform switches about connected hosts
+Requires=network.target
+
+[Service]
+EnvironmentFile=/etc/sysconfig/ladvd
+ExecStart=/usr/sbin/ladvd -f $LADVD_OPTIONS
+PIDFile=/var/run/ladvd.pid
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ladvd.spec b/ladvd.spec
index 9378e81..3fe3ec1 100644
--- a/ladvd.spec
+++ b/ladvd.spec
@@ -9,7 +9,7 @@
 
 Name:           ladvd
 Version:        0.9.2
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        CDP/LLDP sender for unix
 
 Group:          Applications/Internet
@@ -21,6 +21,8 @@ Source2:        ladvd.init
 Source3:        %{modulename}.te
 Source4:        %{modulename}.fc
 Source5:        %{modulename}.if
+Source6:        ladvd.tmpfiles
+Source7:        ladvd.service
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libevent-devel
@@ -37,6 +39,8 @@ Provides:       user(%username)  = %uid
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig
 Requires(preun): /sbin/service
+Requires:        systemd-units
+Requires:        initscripts
 
 
 %description 
@@ -91,6 +95,11 @@ rm -rf %{buildroot}%{_docdir}/ladvd
 install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 install -D -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name}
 mkdir -p %{buildroot}%{homedir}
+mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d
+install -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf
+mkdir -p %{buildroot}/lib/systemd/system/
+cp -p %SOURCE7 %{buildroot}/lib/systemd/system/
+
 
 cd SELinux
 for selinuxvariant in %{selinux_variants}
@@ -151,6 +160,11 @@ done
 /sbin/restorecon -R %{_localstatedir}/cache/myapp &> /dev/null || :
 fi
 
+%triggerun -- ladvd < 0.9.2.-2
+if /sbin/chkconfig ladvd ; then
+        /bin/systemctl enable ladvd.service >/dev/null 2>&1 || :
+fi
+
 
 %files
 %defattr(-,root,root,-)
@@ -162,6 +176,8 @@ fi
 %{_mandir}/man8/%{name}.8*
 %{_mandir}/man8/%{name}c.8*
 %ghost %attr(0755,root,root) %dir %{_localstatedir}/run/%{name}
+%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
+/lib/systemd/system/%{name}.service
 
 
 %files selinux
@@ -171,6 +187,9 @@ fi
 
 
 %changelog
+* Sun Feb 13 2011 Tomasz Torcz <ttorcz at fedoraproject.org> - 0.9.2-2
+- provide systemd and tmpfiles integration bits
+
 * Sun Feb 13 2011 Tomasz Torcz <ttorcz at fedoraproject.org> - 0.9.2-1
 - new upstream version 0.9.2
 - package ladvdc - client command
diff --git a/ladvd.tmpfiles b/ladvd.tmpfiles
new file mode 100644
index 0000000..a883237
--- /dev/null
+++ b/ladvd.tmpfiles
@@ -0,0 +1 @@
+d	/var/run/ladvd	0755 root root


More information about the scm-commits mailing list