diff --git a/aiccu-lsb-initscript.patch b/aiccu-lsb-initscript.patch deleted file mode 100644 index 0e361f1..0000000 --- a/aiccu-lsb-initscript.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- aiccu/doc/aiccu.init.rpm.orig 2007-09-21 21:15:04.000000000 -0500 -+++ aiccu/doc/aiccu.init.rpm 2007-09-21 21:19:19.000000000 -0500 -@@ -8,6 +8,20 @@ - # config: /etc/aiccu.conf - # chkconfig: - 59 73 - # processname: aiccu -+# -+### BEGIN INIT INFO -+# Provides: aiccu -+# Required-Start: $local_fs $remote_fs $network $time $named -+# Required-Stop: $local_fs $remote_fs $network $time $named -+# Default-Start: -+# Default-Stop: -+# Short-Description: hearbeat daemon for IPv6-in-IPv4 (Proto-41, AYIYA, Heartbeat) tunnels -+# Description: aiccu automatically gives one IPv6 connectivity -+# without having to manually configure interfaces etc. -+# One does need a SixXS account and at least a tunnel. These -+# can be freely & gratis requested from the SixXS website. -+# For more information about SixXS check http://www.sixxs.net -+### END INIT INFO - - # Source function library. - if [ -f /etc/init.d/functions ] ; then -@@ -90,6 +104,9 @@ - reload) - restart - ;; -+ force-reload) -+ restart -+ ;; - status) - rhstatus - ;; diff --git a/aiccu-run.patch b/aiccu-run.patch new file mode 100644 index 0000000..21d0100 --- /dev/null +++ b/aiccu-run.patch @@ -0,0 +1,12 @@ +diff -up aiccu/common/aiccu.h.run aiccu/common/aiccu.h +--- aiccu/common/aiccu.h.run 2011-07-06 22:22:40.944419473 +0200 ++++ aiccu/common/aiccu.h 2011-07-06 22:23:57.240419462 +0200 +@@ -68,7 +68,7 @@ + #define AICCU_CACHE "/var/cache/aiccu.cache" + + /* The PID we are running as when daemonized */ +-#define AICCU_PID "/var/run/aiccu.pid" ++#define AICCU_PID "/run/aiccu.pid" + + /* AICCU Configuration file */ + #ifdef _WIN32 diff --git a/aiccu.service b/aiccu.service new file mode 100644 index 0000000..5a76c44 --- /dev/null +++ b/aiccu.service @@ -0,0 +1,11 @@ +[Unit] +Description=AICCU (AAutomatic IPv6 Connectivity Configuration Utility) +After=syslog.target network.target + +[Service] +Type=forking +EnvironmentFile=/etc/sysconfig/aiccu +ExecStart=/usr/sbin/aiccu start $OPTIONS + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/aiccu.spec b/aiccu.spec index c4530ba..d04ad44 100644 --- a/aiccu.spec +++ b/aiccu.spec @@ -9,19 +9,21 @@ Summary: SixXS Automatic IPv6 Connectivity Client Utility Name: aiccu Version: 2007.01.15 -Release: 8%{?dist} +Release: 9%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.sixxs.net/tools/aiccu/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Source: http://www.sixxs.net/archive/sixxs/aiccu/unix/aiccu_20070115.tar.gz -Patch0: aiccu-lsb-initscript.patch -Patch1: aiccu-cloexec.patch +Source0: http://www.sixxs.net/archive/sixxs/aiccu/unix/aiccu_20070115.tar.gz +Source1: aiccu.service +Patch0: aiccu-cloexec.patch +Patch1: aiccu-run.patch BuildRequires: gnutls-devel +BuildRequires: systemd-units Requires: iproute -Requires(post): chkconfig -Requires(preun): chkconfig, initscripts -Requires(postun): initscripts +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units %description This client automatically gives one IPv6 connectivity @@ -33,7 +35,7 @@ For more information about SixXS check http://www.sixxs.net %prep %setup -q -n %{name} %patch0 -p1 -%patch1 -p1 +%patch1 -p1 -b .run # fix executable permissions on non-executable content # so debuginfo can pick them up properly @@ -47,19 +49,30 @@ rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT +# remove old-style init script +rm $RPM_BUILD_ROOT%{_sysconfdir}/init.d/* + +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +install -p %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/ + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/aiccu + %post if [ "$1" = "1" ]; then - /sbin/chkconfig --add aiccu + /bin/systemctl --daemon-reload >/dev/null 2>&1 || : fi %preun if [ "$1" = "0" ]; then - /sbin/service aiccu stop >/dev/null 2>&1 - /sbin/chkconfig --del aiccu + /bin/systemctl disable aiccu.service >/dev/null 2>&1 || : + /bin/systemctl stop aiccu.service >/dev/null 2>&1 || : fi %postun -/sbin/service aiccu condrestart > /dev/null 2>&1 || : +if [ "$1" -ge 1 ]; then + /bin/systemctl try-restart aiccu.service >/dev/null 2>&1 || : +fi %clean make clean @@ -72,9 +85,13 @@ make clean # aiccu.conf contains the users's SixXS password, so don't # make it readable by non-root %attr(600, root,root) %config(noreplace) %{_sysconfdir}/aiccu.conf -%{_sysconfdir}/init.d/aiccu +%{_unitdir}/aiccu.service +%{_sysconfdir}/sysconfig/aiccu %changelog +* Wed Jul 6 2011 Jochen Schmitt - 2007.01.15-9 +- Implementing native systemd support + * Mon Feb 07 2011 Fedora Release Engineering - 2007.01.15-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild