diff --git a/0006-Various-man-page-only-fixes.patch b/0006-Various-man-page-only-fixes.patch deleted file mode 100644 index 9d012deebc3b7f6611ba12e6b140cdce3e03f15b..0000000000000000000000000000000000000000 --- a/0006-Various-man-page-only-fixes.patch +++ /dev/null @@ -1,167 +0,0 @@ -From d359a7dc30e0423f9b90129291538cad1ee6a6d9 Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -Date: Thu, 21 Feb 2019 10:25:53 +0100 -Subject: [PATCH 06/28] Various man-page-only fixes - ---- - client/dhclient-script.8 | 22 +++++++++++++++++++++- - client/dhclient.conf.5 | 14 +++++++++++++- - common/dhcp-options.5 | 15 +++++++++++++++ - server/dhcpd.conf.5 | 14 +++++++++----- - 4 files changed, 58 insertions(+), 7 deletions(-) - -diff --git a/client/dhclient-script.8 b/client/dhclient-script.8 -index 5e5bd3d..37ecdc5 100644 ---- a/client/dhclient-script.8 -+++ b/client/dhclient-script.8 -@@ -43,7 +43,7 @@ customizations are needed, they should be possible using the enter and - exit hooks provided (see HOOKS for details). These hooks will allow the - user to override the default behaviour of the client in creating a - .B /etc/resolv.conf --file. -+file, and to handle DHCP options not handled by default. - .PP - No standard client script exists for some operating systems, even though - the actual client may work, so a pioneering user may well need to create -@@ -87,6 +87,26 @@ present. The - .B ETCDIR/dhclient-exit-hooks - script can modify the valid of exit_status to change the exit status - of dhclient-script. -+.PP -+Immediately after dhclient brings an interface UP with a new IP address, -+subnet mask, and routes, in the REBOOT/BOUND states, it will check for the -+existence of an executable -+.B ETCDIR/dhclient-up-hooks -+script, and source it if found. This script can handle DHCP options in -+the environment that are not handled by default. A per-interface. -+.B ETCDIR/dhclient-${IF}-up-hooks -+script will override the generic script and be sourced when interface -+$IF has been brought up. -+.PP -+Immediately before dhclient brings an interface DOWN, removing its IP -+address, subnet mask, and routes, in the STOP/RELEASE states, it will -+check for the existence of an executable -+.B ETCDIR/dhclient-down-hooks -+script, and source it if found. This script can handle DHCP options in -+the environment that are not handled by default. A per-interface -+.B ETCDIR/dhclient-${IF}-down-hooks -+script will override the generic script and be sourced when interface -+$IF is about to be brought down. - .SH OPERATION - When dhclient needs to invoke the client configuration script, it - defines a set of variables in the environment, and then invokes -diff --git a/client/dhclient.conf.5 b/client/dhclient.conf.5 -index dbe6f7e..8bac980 100644 ---- a/client/dhclient.conf.5 -+++ b/client/dhclient.conf.5 -@@ -228,7 +228,8 @@ responding to the client send the client its values for the specified - options. Only the option names should be specified in the request - statement - not option parameters. By default, the DHCPv4 client - requests the subnet-mask, broadcast-address, time-offset, routers, --domain-name, domain-name-servers and host-name options while the DHCPv6 -+domain-search, domain-name, domain-name-servers, host-name, nis-domain, -+nis-servers, ntp-servers and interface-mtu options while the DHCPv6 - client requests the dhcp6 name-servers and domain-search options. Note - that if you enter a \'request\' statement, you over-ride these defaults - and these options will not be requested. -@@ -735,6 +736,17 @@ broadcast packets transmitted by DHCP clients, but is only useful if you - know the DHCP service(s) anycast MAC address prior to configuring your - client. The \fIlink-type\fR and \fImac-address\fR parameters are configured - in a similar manner to the \fBhardware\fR statement. -+.PP -+ \fBbootp-broadcast-always;\fR -+.PP -+The -+.B bootp-broadcast-always -+statement instructs dhclient to always set the bootp broadcast flag in -+request packets, so that servers will always broadcast replies. -+This is equivalent to supplying the dhclient -B argument, and has -+the same effect as specifying 'always-broadcast' in the server's dhcpd.conf. -+This option is provided as an extension to enable dhclient to work -+on IBM s390 Linux guests. - .PP - .SH SAMPLE - The following configuration file was used on a laptop running NetBSD -diff --git a/common/dhcp-options.5 b/common/dhcp-options.5 -index 51f80f7..a784b32 100644 ---- a/common/dhcp-options.5 -+++ b/common/dhcp-options.5 -@@ -1075,6 +1075,21 @@ classless IP routing - it does not include a subnet mask. Since - classless IP routing is now the most widely deployed routing standard, - this option is virtually useless, and is not implemented by any of the - popular DHCP clients, for example the Microsoft DHCP client. -+.PP -+NOTE to Fedora dhclient users: -+.br -+dhclient-script interprets trailing 0 octets of the target as indicating -+the subnet class of the route, so for the following static-routes value: -+.br -+ option static-routes 172.0.0.0 172.16.2.254, -+.br -+ 192.168.0.0 192.168.2.254; -+.br -+dhclient-script will create routes: -+.br -+ 172/8 via 172.16.2.254 dev $interface -+.br -+ 192.168/16 via 192.168.2.254 dev $interface - .RE - .PP - .nf -diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5 -index 691e5dd..b7e79ea 100644 ---- a/server/dhcpd.conf.5 -+++ b/server/dhcpd.conf.5 -@@ -527,6 +527,9 @@ pool { - }; - .fi - .PP -+Dynamic BOOTP leases are not compatible with failover, and, as such, -+you need to disallow BOOTP in pools that you are using failover for. -+.PP - The server currently does very little sanity checking, so if you - configure it wrong, it will just fail in odd ways. I would recommend - therefore that you either do failover or don't do failover, but don't -@@ -541,9 +544,9 @@ primary server might look like this: - failover peer "foo" { - primary; - address anthrax.rc.example.com; -- port 519; -+ port 647; - peer address trantor.rc.example.com; -- peer port 520; -+ peer port 847; - max-response-delay 60; - max-unacked-updates 10; - mclt 3600; -@@ -1323,7 +1326,7 @@ the zone containing PTR records - for ISC BIND, something like this: - .PP - .nf - key DHCP_UPDATER { -- algorithm HMAC-MD5.SIG-ALG.REG.INT; -+ algorithm hmac-md5; - secret pRP5FapFoJ95JEL06sv4PQ==; - }; - -@@ -1346,7 +1349,7 @@ dhcpd.conf file: - .PP - .nf - key DHCP_UPDATER { -- algorithm HMAC-MD5.SIG-ALG.REG.INT; -+ algorithm hmac-md5; - secret pRP5FapFoJ95JEL06sv4PQ==; - }; - -@@ -2918,7 +2921,8 @@ statement - The \fInext-server\fR statement is used to specify the host address of - the server from which the initial boot file (specified in the - \fIfilename\fR statement) is to be loaded. \fIServer-name\fR should --be a numeric IP address or a domain name. -+be a numeric IP address or a domain name. If no \fInext-server\fR statement -+applies to a given client, the address 0.0.0.0 is used. - .RE - .PP - The --- -2.35.1 - diff --git a/dhcp-4.4.3-P1.tar.gz.asc b/dhcp-4.4.3-P1.tar.gz.asc deleted file mode 100644 index 4e369ecdc31dd333214170bd8ee8619c2580193b..0000000000000000000000000000000000000000 --- a/dhcp-4.4.3-P1.tar.gz.asc +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Comment: GPGTools - https://gpgtools.org - -iQIzBAABAgAdFiEEqtu6UHTxQC97adVrxbTukxqfnf0FAmM0jbcACgkQxbTukxqf -nf1YFxAAs4mi2w0JOpfcwFYkjtFSSnm0xKqfPYooTZeLBgUTfc7gqa4YilMGPdq8 -4tpVhXk0c6DDzCfTwnC0Z0Y2xL4ZNtUZg5My4sI1CZP8YMvgD9BtfFuyzFT9VGxb -+7vHluQjoHTkjPmvQqywxXOgvkdlh7TVzk5MXcHVU92/+N0sGtHmy/2R0rO7zxm8 -PhJ11TpEDD4GfYGsrgRJQ/o4buDp9nBQBI5ex6QfZ2BTX2zBU5rugKqHwT146sC/ -MbgNnVMR3CTRiUYW6G+EfnnFdpQ52eBtBFj6v3pnvMu8hPy8J/nj0JSXfSSx88qi -ym+PB2CVIupzUFEkZBxK/jLX3101AZwnzwMpmOMa2eSYHbB1qAohV6TYtP14ia0f -39K/yO9aH+/x16NFdMkqSmDXD79JFFqk3HWuhooX6Kqbyuy67Dj3uT6ZQRTF+PVR -D+BAE4LzMtQlG4UdRJlEclYcRv6CWwYB1hx5utz0BevL2y0ZenWgpQxHsW8jNzrF -fl8SmGbkTDtumH102U5NdapEQH2va9fMT1kywgtlrv0ByngEjg7Q1iSVJfu2mwJ5 -7lN4O8/+B5+tJYtckBvSHaOSuB5VLlSYzy5OlShzxRroczbqBanWnVVlRZDbSs4R -fHQ3f1QaPhXaW0LHHHId26hig2RC2VGASlo/aWDUOZL5OgMWZIM= -=rSfj ------END PGP SIGNATURE----- diff --git a/dhcp-4.4.3.tar.gz b/dhcp-4.4.3.tar.gz deleted file mode 100644 index e4d59147133ff1acfc16322a7143f4bf3a7a7636..0000000000000000000000000000000000000000 Binary files a/dhcp-4.4.3.tar.gz and /dev/null differ diff --git a/dhcp.spec b/dhcp.spec index c9bf4ab609214390bb842cf4ded86573f04efc74..0ca70d5a08a791024ba22dfa55ba88373b52c3be 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -1,42 +1,29 @@ -%define anolis_release 4 -# disable systemtap -%{!?sdt:%global sdt 0} - +%define anolis_release 5 %global _hardened_build 1 -%global dhcpconfdir %{_sysconfdir}/dhcp -%global subrelease P1 -%global DHCPVERSION %{version}-%{subrelease} +%bcond_with sdt -Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.4.3 -Release: %{anolis_release}.%{subrelease}%{?dist} - -# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to -# dcantrell maintaining the package) made incorrect use of the epoch and -# that's why it is at 12 now. It should have never been used, but it was. -# So we are stuck with it. +Release: %{anolis_release}.P1%{?dist} +Summary: Dynamic host configuration protocol software Epoch: 12 License: ISC and MPLv2.0 Url: https://www.isc.org/dhcp/ -Source0: https://downloads.isc.org/isc/dhcp/%{DHCPVERSION}/dhcp-%{DHCPVERSION}.tar.gz -Source9: https://downloads.isc.org/isc/dhcp/%{DHCPVERSION}/dhcp-%{DHCPVERSION}.tar.gz.asc -Source10: codesign2021.txt +Source0: https://downloads.isc.org/isc/dhcp/%{version}-P1/%{name}-%{version}-P1.tar.gz Source1: dhclient-script Source2: README.dhclient.d Source3: 11-dhclient -Source5: 56dhclient -Source6: dhcpd.service -Source7: dhcpd6.service -Source8: dhcrelay.service -Source11: dhcp.sysusers +Source4: 56dhclient +Source5: dhcpd.service +Source6: dhcpd6.service +Source7: dhcrelay.service +Source8: dhcp.sysusers Patch1 : 0001-change-bug-url.patch Patch2 : 0002-additional-dhclient-options.patch Patch3 : 0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch Patch4 : 0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch Patch5 : 0005-Change-default-requested-options.patch -Patch6 : 0006-Various-man-page-only-fixes.patch Patch7 : 0007-Change-paths-to-conform-to-our-standards.patch Patch8 : 0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch Patch9 : 0009-Fix-garbage-in-format-string-error.patch @@ -61,84 +48,77 @@ Patch27 : 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch Patch28 : 0028-Use-system-getaddrinfo-for-dhcp.patch Patch29 : CVE-2021-25220.patch -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: make -BuildRequires: libtool -BuildRequires: openldap-devel -BuildRequires: krb5-devel -BuildRequires: libcap-ng-devel +BuildRequires: autoconf automake make +BuildRequires: openldap-devel krb5-devel libcap-ng-devel BuildRequires: systemd systemd-devel -BuildRequires: pkgconfig(libsystemd) -BuildRequires: gnupg2 -BuildRequires: doxygen -%if %{sdt} +BuildRequires: gnupg2 libtool doxygen + +%if %{with sdt} BuildRequires: systemtap-sdt-devel %global tapsetdir /usr/share/systemtap/tapset %endif -# In _docdir we ship some perl scripts and module from contrib subdirectory. -# Because nothing under _docdir is allowed to "require" anything, -# prevent _docdir from being scanned. (#674058) -%filter_requires_in %{_docdir} -%{filter_setup} - %description -DHCP (Dynamic Host Configuration Protocol) +The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to +assign IP addresses and provide configuration information to devices such as +servers, desktops, or mobile devices, so they can communicate on a network using +the Internet Protocol (IP). ISC DHCP is a collection of software that implements +all aspects of the DHCP (Dynamic Host Configuration Protocol) suite. %package server Summary: Provides the ISC DHCP server -Requires: %{name}-common = %{epoch}:%{version}-%{release} -Obsoletes: %{name}-compat < 12:4.4.2-12.b1 +Requires: %{name}-common = %{EVR} Requires(post): coreutils grep sed + +Obsoletes: %{name}-compat < 12:4.4.2-12.b1 %{?sysusers_requires_compat} %{?systemd_requires} %description server -DHCP (Dynamic Host Configuration Protocol) is a protocol which allows -individual devices on an IP network to get their own network -configuration information (IP address, subnetmask, broadcast address, -etc.) from a DHCP server. The overall purpose of DHCP is to make it -easier to administer a large network. +The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to +assign IP addresses and provide configuration information to devices such as +servers, desktops, or mobile devices, so they can communicate on a network using +the Internet Protocol (IP). ISC DHCP is a collection of software that implements +all aspects of the DHCP (Dynamic Host Configuration Protocol) suite. -This package provides the ISC DHCP server. +A DHCP server receives clients' requests and replies to them. %package relay Summary: Provides the ISC DHCP relay agent -Requires: %{name}-common = %{epoch}:%{version}-%{release} +Requires: %{name}-common = %{EVR} Obsoletes: %{name}-compat < 12:4.4.2-12.b1 -Requires(post): grep sed -Requires(post): systemd +Requires(post): grep sed systemd Requires(preun): systemd Requires(postun): systemd %description relay -DHCP (Dynamic Host Configuration Protocol) is a protocol which allows -individual devices on an IP network to get their own network -configuration information (IP address, subnetmask, broadcast address, -etc.) from a DHCP server. The overall purpose of DHCP is to make it -easier to administer a large network. +The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to +assign IP addresses and provide configuration information to devices such as +servers, desktops, or mobile devices, so they can communicate on a network using +the Internet Protocol (IP). ISC DHCP is a collection of software that implements +all aspects of the DHCP (Dynamic Host Configuration Protocol) suite. -This package provides the ISC DHCP relay agent. +A DHCP relay agent passes DHCP requests from one LAN to another, so that a DHCP +server is not needed on every LAN. %package client Summary: Provides the ISC DHCP client daemon and dhclient-script -Provides: dhclient = %{epoch}:%{version}-%{release} -Obsoletes: dhclient < %{epoch}:%{version}-%{release} -# dhclient-script requires: +Provides: dhclient = %{EVR} +Obsoletes: dhclient < %{EVR} Requires: coreutils gawk grep ipcalc iproute iputils sed systemd -Requires: %{name}-common = %{epoch}:%{version}-%{release} -# Old NetworkManager expects the dispatcher scripts in a different place +Requires: %{name}-common = %{EVR} Conflicts: NetworkManager < 1.20 %description client -DHCP (Dynamic Host Configuration Protocol) is a protocol which allows -individual devices on an IP network to get their own network -configuration information (IP address, subnetmask, broadcast address, -etc.) from a DHCP server. The overall purpose of DHCP is to make it -easier to administer a large network. +The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to +assign IP addresses and provide configuration information to devices such as +servers, desktops, or mobile devices, so they can communicate on a network using +the Internet Protocol (IP). ISC DHCP is a collection of software that implements +all aspects of the DHCP (Dynamic Host Configuration Protocol) suite. -This package provides the ISC DHCP client. +A DHCP client can be bundled with the operating system of a client computer +or other IP capable device; it sends configuration requests to the server. +Most devices and operating systems already have DHCP clients included. %package common Summary: Common files used by ISC dhcp client, server and relay agent @@ -146,74 +126,50 @@ BuildArch: noarch Obsoletes: dhcp-libs < %{epoch}:%{version} %description common -DHCP (Dynamic Host Configuration Protocol) is a protocol which allows -individual devices on an IP network to get their own network -configuration information (IP address, subnetmask, broadcast address, -etc.) from a DHCP server. The overall purpose of DHCP is to make it -easier to administer a large network. - This package provides common files used by dhcp and dhclient package. %package libs-static Summary: Shared libraries used by ISC dhcp client and server -Provides: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} -Provides: %{name}-libs = %{epoch}:%{version}-%{release} -Provides: bundled(bind-export-libs) -Provides: bundled(bind) +Provides: %{name}-libs = %{EVR} +Provides: bundled(bind-export-libs) bundled(bind) +Obsoletes: %{name}-devel-doc < %{EVR} %description libs-static This package contains shared libraries used by ISC dhcp client and server %package devel Summary: Development headers and libraries for interfacing to the DHCP server -Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs = %{EVR} %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. -%package devel-doc -Summary: Developer's Guide for ISC DHCP -Requires: %{name}-libs = %{epoch}:%{version}-%{release} -BuildArch: noarch - -%description devel-doc -This documentation is intended for developers, contributors and other -programmers that are interested in internal operation of the code. -This package contains doxygen-generated documentation. - %prep -%{gpgverify} --keyring='%{SOURCE10}' --signature='%{SOURCE9}' --data='%{SOURCE0}' -%setup -n dhcp-%{DHCPVERSION} +%setup -n %{name}-%{version}-P1 pushd bind -tar -xvf bind.tar.gz -ln -s bind-9* bind +tar -xvf bind.tar.gz; ln -s bind-9* bind popd -%autopatch -p1 - -# Update paths in all man pages -for page in client/dhclient.conf.5 client/dhclient.leases.5 \ - client/dhclient-script.8 client/dhclient.8 ; do - sed -i -e 's|CLIENTBINDIR|%{_sbindir}|g' \ - -e 's|RUNDIR|%{_localstatedir}/run|g' \ - -e 's|DBDIR|%{_localstatedir}/lib/dhclient|g' \ - -e 's|ETCDIR|%{dhcpconfdir}|g' $page +%autopatch -p1 + +for page in client/dhclient.conf.5 client/dhclient.leases.5 client/dhclient-script.8 client/dhclient.8 ; do + sed -i 's|CLIENTBINDIR|%{_sbindir}|g' $page + sed -i 's|RUNDIR|%{_localstatedir}/run|g' $page + sed -i 's|DBDIR|%{_localstatedir}/lib/dhclient|g' $page + sed -i 's|ETCDIR|%{_sysconfdir}/%{name}|g' $page done for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do - sed -i -e 's|CLIENTBINDIR|%{_sbindir}|g' \ - -e 's|RUNDIR|%{_localstatedir}/run|g' \ - -e 's|DBDIR|%{_localstatedir}/lib/dhcpd|g' \ - -e 's|ETCDIR|%{dhcpconfdir}|g' $page + sed -i 's|CLIENTBINDIR|%{_sbindir}|g' $page + sed -i 's|RUNDIR|%{_localstatedir}/run|g' $page + sed -i 's|DBDIR|%{_localstatedir}/lib/dhcpd|g' $page + sed -i 's|ETCDIR|%{_sysconfdir}/%{name}|g' $page done -sed -i -e 's|/var/db/|%{_localstatedir}/lib/dhcpd/|g' contrib/dhcp-lease-list.pl - -## FIXME drop unused bind components +sed -i 's|/var/db/|%{_localstatedir}/lib/dhcpd/|g' contrib/dhcp-lease-list.pl %build -#libtoolize --copy --force -autoreconf --verbose --force --install +autoreconf -fiv CFLAGS="%{optflags} -fno-strict-aliasing -fcommon" \ %configure \ @@ -230,58 +186,34 @@ CFLAGS="%{optflags} -fno-strict-aliasing -fcommon" \ --with-ldapcrypto \ --with-ldap-gssapi \ --enable-log-pid \ -%if %{sdt} +%if %{with sdt} --enable-systemtap \ --with-tapset-install-dir=%{tapsetdir} \ %endif --enable-paranoia --enable-early-chroot \ --enable-binary-leases \ --with-systemd -make -j1 - -pushd doc -make %{?_smp_mflags} devel -popd +make %install -make DESTDIR=%{buildroot} install %{?_smp_mflags} - -# We don't want example conf files in /etc -rm -f %{buildroot}%{_sysconfdir}/dhclient.conf.example -rm -f %{buildroot}%{_sysconfdir}/dhcpd.conf.example - -# dhclient-script -install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_sbindir}/dhclient-script +%make_install -# README.dhclient.d -install -p -m 0644 %{SOURCE2} . - -# Empty directory for dhclient.d scripts -mkdir -p %{buildroot}%{dhcpconfdir}/dhclient.d - -# NetworkManager dispatcher script +rm -f %{buildroot}%{_sysconfdir}/{dhclient.conf.example,dhcpd.conf.example} +install -D -pm 0755 %{SOURCE1} %{buildroot}%{_sbindir}/dhclient-script +install -pm 0644 %{SOURCE2} . +mkdir -p %{buildroot}%{_sysconfdir}/%{name}/dhclient.d mkdir -p %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d -install -p -m 0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d - -# pm-utils script to handle suspend/resume and dhclient leases -install -D -p -m 0755 %{SOURCE5} %{buildroot}%{_libdir}/pm-utils/sleep.d/56dhclient +install -pm 0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d +install -D -pm 0755 %{SOURCE4} %{buildroot}%{_libdir}/pm-utils/sleep.d/56dhclient -# systemd unit files mkdir -p %{buildroot}%{_unitdir} -install -m 644 %{SOURCE6} %{buildroot}%{_unitdir} -install -m 644 %{SOURCE7} %{buildroot}%{_unitdir} -install -m 644 %{SOURCE8} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE5} %{SOURCE6} %{SOURCE7} %{buildroot}%{_unitdir} +install -D -pm 0644 %{SOURCE8} %{buildroot}%{_sysusersdir}/dhcp.conf -# systemd-sysusers -install -p -D -m 0644 %{SOURCE11} %{buildroot}%{_sysusersdir}/dhcp.conf - -# Start empty lease databases -mkdir -p %{buildroot}%{_localstatedir}/lib/dhcpd/ -touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd.leases -touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd6.leases mkdir -p %{buildroot}%{_localstatedir}/lib/dhclient/ +mkdir -p %{buildroot}%{_localstatedir}/lib/dhcpd/ +touch %{buildroot}%{_localstatedir}/lib/dhcpd/{dhcpd.leases,dhcpd6.leases} -# default sysconfig file for dhcpd mkdir -p %{buildroot}%{_sysconfdir}/sysconfig cat < %{buildroot}%{_sysconfdir}/sysconfig/dhcpd # WARNING: This file is NOT used anymore. @@ -324,9 +256,8 @@ echo "reason: ${reason}" ( set -o posix ; set ) | grep "requested_" EOF -# Install default (empty) dhcpd.conf: -mkdir -p %{buildroot}%{dhcpconfdir} -cat << EOF > %{buildroot}%{dhcpconfdir}/dhcpd.conf +mkdir -p %{buildroot}%{_sysconfdir}/%{name} +cat << EOF > %{buildroot}%{_sysconfdir}/%{name}/dhcpd.conf # # DHCP Server Configuration file. # see /usr/share/doc/dhcp-server/dhcpd.conf.example @@ -334,8 +265,7 @@ cat << EOF > %{buildroot}%{dhcpconfdir}/dhcpd.conf # EOF -# Install default (empty) dhcpd6.conf: -cat << EOF > %{buildroot}%{dhcpconfdir}/dhcpd6.conf +cat << EOF > %{buildroot}%{_sysconfdir}/%{name}/dhcpd6.conf # # DHCPv6 Server Configuration file. # see /usr/share/doc/dhcp-server/dhcpd6.conf.example @@ -343,10 +273,8 @@ cat << EOF > %{buildroot}%{dhcpconfdir}/dhcpd6.conf # EOF -# Install dhcp.schema for LDAP configuration -install -D -p -m 0644 contrib/ldap/dhcp.schema %{buildroot}%{_sysconfdir}/openldap/schema/dhcp.schema +install -D -pm 0644 contrib/ldap/dhcp.schema %{buildroot}%{_sysconfdir}/openldap/schema/dhcp.schema -# Don't package libtool *.la files find %{buildroot} -type f -name "*.la" -delete -print %generate_compatibility_deps @@ -355,10 +283,8 @@ find %{buildroot} -type f -name "*.la" -delete -print %sysusers_create_compat %{SOURCE11} %post server -# Initial installation %systemd_post dhcpd.service dhcpd6.service - for servicename in dhcpd dhcpd6; do etcservicefile=%{_sysconfdir}/systemd/system/${servicename}.service if [ -f ${etcservicefile} ]; then @@ -369,7 +295,6 @@ done exit 0 %post relay -# Initial installation %systemd_post dhcrelay.service for servicename in dhcrelay; do @@ -382,37 +307,28 @@ done exit 0 %preun server -# Package removal, not upgrade %systemd_preun dhcpd.service dhcpd6.service %preun relay -# Package removal, not upgrade %systemd_preun dhcrelay.service %postun server -# Package upgrade, not uninstall %systemd_postun_with_restart dhcpd.service dhcpd6.service %postun relay -# Package upgrade, not uninstall %systemd_postun_with_restart dhcrelay.service %triggerun -- dhcp -# convert DHC*ARGS from /etc/sysconfig/dhc* to /etc/systemd/system/dhc*.service for servicename in dhcpd dhcpd6 dhcrelay; do if [ -f %{_sysconfdir}/sysconfig/${servicename} ]; then - # get DHCPDARGS/DHCRELAYARGS value from /etc/sysconfig/${servicename} source %{_sysconfdir}/sysconfig/${servicename} if [ "${servicename}" == "dhcrelay" ]; then args=$DHCRELAYARGS else args=$DHCPDARGS fi - # value is non-empty (i.e. user modified) and there isn't a service unit yet if [ -n "${args}" -a ! -f %{_sysconfdir}/systemd/system/${servicename}.service ]; then - # in $args replace / with \/ otherwise the next sed won't take it args=$(echo $args | sed 's/\//\\\//'g) - # add $args to the end of ExecStart line sed -r -e "/ExecStart=/ s/$/ ${args}/" \ < %{_unitdir}/${servicename}.service \ > %{_sysconfdir}/systemd/system/${servicename}.service @@ -421,78 +337,84 @@ for servicename in dhcpd dhcpd6 dhcrelay; do done %files server -%dir %{abidir} -%doc server/dhcpd.conf.example server/dhcpd6.conf.example -%doc contrib/ldap/ contrib/dhcp-lease-list.pl -%attr(0750,root,root) %dir %{dhcpconfdir} -%attr(0755,dhcpd,dhcpd) %dir %{_localstatedir}/lib/dhcpd -%attr(0644,dhcpd,dhcpd) %verify(mode) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd.leases -%attr(0644,dhcpd,dhcpd) %verify(mode) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd6.leases +%attr(0750,root,root) %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd -%config(noreplace) %{dhcpconfdir}/dhcpd.conf -%config(noreplace) %{dhcpconfdir}/dhcpd6.conf +%config(noreplace) %{_sysconfdir}/%{name}/dhcpd.conf +%config(noreplace) %{_sysconfdir}/%{name}/dhcpd6.conf %dir %{_sysconfdir}/openldap/schema %config(noreplace) %{_sysconfdir}/openldap/schema/dhcp.schema +%attr(0755,dhcpd,dhcpd) %dir %{_localstatedir}/lib/dhcpd +%attr(0644,dhcpd,dhcpd) %verify(mode) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd.leases +%attr(0644,dhcpd,dhcpd) %verify(mode) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd6.leases %attr(0644,root,root) %{_unitdir}/dhcpd.service %attr(0644,root,root) %{_unitdir}/dhcpd6.service %{_sysusersdir}/dhcp.conf + +%{_bindir}/omshell %{_sbindir}/dhcpd + +%dir %{abidir} %{abidir}/dhcpd-option.list -%{_bindir}/omshell %attr(0644,root,root) %{_mandir}/man1/omshell.1.* %attr(0644,root,root) %{_mandir}/man5/dhcpd.conf.5.* %attr(0644,root,root) %{_mandir}/man5/dhcpd.leases.5.* %attr(0644,root,root) %{_mandir}/man8/dhcpd.8.* -%if %{sdt} +%if %{with sdt} %{tapsetdir}/*.stp %endif +%doc server/* +%doc contrib/ldap/ contrib/dhcp-lease-list.pl + %files relay %{_sbindir}/dhcrelay -%{abidir}/dhcrelay-option.list %attr(0644,root,root) %{_unitdir}/dhcrelay.service +%{abidir}/dhcrelay-option.list %attr(0644,root,root) %{_mandir}/man8/dhcrelay.8.* %files client -%doc README.dhclient.d -%doc client/dhclient.conf.example client/dhclient6.conf.example client/dhclient-enter-hooks -%attr(0750,root,root) %dir %{dhcpconfdir} -%dir %{dhcpconfdir}/dhclient.d -%dir %{_localstatedir}/lib/dhclient +%attr(0750,root,root) %dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/dhclient.d %dir %{_prefix}/lib/NetworkManager %dir %{_prefix}/lib/NetworkManager/dispatcher.d %{_prefix}/lib/NetworkManager/dispatcher.d/11-dhclient +%dir %{_localstatedir}/lib/dhclient + %{_sbindir}/dhclient -%{abidir}/dhclient-option.list %{_sbindir}/dhclient-script %attr(0755,root,root) %{_libdir}/pm-utils/sleep.d/56dhclient + +%{abidir}/dhclient-option.list %attr(0644,root,root) %{_mandir}/man5/dhclient.conf.5.* %attr(0644,root,root) %{_mandir}/man5/dhclient.leases.5.* %attr(0644,root,root) %{_mandir}/man8/dhclient.8.* %attr(0644,root,root) %{_mandir}/man8/dhclient-script.8.* +%doc README.dhclient.d +%doc client/* + %files common -%{!?_licensedir:%global license %%doc} -%{license} LICENSE -%doc README RELNOTES doc/References.txt %attr(0644,root,root) %{_mandir}/man5/dhcp-options.5.* %attr(0644,root,root) %{_mandir}/man5/dhcp-eval.5.* +%license LICENSE +%doc README RELNOTES doc/References.txt %files libs-static -%{_libdir}/libdhcp*.a +%{_libdir}/libdhcp.a +%{_libdir}/libdhcpctl.a %{_libdir}/libomapi.a %files devel -%doc doc/IANA-arp-parameters doc/api+protocol %{_includedir}/dhcpctl %{_includedir}/omapip %attr(0644,root,root) %{_mandir}/man3/dhcpctl.3.* %attr(0644,root,root) %{_mandir}/man3/omapi.3.* - -%files devel-doc -%doc doc/html/ +%doc doc/IANA-arp-parameters doc/api+protocol %changelog +* Thu Apr 13 2023 Yuanhong Peng - 12:4.4.3-P1-5 +- Refactor the specfile and remove devel-doc sub-package + * Mon Mar 27 2023 mgb01105731 - 12:4.4.3-P1-4 - Del Specific Fields