spec: don't build sysvinit for Fedora and CentOS

This commit is contained in:
Frédéric Pierret (fepitre) 2020-08-23 12:43:55 +02:00
parent d0b699c59f
commit 562b871188
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -23,6 +23,13 @@
%define qubes_services qubes-core qubes-core-netvm qubes-core-early qubes-firewall qubes-iptables qubes-updates-proxy qubes-updates-proxy-forwarder %define qubes_services qubes-core qubes-core-netvm qubes-core-early qubes-firewall qubes-iptables qubes-updates-proxy qubes-updates-proxy-forwarder
%define qubes_preset_file 75-qubes-vm.preset %define qubes_preset_file 75-qubes-vm.preset
# systemd is used in Fedora and CentOS
%if 0%{?fedora} || 0%{?rhel}
%define with_sysvinit 0
%else
%define with_sysvinit 1
%endif
%define scriptletfuns is_static() { \ %define scriptletfuns is_static() { \
[ -f "%{_unitdir}/$1" ] && ! grep -q '^[[].nstall]' "%{_unitdir}/$1" \ [ -f "%{_unitdir}/$1" ] && ! grep -q '^[[].nstall]' "%{_unitdir}/$1" \
} \ } \
@ -321,6 +328,10 @@ sed -i \
install -D -m 0644 boot/dracut-qubes.conf $RPM_BUILD_ROOT/usr/lib/dracut/dracut.conf.d/30-qubes.conf install -D -m 0644 boot/dracut-qubes.conf $RPM_BUILD_ROOT/usr/lib/dracut/dracut.conf.d/30-qubes.conf
install -D -m 0644 boot/grub.qubes $RPM_BUILD_ROOT/etc/default/grub.qubes install -D -m 0644 boot/grub.qubes $RPM_BUILD_ROOT/etc/default/grub.qubes
%if ! %with_sysvinit
rm -rf $RPM_BUILD_ROOT/etc/init.d/qubes-* $RPM_BUILD_ROOT/etc/sysconfig/modules/qubes-core.modules
%endif
%triggerin -- initscripts %triggerin -- initscripts
if [ -e /etc/init/serial.conf ]; then if [ -e /etc/init/serial.conf ]; then
cp /usr/share/qubes/serial.conf /etc/init/serial.conf cp /usr/share/qubes/serial.conf /etc/init/serial.conf
@ -777,6 +788,7 @@ rm -f %{name}-%{version}
%config(noreplace) /etc/sudoers.d/qubes %config(noreplace) /etc/sudoers.d/qubes
%config(noreplace) /etc/pam.d/su.qubes %config(noreplace) /etc/pam.d/su.qubes
%if %with_sysvinit
%package sysvinit %package sysvinit
Summary: Qubes unit files for SysV init style or upstart Summary: Qubes unit files for SysV init style or upstart
License: GPL v2 only License: GPL v2 only
@ -842,6 +854,7 @@ if [ "$1" = 0 ] ; then
chkconfig --del $svc chkconfig --del $svc
done done
fi fi
%endif
%package systemd %package systemd
Summary: Qubes unit files for SystemD init style Summary: Qubes unit files for SystemD init style