Accepting request 556893 from home:markoschandras:branches:network:dhcp
- Drop old sysvinit support from the spec file. All the supported openSUSE distributions are systemd based so there isn't much point in keeping sysvinit support and files around. OBS-URL: https://build.opensuse.org/request/show/556893 OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=179
This commit is contained in:
committed by
Git OBS Bridge
parent
917d150f5d
commit
fe306dab60
103
dhcp.spec
103
dhcp.spec
@@ -31,11 +31,6 @@
|
||||
%define with_ldapcasa 0%{?sles_version} >= 10 || (%suse_version >= 1110 && %suse_version < 1140)
|
||||
# doc package is new on 11.3
|
||||
%define with_doc_package %suse_version >= 1130
|
||||
%if 0%{?suse_version} >= 1310
|
||||
%bcond_without systemd
|
||||
%else
|
||||
%bcond_with systemd
|
||||
%endif
|
||||
|
||||
Name: dhcp
|
||||
%if %{with_ldap}
|
||||
@@ -58,17 +53,10 @@ Source2: %{name}.keyring
|
||||
#
|
||||
Source10: dhcpd.script
|
||||
Source11: dhcrelay.script
|
||||
%if %{with systemd}
|
||||
Source12: dhcpd.service
|
||||
Source13: dhcpd6.service
|
||||
Source14: dhcrelay.service
|
||||
Source15: dhcrelay6.service
|
||||
%else
|
||||
Source12: rc.dhcpd
|
||||
Source13: rc.dhcpd6
|
||||
Source14: rc.dhcrelay
|
||||
Source15: rc.dhcrelay6
|
||||
%endif
|
||||
Source17: sysconfig.dhcpd
|
||||
Source18: sysconfig.dhcrelay
|
||||
Source19: if-up.d.dhcpd-restart-hook
|
||||
@@ -135,9 +123,6 @@ Summary: ISC DHCP Server
|
||||
Group: Productivity/Networking/Boot/Servers
|
||||
Requires: dhcp = %{version}
|
||||
Requires: net-tools
|
||||
%if !%{with systemd}
|
||||
PreReq: %insserv_prereq
|
||||
%endif
|
||||
PreReq: %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd
|
||||
|
||||
%package client
|
||||
@@ -159,9 +144,6 @@ Summary: ISC DHCP Relay Agent
|
||||
Group: Productivity/Networking/Boot/Servers
|
||||
Requires: dhcp = %{version}
|
||||
Requires: net-tools
|
||||
%if !%{with systemd}
|
||||
PreReq: %insserv_prereq
|
||||
%endif
|
||||
PreReq: %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
||||
|
||||
%package devel
|
||||
@@ -348,12 +330,6 @@ make %{?_smp_mflags}
|
||||
./server/dhcpd -4 -t -cf $RPM_SOURCE_DIR/dhcpd.conf
|
||||
./server/dhcpd -6 -t -cf $RPM_SOURCE_DIR/dhcpd6.conf
|
||||
# check syntax in our scripts
|
||||
%if !%{with systemd}
|
||||
bash -n $RPM_SOURCE_DIR/rc.dhcpd
|
||||
bash -n $RPM_SOURCE_DIR/rc.dhcpd6
|
||||
bash -n $RPM_SOURCE_DIR/rc.dhcrelay
|
||||
bash -n $RPM_SOURCE_DIR/rc.dhcrelay6
|
||||
%endif
|
||||
bash -n $RPM_SOURCE_DIR/dhcpd.script
|
||||
bash -n $RPM_SOURCE_DIR/dhcrelay.script
|
||||
bash -n $RPM_SOURCE_DIR/dhclient-script
|
||||
@@ -397,7 +373,6 @@ install -m0755 $RPM_SOURCE_DIR/dhcpd.script \
|
||||
sed -e 's/@LIBDIR@/%{_lib}/g' -i $RPM_BUILD_ROOT/usr/lib/dhcp/dhcpd
|
||||
install -m0755 $RPM_SOURCE_DIR/dhcrelay.script \
|
||||
$RPM_BUILD_ROOT/usr/lib/dhcp/dhcrelay
|
||||
%if %{with systemd}
|
||||
# service units
|
||||
install -d -m0755 $RPM_BUILD_ROOT%{_unitdir}
|
||||
install -m0644 $RPM_SOURCE_DIR/dhcpd.service \
|
||||
@@ -413,23 +388,6 @@ ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd
|
||||
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd6
|
||||
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay
|
||||
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay6
|
||||
%else
|
||||
# service scripts
|
||||
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/init.d
|
||||
install -m0755 $RPM_SOURCE_DIR/rc.dhcpd \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd
|
||||
install -m0755 $RPM_SOURCE_DIR/rc.dhcpd6 \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd6
|
||||
install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay
|
||||
install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay6 \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay6
|
||||
# rcservice links
|
||||
ln -sf %{_sysconfdir}/init.d/dhcpd $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd
|
||||
ln -sf %{_sysconfdir}/init.d/dhcpd6 $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd6
|
||||
ln -sf %{_sysconfdir}/init.d/dhcrelay $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay
|
||||
ln -sf %{_sysconfdir}/init.d/dhcrelay6 $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay6
|
||||
%endif
|
||||
%if %suse_version > 1310
|
||||
# rcservice actions
|
||||
legacy_actionsdir=$RPM_BUILD_ROOT/usr/lib/initscripts/legacy-actions
|
||||
@@ -510,21 +468,14 @@ mv $RPM_BUILD_ROOT%_libdir/lib*.* \
|
||||
|
||||
%pre server
|
||||
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||:
|
||||
%if %{with systemd}
|
||||
%service_add_pre dhcpd.service
|
||||
%service_add_pre dhcpd6.service
|
||||
%endif
|
||||
|
||||
%post server
|
||||
%if %{with systemd}
|
||||
%{fillup_only -n dhcpd dhcpd}
|
||||
%{fillup_only -ans syslog dhcpd}
|
||||
%service_add_post dhcpd.service
|
||||
%service_add_post dhcpd6.service
|
||||
%else
|
||||
%{fillup_and_insserv -n dhcpd dhcpd dhcpd6}
|
||||
%{fillup_only -ans syslog dhcpd}
|
||||
%endif
|
||||
# FIXME: update?
|
||||
if [ ${FIRST_ARG:-0} -gt 1 ]; then
|
||||
if grep -q '^DHCPD_RUN_AS=.*nobody' etc/sysconfig/dhcpd; then
|
||||
@@ -542,37 +493,16 @@ if [ ${FIRST_ARG:-0} -gt 1 ]; then
|
||||
fi
|
||||
|
||||
%preun server
|
||||
%if %{with systemd}
|
||||
%service_del_preun dhcpd.service
|
||||
%service_del_preun dhcpd6.service
|
||||
%else
|
||||
if test -x /etc/init.d/dhcpd ; then
|
||||
%stop_on_removal dhcpd
|
||||
fi
|
||||
if test -x /etc/init.d/dhcpd6 ; then
|
||||
%stop_on_removal dhcpd6
|
||||
fi
|
||||
%endif
|
||||
|
||||
%postun server
|
||||
%if %{with systemd}
|
||||
%service_del_postun dhcpd.service
|
||||
%service_del_postun dhcpd6.service
|
||||
%else
|
||||
if test -x /etc/init.d/dhcpd ; then
|
||||
%restart_on_update dhcpd
|
||||
fi
|
||||
if test -x /etc/init.d/dhcpd6 ; then
|
||||
%restart_on_update dhcpd6
|
||||
fi
|
||||
%insserv_cleanup
|
||||
%endif
|
||||
|
||||
%pre relay
|
||||
%if %{with systemd}
|
||||
%service_add_pre dhcrelay.service
|
||||
%service_add_pre dhcrelay6.service
|
||||
%endif
|
||||
|
||||
%post relay
|
||||
#
|
||||
@@ -581,40 +511,17 @@ fi
|
||||
%{rename_sysconfig_variable -f etc/sysconfig/dhcrelay
|
||||
DHCRELAY6_UPPER_INTERFACES_ARGS DHCRELAY6_UPPER_INTERFACES}
|
||||
#
|
||||
%if %{with systemd}
|
||||
%{fillup_only -n dhcrelay dhcrelay}
|
||||
%service_add_post dhcrelay.service
|
||||
%service_add_post dhcrelay6.service
|
||||
%else
|
||||
%{fillup_and_insserv -n dhcrelay dhcrelay dhcrelay6}
|
||||
%endif
|
||||
|
||||
%preun relay
|
||||
%if %{with systemd}
|
||||
%service_del_preun dhcrelay.service
|
||||
%service_del_preun dhcrelay6.service
|
||||
%else
|
||||
if test -x /etc/init.d/dhcrelay ; then
|
||||
%stop_on_removal dhcrelay
|
||||
fi
|
||||
if test -x /etc/init.d/dhcrelay6 ; then
|
||||
%stop_on_removal dhcrelay6
|
||||
fi
|
||||
%endif
|
||||
|
||||
%postun relay
|
||||
%if %{with systemd}
|
||||
%service_del_postun dhcrelay.service
|
||||
%service_del_postun dhcrelay6.service
|
||||
%else
|
||||
if test -x /etc/init.d/dhcrelay ; then
|
||||
%restart_on_update dhcrelay
|
||||
fi
|
||||
if test -x /etc/init.d/dhcrelay6 ; then
|
||||
%restart_on_update dhcrelay6
|
||||
fi
|
||||
%insserv_cleanup
|
||||
%endif
|
||||
|
||||
%post client
|
||||
test -e %{_localstatedir}/lib/dhcp/dhclient.leases || \
|
||||
@@ -640,7 +547,6 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
||||
%{_sbindir}/dhcpd6
|
||||
%{_sbindir}/rcdhcpd
|
||||
%{_sbindir}/rcdhcpd6
|
||||
%if %{with systemd}
|
||||
%{_unitdir}/dhcpd.service
|
||||
%{_unitdir}/dhcpd6.service
|
||||
%if %suse_version > 1310
|
||||
@@ -649,10 +555,6 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
||||
%dir /usr/lib/initscripts/legacy-actions/dhcpd6
|
||||
/usr/lib/initscripts/legacy-actions/dhcpd6/*
|
||||
%endif
|
||||
%else
|
||||
%config %{_sysconfdir}/init.d/dhcpd
|
||||
%config %{_sysconfdir}/init.d/dhcpd6
|
||||
%endif
|
||||
%config(noreplace) %{_sysconfdir}/dhcpd.conf
|
||||
%config(noreplace) %{_sysconfdir}/dhcpd6.conf
|
||||
%attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd.d/
|
||||
@@ -720,13 +622,8 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
||||
%{_sbindir}/rcdhcrelay6
|
||||
%dir /usr/lib/dhcp
|
||||
/usr/lib/dhcp/dhcrelay
|
||||
%if %{with systemd}
|
||||
%{_unitdir}/dhcrelay.service
|
||||
%{_unitdir}/dhcrelay6.service
|
||||
%else
|
||||
%config %{_sysconfdir}/init.d/dhcrelay
|
||||
%config %{_sysconfdir}/init.d/dhcrelay6
|
||||
%endif
|
||||
%doc %{_mandir}/man8/dhcrelay.8.gz
|
||||
%{_fillupdir}/sysconfig.dhcrelay
|
||||
|
||||
|
Reference in New Issue
Block a user