|
@@ -1,8 +1,10 @@
|
|
|
+%bcond_with systemd
|
|
|
+
|
|
|
# vendor string (e.g., Fedora, EL)
|
|
|
%define vvendor Vine
|
|
|
|
|
|
-%define pversion 4.1.ESV.R16
|
|
|
-%define sversion 4.1-ESV-R16
|
|
|
+%define pversion 4.1.ESV.R16.P1
|
|
|
+%define sversion 4.1-ESV-R16-P1
|
|
|
|
|
|
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
|
|
|
Summary(ja): DHCP (動的ホスト設定プロトコル) サーバおよびリレーエージェント
|
|
@@ -16,10 +18,13 @@ Name: dhcp
|
|
|
# --------------------------------------------------------------------------
|
|
|
Epoch: 13
|
|
|
Version: %{pversion}
|
|
|
-Release: 1%{?_dist_release}
|
|
|
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
+Group: daemons
|
|
|
+Vendor: Project Vine
|
|
|
+Distribution: Vine Linux
|
|
|
+Packager: daisuke, iwamoto
|
|
|
|
|
|
License: ISC
|
|
|
-Group: System Environment/Daemons
|
|
|
URL: https://isc.org/products/DHCP/
|
|
|
|
|
|
Source0: https://downloads.isc.org/isc/dhcp/%{sversion}/dhcp-%{sversion}.tar.gz
|
|
@@ -33,6 +38,10 @@ Source9: dhcp.schema
|
|
|
Source10: get-ldap-patch.sh
|
|
|
Source11: dhcpd6.init
|
|
|
|
|
|
+Source101: dhcpd.service
|
|
|
+Source111: dhcpd6.service
|
|
|
+Source102: dhcrelay.service
|
|
|
+
|
|
|
Patch0: 0001-errwarn-message.patch
|
|
|
Patch1: 0002-ldap-configuration.patch
|
|
|
Patch3: 0003-options.patch
|
|
@@ -63,14 +72,15 @@ BuildRequires: libtool
|
|
|
BuildRequires: openldap-devel
|
|
|
BuildRequires: openssl-devel
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
+BuildRequires: systemd-devel
|
|
|
+%{?systemd_requires}
|
|
|
+%else
|
|
|
Requires(post): chkconfig
|
|
|
Requires(preun): chkconfig
|
|
|
Requires(preun): initscripts
|
|
|
Requires(postun): initscripts
|
|
|
-
|
|
|
-Packager: daisuke, iwamoto
|
|
|
-Vendor: Project Vine
|
|
|
-Distribution: Vine Linux
|
|
|
+%endif
|
|
|
|
|
|
%description
|
|
|
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
|
@@ -84,11 +94,15 @@ To use DHCP on your network, install a DHCP service (or relay agent),
|
|
|
and on clients run a DHCP client daemon. The dhcp package provides
|
|
|
the ISC DHCP service and relay agent.
|
|
|
|
|
|
+
|
|
|
%package -n dhclient
|
|
|
Summary: Provides the dhclient ISC DHCP client daemon and dhclient-script
|
|
|
Summary(ja): DHCP クライアントデーモンと dhclient スクリプト
|
|
|
-Group: System Environment/Base
|
|
|
+Group: system
|
|
|
+%if %{with systemd}
|
|
|
+%else
|
|
|
Requires: initscripts >= 6.75
|
|
|
+%endif
|
|
|
#Obsoletes: dhcpcd <= 1.3.22pl1-7
|
|
|
#Provides: dhcpcd = 1.3.22pl1-8
|
|
|
Obsoletes: dhcpcd <= 1.3.22pl4-0vl3
|
|
@@ -104,15 +118,20 @@ To use DHCP on your network, install a DHCP service (or relay agent),
|
|
|
and on clients run a DHCP client daemon. The dhclient package
|
|
|
provides the ISC DHCP client daemon.
|
|
|
|
|
|
+
|
|
|
%package devel
|
|
|
Summary: Development headers and libraries for interfacing to the DHCP server
|
|
|
Summary(ja): DHCP サーバ用インタフェースライブラリとヘッダファイル
|
|
|
-Group: Development/Libraries
|
|
|
+Group: programming
|
|
|
|
|
|
%description devel
|
|
|
Header files and API documentation for using the ISC DHCP libraries. The
|
|
|
libdhcpctl and libomapi static libraries are also included in this package.
|
|
|
|
|
|
+
|
|
|
+%debug_package
|
|
|
+
|
|
|
+
|
|
|
%prep
|
|
|
%setup -q -n %{name}-%{sversion}
|
|
|
|
|
@@ -220,30 +239,33 @@ for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do
|
|
|
-e 's|ETCDIR|%{_sysconfdir}/dhcp|g' $page
|
|
|
done
|
|
|
|
|
|
-aclocal
|
|
|
-libtoolize --copy --force
|
|
|
-autoconf
|
|
|
-autoheader
|
|
|
-automake --foreign --add-missing --copy
|
|
|
+autoreconf -ivf
|
|
|
+
|
|
|
|
|
|
%build
|
|
|
-CFLAGS="%{optflags} -fPIC" \
|
|
|
+CFLAGS="%{optflags} -fPIC -fno-strict-aliasing -fcommon" \
|
|
|
%configure \
|
|
|
--enable-dhcpv6 \
|
|
|
--with-srv-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd.leases \
|
|
|
--with-srv6-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd6.leases \
|
|
|
--with-cli-lease-file=%{_localstatedir}/lib/dhclient/dhclient.leases \
|
|
|
--with-cli6-lease-file=%{_localstatedir}/lib/dhclient/dhclient6.leases \
|
|
|
- --with-srv-pid-file=%{_localstatedir}/run/dhcpd.pid \
|
|
|
- --with-srv6-pid-file=%{_localstatedir}/run/dhcpd6.pid \
|
|
|
+ --with-srv-pid-file=%{_localstatedir}/run/dhcp/dhcpd.pid \
|
|
|
+ --with-srv6-pid-file=%{_localstatedir}/run/dhcp/dhcpd6.pid \
|
|
|
--with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \
|
|
|
--with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \
|
|
|
- --with-relay-pid-file=%{_localstatedir}/run/dhcrelay.pid \
|
|
|
+ --with-relay-pid-file=%{_localstatedir}/run/dhcp/dhcrelay.pid \
|
|
|
--with-ldap \
|
|
|
--with-ldapcrypto \
|
|
|
- --enable-paranoia
|
|
|
+ --enable-log-pid \
|
|
|
+ --enable-paranoia --enable-early-chroot \
|
|
|
+%if %{with systemd}
|
|
|
+ --with-systemd
|
|
|
+%endif
|
|
|
+ %{nil}
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
+
|
|
|
%install
|
|
|
%{__rm} -rf %{buildroot}
|
|
|
%{__make} install DESTDIR=%{buildroot}
|
|
@@ -257,11 +279,19 @@ CFLAGS="%{optflags} -fPIC" \
|
|
|
%{__mv} %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
|
|
|
%{__install} -p -m 0755 client/scripts/linux %{buildroot}/sbin/dhclient-script
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
+%{__mkdir} -p %{buildroot}%{_unitdir}
|
|
|
+%{__install} -p -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}/
|
|
|
+%{__install} -p -m 0644 %{SOURCE111} %{buildroot}%{_unitdir}/
|
|
|
+%{__install} -p -m 0644 %{SOURCE102} %{buildroot}%{_unitdir}/
|
|
|
+%else
|
|
|
# Install init scripts
|
|
|
+%{__mkdir} -p %{buildroot}%{_localstatedir}/run/dhcp
|
|
|
%{__mkdir} -p %{buildroot}%{_initrddir}
|
|
|
%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/dhcpd
|
|
|
%{__install} -p -m 0755 %{SOURCE11} %{buildroot}%{_initrddir}/dhcpd6
|
|
|
%{__install} -p -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/dhcrelay
|
|
|
+%endif
|
|
|
|
|
|
# Start empty lease databases
|
|
|
%{__mkdir} -p %{buildroot}%{_localstatedir}/lib/dhcpd/
|
|
@@ -324,18 +354,36 @@ EOF
|
|
|
# remove perl module (depend perl(Win32API::Registry))
|
|
|
%{__rm} -rf __fedora_contrib/ms2isc
|
|
|
|
|
|
+
|
|
|
%clean
|
|
|
%{__rm} -rf %{buildroot}
|
|
|
|
|
|
+
|
|
|
+%pre
|
|
|
+%global gid_uid 177
|
|
|
+getent group dhcpd >/dev/null || groupadd --force --gid %{gid_uid} --system dhcpd
|
|
|
+if ! getent passwd dhcpd >/dev/null ; then
|
|
|
+ if ! getent passwd %{gid_uid} >/dev/null ; then
|
|
|
+ useradd --system --uid %{gid_uid} --gid dhcpd --home / --shell /sbin/nologin --comment "DHCP server" dhcpd
|
|
|
+ else
|
|
|
+ useradd --system --gid dhcpd --home / --shell /sbin/nologin --comment "DHCP server" dhcpd
|
|
|
+ fi
|
|
|
+fi
|
|
|
+exit 0
|
|
|
+
|
|
|
%post
|
|
|
if [ -f /etc/dhcpd.conf -a ! -f /etc/dhcp/dhcpd.conf ]; then
|
|
|
/bin/cp -a /etc/dhcpd.conf /etc/dhcp/dhcpd.conf >/dev/null 2>&1
|
|
|
/bin/rm -f /etc/dhcpd.conf >/dev/null 2>&1
|
|
|
fi
|
|
|
-
|
|
|
+
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_post dhcpd.service dhcpd6.service dhcrelay.service
|
|
|
+%else
|
|
|
/sbin/chkconfig --add dhcpd
|
|
|
/sbin/chkconfig --add dhcpd6
|
|
|
/sbin/chkconfig --add dhcrelay || :
|
|
|
+%endif
|
|
|
|
|
|
%post -n dhclient
|
|
|
/bin/ls -1 /etc/dhclient* >/dev/null 2>&1
|
|
@@ -350,6 +398,9 @@ if [ $? = 0 ]; then
|
|
|
fi || :
|
|
|
|
|
|
%preun
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_preun dhcpd.service dhcpd6.service dhcrelay.service
|
|
|
+%else
|
|
|
if [ $1 = 0 -o -x /bin/systemctl ]; then
|
|
|
/sbin/service dhcpd status >/dev/null 2>&1
|
|
|
if [ $? = 3 ]; then
|
|
@@ -370,13 +421,19 @@ if [ $1 = 0 -o -x /bin/systemctl ]; then
|
|
|
/sbin/chkconfig --del dhcpd6
|
|
|
/sbin/chkconfig --del dhcrelay || :
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
%postun
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_postun_with_restart dhcpd.service dhcpd6.service dhcrelay.service
|
|
|
+%else
|
|
|
if [ $1 -ge 1 ]; then
|
|
|
/sbin/service dhcpd condrestart >/dev/null 2>&1
|
|
|
/sbin/service dhcpd6 condrestart >/dev/null 2>&1
|
|
|
/sbin/service dhcrelay condrestart >/dev/null 2>&1 || :
|
|
|
fi
|
|
|
+%endif
|
|
|
+
|
|
|
|
|
|
%files
|
|
|
%defattr(-,root,root,-)
|
|
@@ -392,9 +449,14 @@ fi
|
|
|
%config(noreplace) %{_sysconfdir}/dhcp/dhcpd.conf
|
|
|
%config(noreplace) %{_sysconfdir}/dhcp/dhcpd6.conf
|
|
|
%config(noreplace) %{_sysconfdir}/openldap/schema/dhcp.schema
|
|
|
+%if %{with systemd}
|
|
|
+%{_unitdir}/*.service
|
|
|
+%else
|
|
|
%{_initrddir}/dhcpd
|
|
|
%{_initrddir}/dhcpd6
|
|
|
%{_initrddir}/dhcrelay
|
|
|
+%attr(0755,dhcpd,dhcpd) %dir %{_localstatedir}/run/dhcp
|
|
|
+%endif
|
|
|
%{_bindir}/omshell
|
|
|
%{_sbindir}/dhcpd
|
|
|
%{_sbindir}/dhcrelay
|
|
@@ -432,7 +494,12 @@ fi
|
|
|
%attr(0644,root,root) %{_mandir}/man3/dhcpctl.3.gz
|
|
|
%attr(0644,root,root) %{_mandir}/man3/omapi.3.gz
|
|
|
|
|
|
+
|
|
|
%changelog
|
|
|
+* Thu Jun 10 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.1.ESV.R16.P1-1
|
|
|
+- new upstream release.
|
|
|
+- added systemd support (disabled as default).
|
|
|
+
|
|
|
* Mon Apr 13 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.1.ESV.R16-1
|
|
|
- new upstream release.
|
|
|
|