aboutsummaryrefslogtreecommitdiffstats
path: root/initscripts.spec
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-09-03 16:57:32 -0400
committerBill Nottingham <notting@redhat.com>2010-09-03 16:57:32 -0400
commitea632a2bedadb6114aa15b3479eecfa84b4fd26e (patch)
tree0861d1e769b66cc0d05997be4e58716da8244b90 /initscripts.spec
parentc144039b963c0e220bdd662c61c67dc1bf1c3cc2 (diff)
downloadinitscripts-ea632a2bedadb6114aa15b3479eecfa84b4fd26e.tar
initscripts-ea632a2bedadb6114aa15b3479eecfa84b4fd26e.tar.gz
initscripts-ea632a2bedadb6114aa15b3479eecfa84b4fd26e.tar.bz2
initscripts-ea632a2bedadb6114aa15b3479eecfa84b4fd26e.tar.xz
initscripts-ea632a2bedadb6114aa15b3479eecfa84b4fd26e.zip
Add in basic systemd units.
Factor out upstart/systemd/etc. support in the spec properly.
Diffstat (limited to 'initscripts.spec')
-rw-r--r--initscripts.spec48
1 files changed, 41 insertions, 7 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 9e8fd38a..62672d5f 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -1,4 +1,6 @@
-%define with_upstart 1%{nil}
+%define _with_upstart 1
+%define _with_systemd 1
+%define _with_sysvinit 0
Summary: The inittab file and the /etc/init.d scripts
Name: initscripts
@@ -18,9 +20,15 @@ Requires: module-init-tools
Requires: util-linux-ng >= 2.16
Requires: bash >= 3.0
Requires: sysvinit-tools >= 2.87
-%if with_upstart
-Requires: upstart >= 0.6.0
-%else
+Requires: sysvinit-userspace
+%if %{_with_upstart}
+Conflicts: upstart < 0.6.0
+%endif
+%if %{_with_systemd}
+Conflicts: systemd < 9-3
+Conflicts: systemd-units < 9-3
+%endif
+%if %{_with_sysvinit}
Requires: SysVinit >= 2.85-38
%endif
Requires: /sbin/ip, /sbin/arping, net-tools, /bin/find
@@ -76,12 +84,21 @@ make ROOT=$RPM_BUILD_ROOT SUPERUSER=`id -un` SUPERGROUP=`id -gn` mandir=%{_mandi
%find_lang %{name}
-%if with_upstart
+%ig %{_with_systemd}
+ mv -f $RPM_BUILD_ROOT/etc/inittab.systemd $RPM_BUILD_ROOT/etc/inittab
+%endif
+%if %{_with_upstart}
mv -f $RPM_BUILD_ROOT/etc/inittab.upstart $RPM_BUILD_ROOT/etc/inittab
-%else
+%endif
+%if %{_with_sysvinit}
mv -f $RPM_BUILD_ROOT/etc/inittab.sysv $RPM_BUILD_ROOT/etc/inittab
+%endif
+%if ! %{_with_upstart}
rm -rf $RPM_BUILD_ROOT/etc/init
%endif
+%if ! %{_with_systemd}
+ rm -rf $RPM_BUILD_ROOT/etc/systemd $RPM_BUILD_ROOT/lib/systemd
+%endif
rm -f $RPM_BUILD_ROOT/etc/inittab.*
%ifnarch s390 s390x
@@ -105,6 +122,11 @@ chmod 600 /var/log/btmp
/sbin/chkconfig --add netfs
/sbin/chkconfig --add network
/sbin/chkconfig --add netconsole
+%if %{_with_systemd}
+if [ $1 -eq 1 ]; then
+ /bin/systemctl daemon-reload > /dev/null 2>&1 || :
+fi
+%endif
%preun
if [ $1 = 0 ]; then
@@ -118,6 +140,14 @@ fi
/sbin/chkconfig --del rawdevices
exit 0
+%if %{_with_systemd}
+%postun
+if [ $1 -ge 1 ]; then
+ /bin/systemctl daemon-reload > /dev/null 2>&1 || :
+fi
+%endif
+
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -178,9 +208,13 @@ rm -rf $RPM_BUILD_ROOT
%dir /etc/rwtab.d
/etc/statetab
%dir /etc/statetab.d
-%if with_upstart
+%if %{_with_upstart}
/etc/init/*
%endif
+%if %{_with_systemd}
+%config(noreplace) /etc/systemd/system/*
+/lib/systemd/system/*
+%endif
%config /etc/X11/prefdm
%config(noreplace) /etc/inittab
%dir /etc/rc.d