SHA256
1
0
forked from pool/dhcp

Accepting request 614191 from home:scarabeus_iv:branches:network:dhcp

- Drop doc subpackage as we do not build on < SLE12 anyway so it
  evaluated always as true
- Do not condition flags settings for codestreams that we are no
  longer building for
- Use %license macro for license as mandated by new TW requirements

- Format with spec-cleaner (automatic, remove FIXMEs)
- Use getent to detect created user prior doing it again
- Drop ldapcasa as it evaluates as false on all current products
- Drop ldap conditional as it is always true

- Kill omc configs wrt fate#301838

OBS-URL: https://build.opensuse.org/request/show/614191
OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=188
This commit is contained in:
Ismail Dönmez 2018-06-26 09:02:03 +00:00 committed by Git OBS Bridge
parent e9398b14d9
commit e6da93e899
4 changed files with 148 additions and 393 deletions

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Tue Jun 5 08:57:34 UTC 2018 - tchvatal@suse.com
- Drop doc subpackage as we do not build on < SLE12 anyway so it
evaluated always as true
- Do not condition flags settings for codestreams that we are no
longer building for
- Use %license macro for license as mandated by new TW requirements
-------------------------------------------------------------------
Mon Jun 4 19:53:43 UTC 2018 - tchvatal@suse.com
- Format with spec-cleaner (automatic, remove FIXMEs)
- Use getent to detect created user prior doing it again
- Drop ldapcasa as it evaluates as false on all current products
- Drop ldap conditional as it is always true
-------------------------------------------------------------------
Mon Jun 4 19:46:20 UTC 2018 - tchvatal@suse.com
- Kill omc configs wrt fate#301838
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 8 13:15:16 UTC 2018 - max@suse.com Thu Mar 8 13:15:16 UTC 2018 - max@suse.com

343
dhcp.spec
View File

@ -16,37 +16,19 @@
# #
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%define isc_version 4.3.6-P1 %define isc_version 4.3.6-P1
%define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services %define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
%define omc_prefix /usr/share/omc #Compat macro for new _fillupdir macro introduced in Nov 2017
%define omc_svcdir %{omc_prefix}/svcinfo.d %if ! %{defined _fillupdir}
# always on %define _fillupdir %{_localstatedir}/adm/fillup-templates
%define with_ldap 1 %endif
# on sles, but sles_version is gone
%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
Name: dhcp Name: dhcp
%if %{with_ldap}
%if %{with_ldapcasa}
BuildRequires: CASA-devel
%endif
BuildRequires: openldap2-devel
%endif
BuildRequires: dos2unix
BuildRequires: libtool
Version: 4.3.5 Version: 4.3.5
Release: 0 Release: 0
Summary: Common Files Used by ISC DHCP Software Summary: Common Files Used by ISC DHCP Software
License: BSD-3-Clause License: BSD-3-Clause
Group: Productivity/Networking/Boot/Servers Group: Productivity/Networking/Boot/Servers
Url: http://www.isc.org/software/dhcp URL: http://www.isc.org/software/dhcp
Source0: dhcp-%{isc_version}.tar.gz Source0: dhcp-%{isc_version}.tar.gz
Source1: dhcp-%{isc_version}.tar.gz.asc Source1: dhcp-%{isc_version}.tar.gz.asc
Source2: %{name}.keyring Source2: %{name}.keyring
@ -68,8 +50,6 @@ Source23: dhcpd6.conf
Source26: sysconfig.syslog-dhcpd Source26: sysconfig.syslog-dhcpd
Source27: dhclient-script Source27: dhclient-script
# #
Source30: dhcpd.xml
Source31: dhcpd6.xml
Source32: SuSEfirewall2.dhcp-server Source32: SuSEfirewall2.dhcp-server
Source33: SuSEfirewall2.dhcp6-server Source33: SuSEfirewall2.dhcp6-server
# #
@ -110,72 +90,65 @@ Patch17: 0017-server-no-success-report-before-send.919959.patch
Patch18: 0018-client-fail-on-script-pre-init-error-bsc-912098.patch Patch18: 0018-client-fail-on-script-pre-init-error-bsc-912098.patch
# PATCH-FIX-SLE dhcp-4.2.4-P1-interval bsc#947780 # PATCH-FIX-SLE dhcp-4.2.4-P1-interval bsc#947780
Patch20: 0020-dhcp-4.x.x-fixed-improper-lease-duration-checking.patch Patch20: 0020-dhcp-4.x.x-fixed-improper-lease-duration-checking.patch
##
PreReq: /bin/touch /sbin/chkconfig sysconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: automake BuildRequires: automake
BuildRequires: dos2unix
BuildRequires: libtool
BuildRequires: openldap2-devel
%package server %package server
Summary: ISC DHCP Server Summary: ISC DHCP Server
Group: Productivity/Networking/Boot/Servers Group: Productivity/Networking/Boot/Servers
Requires: dhcp = %{version} Requires: dhcp = %{version}
Requires: net-tools Requires: net-tools
PreReq: %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd Requires(post): %fillup_prereq
Requires(pre): shadow
%systemd_requires
%if 0%{?suse_version} >= 1330
Requires(pre): group(nogroup)
%endif
%package client %package client
Summary: ISC DHCP Client Summary: ISC DHCP Client
Group: Productivity/Networking/Boot/Clients Group: Productivity/Networking/Boot/Clients
Requires: /usr/bin/host Requires: %{_bindir}/host
Requires: /usr/bin/touch Requires: %{_bindir}/touch
Requires: dhcp = %{version} Requires: dhcp = %{version}
Requires: iproute2
Requires: iputils
%if 0%{?suse_version} >= 1330 %if 0%{?suse_version} >= 1330
Requires: hostname Requires: hostname
%else %else
Requires: net-tools Requires: net-tools
%endif %endif
Requires: iproute2
Requires: iputils
%package relay %package relay
Summary: ISC DHCP Relay Agent Summary: ISC DHCP Relay Agent
Group: Productivity/Networking/Boot/Servers Group: Productivity/Networking/Boot/Servers
Requires: dhcp = %{version} Requires: dhcp = %{version}
Requires: net-tools Requires: net-tools
PreReq: %fillup_prereq /bin/cat /bin/mkdir /bin/cp Requires(post): %fillup_prereq
%systemd_requires
%package devel %package devel
Summary: Header Files and Libraries for dhcpctl API Summary: Header Files and Libraries for dhcpctl API
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: dhcp = %{version} Requires: dhcp = %{version}
%if %{with_doc_package}
%package doc %package doc
Summary: Documentation Summary: Documentation
Group: Productivity/Networking/Boot/Servers Group: Productivity/Networking/Boot/Servers
%endif
%description %description
This package contains common programs used by both the ISC DHCP This package contains common programs used by both the ISC DHCP
server ("dhcp-server" package) and client ("dhcp-client") as the server ("dhcp-server" package) and client ("dhcp-client") as the
omshell and common manual pages. omshell and common manual pages.
Authors:
--------
Internet Systems Consortium, Inc. <info@isc.org>
%description server %description server
This package contains the ISC DHCP server. This package contains the ISC DHCP server.
Please read the documentation in /usr/share/doc/packages/dhcp-server Please read the documentation in %{_docdir}/dhcp-server
regarding configuration of the DHCP server. regarding configuration of the DHCP server.
Authors:
--------
Internet Systems Consortium, Inc. <info@isc.org>
%description client %description client
This is an alternative DHCP client, the ISC DHCP client for Linux. Like This is an alternative DHCP client, the ISC DHCP client for Linux. Like
"dhcpcd" (the client that is installed by default), it can be used to "dhcpcd" (the client that is installed by default), it can be used to
@ -183,46 +156,24 @@ configure the network setup. IP address, hostname, routing,
nameserver, netmask, and broadcast can be dynamically assigned while nameserver, netmask, and broadcast can be dynamically assigned while
booting the machine. booting the machine.
It is configurable via the configuration file /etc/dhclient.conf and It is configurable via the configuration file %{_sysconfdir}/dhclient.conf and
you can define your own 'hooks' to be used by the /sbin/dhclient-script you can define your own 'hooks' to be used by the /sbin/dhclient-script
(which is called by the daemon). (which is called by the daemon).
Authors:
--------
Internet Systems Consortium, Inc. <info@isc.org>
%description relay %description relay
This is the ISC DHCP relay agent. It can be used as a 'gateway' for This is the ISC DHCP relay agent. It can be used as a 'gateway' for
DHCP messages across physical network segments. This is necessary DHCP messages across physical network segments. This is necessary
because requests can be broadcast, and they will normally not be because requests can be broadcast, and they will normally not be
routed. routed.
Authors:
--------
Internet Systems Consortium, Inc. <info@isc.org>
%if %{with_doc_package}
%description doc %description doc
This package contains additional documentation files provided with This package contains additional documentation files provided with
the software. The manual pages are in the corresponding packages. the software. The manual pages are in the corresponding packages.
Authors:
--------
Internet Systems Consortium, Inc. <info@isc.org>
%endif
%description devel %description devel
This package contains all of the libraries and headers for developing This package contains all of the libraries and headers for developing
with the Internet Software Consortium (ISC) dhcpctl API. with the Internet Software Consortium (ISC) dhcpctl API.
Authors:
--------
Internet Systems Consortium, Inc. <info@isc.org>
%prep %prep
%setup -q -n %{name}-%{isc_version} -a 44 -a 45 %setup -q -n %{name}-%{isc_version} -a 44 -a 45
## ##
@ -253,7 +204,7 @@ pushd bind
gunzip -c bind.tar.gz | tar xf - gunzip -c bind.tar.gz | tar xf -
rm -rf bind-*/contrib/dbus rm -rf bind-*/contrib/dbus
bind_dir=$(ls -1d bind-*) bind_dir=$(ls -1d bind-*)
for i in /usr/share/automake-*/config.{sub,guess} ; do for i in %{_datadir}/automake-*/config.{sub,guess} ; do
install -v -m755 $i $bind_dir/ install -v -m755 $i $bind_dir/
done done
# use the year from source gzip header instead of current one to make reproducible rpms # use the year from source gzip header instead of current one to make reproducible rpms
@ -263,31 +214,21 @@ popd
## ##
%build %build
%if %suse_version >= 1210 CFLAGS="%{optflags} -D_GNU_SOURCE -W -Wall -Wno-unused"
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -W -Wall -Wno-unused"
%else
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -W -Wall -fno-strict-aliasing -Wno-unused"
%endif
%ifarch ppc ppc64 s390x %ifarch ppc ppc64 s390x
# bugs 134590, 171532 # bugs 134590, 171532
CFLAGS="$CFLAGS -fsigned-char" CFLAGS="$CFLAGS -fsigned-char"
%endif %endif
%ifarch ia64 %sparc alpha s390x ppc64 x86_64 %ifarch ia64 %{sparc} alpha s390x ppc64 x86_64
CFLAGS="$CFLAGS -fPIE" CFLAGS="$CFLAGS -fPIE"
%else %else
CFLAGS="$CFLAGS -fpie" CFLAGS="$CFLAGS -fpie"
%endif %endif
%if %suse_version >= 1210
LDFLAGS="-Wl,-z,relro,-z,now -pie" LDFLAGS="-Wl,-z,relro,-z,now -pie"
%else
LDFLAGS="-pie"
%endif
FFLAGS="$CFLAGS" FFLAGS="$CFLAGS"
CXXFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS"
export RPM_OPT_FLAGS LDFLAGS export CFLAGS LDFLAGS FFLAGS CXXFLAGS
export CFLAGS FFLAGS CXXFLAGS
# #
%{?suse_update_config:%{suse_update_config -f}}
#libtoolize --force #libtoolize --force
#autoreconf -f -i #autoreconf -f -i
# #
@ -296,13 +237,8 @@ export CFLAGS FFLAGS CXXFLAGS
--enable-failover \ --enable-failover \
--enable-paranoia \ --enable-paranoia \
--enable-early-chroot \ --enable-early-chroot \
%if %{with_ldap}
--with-ldap \ --with-ldap \
--with-ldapcrypto \ --with-ldapcrypto \
%if %{with_ldapcasa}
--with-ldapcasa \
%endif
%endif
--with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \ --with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \
--with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \ --with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
--with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \ --with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \
@ -313,7 +249,7 @@ export CFLAGS FFLAGS CXXFLAGS
--with-srv6-lease-file=%{_localstatedir}/lib/dhcp6/db/dhcpd6.leases --with-srv6-lease-file=%{_localstatedir}/lib/dhcp6/db/dhcpd6.leases
# #
: building bind sources : building bind sources
make -C bind all make -j1 -C bind all
cat bind/configure.log cat bind/configure.log
cat bind/build.log cat bind/build.log
cat bind/install.log cat bind/install.log
@ -330,65 +266,60 @@ bash -n $RPM_SOURCE_DIR/dhcrelay.script
bash -n $RPM_SOURCE_DIR/dhclient-script bash -n $RPM_SOURCE_DIR/dhclient-script
%install %install
export RPM_BUILD_ROOT %make_install
make install DESTDIR="$RPM_BUILD_ROOT"
# #
# directories # directories
install -d -m0755 $RPM_BUILD_ROOT/sbin install -d -m0755 %{buildroot}/sbin
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd{,6}.d install -d -m0755 %{buildroot}%{_sysconfdir}/dhcpd{,6}.d
install -d -m0755 $RPM_BUILD_ROOT/%{susefw2dir} install -d -m0755 %{buildroot}/%{susefw2dir}
install -d -m0755 $RPM_BUILD_ROOT/%{omc_svcdir} install -d -m0755 %{buildroot}%{_sysconfdir}/openldap/schema
%if %{with_ldap} install -d -m0755 %{buildroot}%{_localstatedir}/run
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema install -d -m0755 %{buildroot}%{_fillupdir}
%endif
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/run
install -d -m0755 $RPM_BUILD_ROOT%{_fillupdir}
# chroot jail # chroot jail
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/etc install -d -m0755 %{buildroot}%{_localstatedir}/lib/{dhcp,dhcp6}%{_sysconfdir}
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/dev install -d -m0755 %{buildroot}%{_localstatedir}/lib/{dhcp,dhcp6}/dev
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/%_lib install -d -m0755 %{buildroot}%{_localstatedir}/lib/{dhcp,dhcp6}/%{_lib}
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/var/run install -d -m0755 %{buildroot}%{_localstatedir}/lib/{dhcp,dhcp6}%{_localstatedir}/run
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/db install -d -m0755 %{buildroot}%{_localstatedir}/lib/{dhcp,dhcp6}/db
# move the dhclient binary to /sbin # move the dhclient binary to /sbin
mv -f $RPM_BUILD_ROOT/usr/sbin/dhclient $RPM_BUILD_ROOT/sbin/ mv -f %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/
# provide a ...6 link, so we know it supports DHCPv6 # provide a ...6 link, so we know it supports DHCPv6
ln -sf dhcpd $RPM_BUILD_ROOT%{_sbindir}/dhcpd6 ln -sf dhcpd %{buildroot}%{_sbindir}/dhcpd6
ln -sf dhcrelay $RPM_BUILD_ROOT%{_sbindir}/dhcrelay6 ln -sf dhcrelay %{buildroot}%{_sbindir}/dhcrelay6
ln -sf dhclient $RPM_BUILD_ROOT/sbin/dhclient6 ln -sf dhclient %{buildroot}/sbin/dhclient6
# install our adopted config examples and dhclient-script: # install our adopted config examples and dhclient-script:
install -m0644 $RPM_SOURCE_DIR/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhcpd.conf %{buildroot}%{_sysconfdir}/
install -m0644 $RPM_SOURCE_DIR/dhcpd6.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhcpd6.conf %{buildroot}%{_sysconfdir}/
install -m0644 $RPM_SOURCE_DIR/dhclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhclient.conf %{buildroot}%{_sysconfdir}/
install -m0644 $RPM_SOURCE_DIR/dhclient6.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhclient6.conf %{buildroot}%{_sysconfdir}/
install -m0754 $RPM_SOURCE_DIR/dhclient-script $RPM_BUILD_ROOT/sbin/ install -m0754 $RPM_SOURCE_DIR/dhclient-script %{buildroot}/sbin/
# helper / wrapper scripts # helper / wrapper scripts
install -d -m0755 $RPM_BUILD_ROOT/usr/lib/dhcp install -d -m0755 %{buildroot}%{_libexecdir}/dhcp
install -m0755 $RPM_SOURCE_DIR/dhcpd.script \ install -m0755 $RPM_SOURCE_DIR/dhcpd.script \
$RPM_BUILD_ROOT/usr/lib/dhcp/dhcpd %{buildroot}%{_libexecdir}/dhcp/dhcpd
sed -e 's/@LIBDIR@/%{_lib}/g' -i $RPM_BUILD_ROOT/usr/lib/dhcp/dhcpd sed -e 's/@LIBDIR@/%{_lib}/g' -i %{buildroot}%{_libexecdir}/dhcp/dhcpd
install -m0755 $RPM_SOURCE_DIR/dhcrelay.script \ install -m0755 $RPM_SOURCE_DIR/dhcrelay.script \
$RPM_BUILD_ROOT/usr/lib/dhcp/dhcrelay %{buildroot}%{_libexecdir}/dhcp/dhcrelay
# service units # service units
install -d -m0755 $RPM_BUILD_ROOT%{_unitdir} install -d -m0755 %{buildroot}%{_unitdir}
install -m0644 $RPM_SOURCE_DIR/dhcpd.service \ install -m0644 $RPM_SOURCE_DIR/dhcpd.service \
$RPM_BUILD_ROOT%{_unitdir}/dhcpd.service %{buildroot}%{_unitdir}/dhcpd.service
install -m0644 $RPM_SOURCE_DIR/dhcpd6.service \ install -m0644 $RPM_SOURCE_DIR/dhcpd6.service \
$RPM_BUILD_ROOT%{_unitdir}/dhcpd6.service %{buildroot}%{_unitdir}/dhcpd6.service
install -m0644 $RPM_SOURCE_DIR/dhcrelay.service \ install -m0644 $RPM_SOURCE_DIR/dhcrelay.service \
$RPM_BUILD_ROOT%{_unitdir}/dhcrelay.service %{buildroot}%{_unitdir}/dhcrelay.service
install -m0644 $RPM_SOURCE_DIR/dhcrelay6.service \ install -m0644 $RPM_SOURCE_DIR/dhcrelay6.service \
$RPM_BUILD_ROOT%{_unitdir}/dhcrelay6.service %{buildroot}%{_unitdir}/dhcrelay6.service
# rcservice links # rcservice links
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcdhcpd
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd6 ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcdhcpd6
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcdhcrelay
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay6 ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcdhcrelay6
%if %suse_version > 1310
# rcservice actions # rcservice actions
legacy_actionsdir=$RPM_BUILD_ROOT/usr/lib/initscripts/legacy-actions legacy_actionsdir=%{buildroot}%{_libexecdir}/initscripts/legacy-actions
cat >dhcpd.action <<'EOF' cat >dhcpd.action <<'EOF'
#!/bin/bash #!/bin/bash
exec /usr/lib/dhcp/dhcpd -4 ${0##*/} exec %{_libexecdir}/dhcp/dhcpd -4 ${0##*/}
EOF EOF
install -d -m0755 ${legacy_actionsdir}/dhcpd install -d -m0755 ${legacy_actionsdir}/dhcpd
install -m0755 dhcpd.action ${legacy_actionsdir}/dhcpd/syntax-check install -m0755 dhcpd.action ${legacy_actionsdir}/dhcpd/syntax-check
@ -397,72 +328,66 @@ ln -sf syntax-check ${legacy_actionsdir}/dhcpd/check-lease
rm -f dhcpd.action rm -f dhcpd.action
cat >dhcpd.action <<'EOF' cat >dhcpd.action <<'EOF'
#!/bin/bash #!/bin/bash
exec /usr/lib/dhcp/dhcpd -6 ${0##*/} exec %{_libexecdir}/dhcp/dhcpd -6 ${0##*/}
EOF EOF
install -d -m0755 ${legacy_actionsdir}/dhcpd6 install -d -m0755 ${legacy_actionsdir}/dhcpd6
install -m0755 dhcpd.action ${legacy_actionsdir}/dhcpd6/syntax-check install -m0755 dhcpd.action ${legacy_actionsdir}/dhcpd6/syntax-check
ln -sf syntax-check ${legacy_actionsdir}/dhcpd6/check-syntax ln -sf syntax-check ${legacy_actionsdir}/dhcpd6/check-syntax
ln -sf syntax-check ${legacy_actionsdir}/dhcpd6/check-lease ln -sf syntax-check ${legacy_actionsdir}/dhcpd6/check-lease
rm -f dhcpd.action rm -f dhcpd.action
%endif
# sysconfig files # sysconfig files
install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcpd \ install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcpd \
$RPM_BUILD_ROOT%{_fillupdir}/ %{buildroot}%{_fillupdir}/
install -m0644 $RPM_SOURCE_DIR/sysconfig.syslog-dhcpd \ install -m0644 $RPM_SOURCE_DIR/sysconfig.syslog-dhcpd \
$RPM_BUILD_ROOT%{_fillupdir}/ %{buildroot}%{_fillupdir}/
install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcrelay \ install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcrelay \
$RPM_BUILD_ROOT%{_fillupdir}/ %{buildroot}%{_fillupdir}/
# another config files and scripts # another config files and scripts
%if %{with_ldap}
install -m0644 contrib/ldap/dhcp.schema \ install -m0644 contrib/ldap/dhcp.schema \
$RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema %{buildroot}%{_sysconfdir}/openldap/schema
%endif
install -m0644 $RPM_SOURCE_DIR/dhcpd.xml \
$RPM_SOURCE_DIR/dhcpd6.xml \
$RPM_BUILD_ROOT/%{omc_svcdir}/
install -m0644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp-server \ install -m0644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp-server \
$RPM_BUILD_ROOT/%{susefw2dir}/dhcp-server %{buildroot}/%{susefw2dir}/dhcp-server
install -m0644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp6-server \ install -m0644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp6-server \
$RPM_BUILD_ROOT/%{susefw2dir}/dhcp6-server %{buildroot}/%{susefw2dir}/dhcp6-server
install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d install -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig/network/if-up.d
install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts install -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig/network/scripts
install -m0755 $RPM_SOURCE_DIR/if-up.d.dhcpd-restart-hook \ install -m0755 $RPM_SOURCE_DIR/if-up.d.dhcpd-restart-hook \
$RPM_BUILD_ROOT/etc/sysconfig/network/scripts/dhcpd-restart-hook %{buildroot}%{_sysconfdir}/sysconfig/network/scripts/dhcpd-restart-hook
ln -sf ../scripts/dhcpd-restart-hook \ ln -sf ../scripts/dhcpd-restart-hook \
$RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/60-dhcpd-restart-hook %{buildroot}%{_sysconfdir}/sysconfig/network/if-up.d/60-dhcpd-restart-hook
# slp support # slp support
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/slp.reg.d install -d -m0755 %{buildroot}%{_sysconfdir}/slp.reg.d
install -m0644 $RPM_SOURCE_DIR/slp.reg.d.dhcp.reg \ install -m0644 $RPM_SOURCE_DIR/slp.reg.d.dhcp.reg \
$RPM_BUILD_ROOT%{_sysconfdir}/slp.reg.d/dhcp.reg %{buildroot}%{_sysconfdir}/slp.reg.d/dhcp.reg
# fix manual page permissions # fix manual page permissions
find $RPM_BUILD_ROOT/%{_mandir} -type f | xargs chmod 644 find %{buildroot}/%{_mandir} -type f | xargs chmod 644
# copy some documentation and examples from src dir # copy some documentation and examples from src dir
install -m0644 $RPM_SOURCE_DIR/dhcp.README README.SUSE install -m0644 $RPM_SOURCE_DIR/dhcp.README README.SUSE
install -m0644 $RPM_SOURCE_DIR/DDNS-howto.txt . install -m0644 $RPM_SOURCE_DIR/DDNS-howto.txt .
cp doc/examples/* ./examples/ cp doc/examples/* ./examples/
rm -f doc/{References.xml,Makefile*} rm -f doc/{References.xml,Makefile*}
rm -f contrib/dhcp.spec rm -f contrib/dhcp.spec
rm -f $RPM_BUILD_ROOT/etc/{dhcpd,dhclient}.conf.example rm -f %{buildroot}%{_sysconfdir}/{dhcpd,dhclient}.conf.example
find contrib doc/examples -type f | xargs chmod -x find contrib doc/examples -type f | xargs chmod -x
# install bind libs+includes needed for dhcp-devel # install bind libs+includes needed for dhcp-devel
pushd bind pushd bind
install -d -m0755 $RPM_BUILD_ROOT%_includedir/dhcp/ install -d -m0755 %{buildroot}%{_includedir}/dhcp/
for i in include/* ; do for i in include/* ; do
cp -r $i $RPM_BUILD_ROOT%_includedir/dhcp/ cp -r $i %{buildroot}%{_includedir}/dhcp/
done done
install -d -m0755 $RPM_BUILD_ROOT%_libdir/dhcp/ install -d -m0755 %{buildroot}%{_libdir}/dhcp/
for l in lib/lib*.a ; do for l in lib/lib*.a ; do
install -m0644 $l $RPM_BUILD_ROOT%_libdir/dhcp/ install -m0644 $l %{buildroot}%{_libdir}/dhcp/
done done
popd popd
# move also all dhcp-devel files to dhcp subdirectories # move also all dhcp-devel files to dhcp subdirectories
mv $RPM_BUILD_ROOT%_includedir/{dhcpctl,isc-dhcp,omapip} \ mv %{buildroot}%{_includedir}/{dhcpctl,isc-dhcp,omapip} \
$RPM_BUILD_ROOT%_includedir/dhcp/ %{buildroot}%{_includedir}/dhcp/
mv $RPM_BUILD_ROOT%_libdir/lib*.* \ mv %{buildroot}%{_libdir}/lib*.* \
$RPM_BUILD_ROOT%_libdir/dhcp/ %{buildroot}%{_libdir}/dhcp/
%pre server %pre server
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||: getent passwd dhcpd >/dev/null || useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d %{_localstatedir}/lib/dhcp dhcpd
%service_add_pre dhcpd.service %service_add_pre dhcpd.service
%service_add_pre dhcpd6.service %service_add_pre dhcpd6.service
@ -524,111 +449,95 @@ test -e %{_localstatedir}/lib/dhcp/dhclient.leases || \
test -e %{_localstatedir}/lib/dhcp6/dhclient6.leases || \ test -e %{_localstatedir}/lib/dhcp6/dhclient6.leases || \
touch %{_localstatedir}/lib/dhcp6/dhclient6.leases touch %{_localstatedir}/lib/dhcp6/dhclient6.leases
%clean
if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
%files %files
%defattr(-,root,root) %license LICENSE
%config %{susefw2dir}/dhcp-server %config %{susefw2dir}/dhcp-server
%config %{susefw2dir}/dhcp6-server %config %{susefw2dir}/dhcp6-server
%{_bindir}/omshell %{_bindir}/omshell
%doc %{_mandir}/man1/omshell.1.gz %{_mandir}/man1/omshell.1%{?ext_man}
%doc %{_mandir}/man5/dhcp-eval.5.gz %{_mandir}/man5/dhcp-eval.5%{?ext_man}
%doc %{_mandir}/man5/dhcp-options.5.gz %{_mandir}/man5/dhcp-options.5%{?ext_man}
%files server %files server
%defattr(-,root,root)
%{_sbindir}/dhcpd %{_sbindir}/dhcpd
%{_sbindir}/dhcpd6 %{_sbindir}/dhcpd6
%{_sbindir}/rcdhcpd %{_sbindir}/rcdhcpd
%{_sbindir}/rcdhcpd6 %{_sbindir}/rcdhcpd6
%{_unitdir}/dhcpd.service %{_unitdir}/dhcpd.service
%{_unitdir}/dhcpd6.service %{_unitdir}/dhcpd6.service
%if %suse_version > 1310 %dir %{_libexecdir}/initscripts/legacy-actions/dhcpd
%dir /usr/lib/initscripts/legacy-actions/dhcpd %{_libexecdir}/initscripts/legacy-actions/dhcpd/*
/usr/lib/initscripts/legacy-actions/dhcpd/* %dir %{_libexecdir}/initscripts/legacy-actions/dhcpd6
%dir /usr/lib/initscripts/legacy-actions/dhcpd6 %{_libexecdir}/initscripts/legacy-actions/dhcpd6/*
/usr/lib/initscripts/legacy-actions/dhcpd6/*
%endif
%config(noreplace) %{_sysconfdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhcpd.conf
%config(noreplace) %{_sysconfdir}/dhcpd6.conf %config(noreplace) %{_sysconfdir}/dhcpd6.conf
%attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd.d/ %attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd.d/
%attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd6.d/ %attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd6.d/
%dir /usr/lib/dhcp %dir %{_libexecdir}/dhcp
/usr/lib/dhcp/dhcpd %{_libexecdir}/dhcp/dhcpd
%dir %{_localstatedir}/lib/dhcp %dir %{_localstatedir}/lib/dhcp
%dir %{_localstatedir}/lib/dhcp/etc %dir %{_localstatedir}/lib/dhcp%{_sysconfdir}
%dir %{_localstatedir}/lib/dhcp/dev %dir %{_localstatedir}/lib/dhcp/dev
%dir %{_localstatedir}/lib/dhcp/%_lib %dir %{_localstatedir}/lib/dhcp/%{_lib}
%dir %{_localstatedir}/lib/dhcp/var %dir %{_localstatedir}/lib/dhcp%{_localstatedir}
%dir %{_localstatedir}/lib/dhcp/var/run %dir %{_localstatedir}/lib/dhcp%{_localstatedir}/run
%attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp/db %attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp/db
%dir %{_localstatedir}/lib/dhcp6 %dir %{_localstatedir}/lib/dhcp6
%dir %{_localstatedir}/lib/dhcp6/etc %dir %{_localstatedir}/lib/dhcp6%{_sysconfdir}
%dir %{_localstatedir}/lib/dhcp6/dev %dir %{_localstatedir}/lib/dhcp6/dev
%dir %{_localstatedir}/lib/dhcp6/%_lib %dir %{_localstatedir}/lib/dhcp6/%{_lib}
%dir %{_localstatedir}/lib/dhcp6/var %dir %{_localstatedir}/lib/dhcp6%{_localstatedir}
%dir %{_localstatedir}/lib/dhcp6/var/run %dir %{_localstatedir}/lib/dhcp6%{_localstatedir}/run
%attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp6/db %attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp6/db
%doc %{_mandir}/man8/dhcpd.8.gz %{_mandir}/man8/dhcpd.8%{?ext_man}
%doc %{_mandir}/man5/dhcpd.conf.5.gz %{_mandir}/man5/dhcpd.conf.5%{?ext_man}
%doc %{_mandir}/man5/dhcpd.leases.5.gz %{_mandir}/man5/dhcpd.leases.5%{?ext_man}
%if %{with_ldap}
%dir %{_sysconfdir}/openldap %dir %{_sysconfdir}/openldap
%dir %{_sysconfdir}/openldap/schema %dir %{_sysconfdir}/openldap/schema
%attr(0644, root, root) %config %{_sysconfdir}/openldap/schema/dhcp.schema %attr(0644, root, root) %config %{_sysconfdir}/openldap/schema/dhcp.schema
%endif
%dir %{_sysconfdir}/slp.reg.d %dir %{_sysconfdir}/slp.reg.d
%config(noreplace) %{_sysconfdir}/slp.reg.d/dhcp.reg %config(noreplace) %{_sysconfdir}/slp.reg.d/dhcp.reg
%{omc_svcdir}/dhcpd.xml
%{omc_svcdir}/dhcpd6.xml
%{_sysconfdir}/sysconfig/network/scripts/dhcpd-restart-hook %{_sysconfdir}/sysconfig/network/scripts/dhcpd-restart-hook
%{_sysconfdir}/sysconfig/network/if-up.d/60-dhcpd-restart-hook %{_sysconfdir}/sysconfig/network/if-up.d/60-dhcpd-restart-hook
%{_fillupdir}/sysconfig.dhcpd %{_fillupdir}/sysconfig.dhcpd
%{_fillupdir}/sysconfig.syslog-dhcpd %{_fillupdir}/sysconfig.syslog-dhcpd
%if %{with_doc_package}
%files doc %files doc
%defattr(-,root,root) %doc README RELNOTES
%endif
%doc LICENSE README RELNOTES
%doc README.* DDNS-howto.txt doc/* %doc README.* DDNS-howto.txt doc/*
%doc contrib examples %doc contrib examples
%files client %files client
%defattr(-,root,root)
/sbin/dhclient /sbin/dhclient
/sbin/dhclient6 /sbin/dhclient6
/sbin/dhclient-script /sbin/dhclient-script
%config(noreplace) %{_sysconfdir}/dhclient.conf %config(noreplace) %{_sysconfdir}/dhclient.conf
%config(noreplace) %{_sysconfdir}/dhclient6.conf %config(noreplace) %{_sysconfdir}/dhclient6.conf
%doc %{_mandir}/man5/dhclient.conf.5.gz %{_mandir}/man5/dhclient.conf.5%{?ext_man}
%doc %{_mandir}/man5/dhclient.leases.5.gz %{_mandir}/man5/dhclient.leases.5%{?ext_man}
%doc %{_mandir}/man8/dhclient.8.gz %{_mandir}/man8/dhclient.8%{?ext_man}
%doc %{_mandir}/man8/dhclient-script.8.gz %{_mandir}/man8/dhclient-script.8%{?ext_man}
%dir %{_localstatedir}/lib/dhcp %dir %{_localstatedir}/lib/dhcp
%dir %{_localstatedir}/lib/dhcp6 %dir %{_localstatedir}/lib/dhcp6
%files relay %files relay
%defattr(-,root,root)
%{_sbindir}/dhcrelay %{_sbindir}/dhcrelay
%{_sbindir}/dhcrelay6 %{_sbindir}/dhcrelay6
%{_sbindir}/rcdhcrelay %{_sbindir}/rcdhcrelay
%{_sbindir}/rcdhcrelay6 %{_sbindir}/rcdhcrelay6
%dir /usr/lib/dhcp %dir %{_libexecdir}/dhcp
/usr/lib/dhcp/dhcrelay %{_libexecdir}/dhcp/dhcrelay
%{_unitdir}/dhcrelay.service %{_unitdir}/dhcrelay.service
%{_unitdir}/dhcrelay6.service %{_unitdir}/dhcrelay6.service
%doc %{_mandir}/man8/dhcrelay.8.gz %{_mandir}/man8/dhcrelay.8%{?ext_man}
%{_fillupdir}/sysconfig.dhcrelay %{_fillupdir}/sysconfig.dhcrelay
%files devel %files devel
%defattr(-,root,root) %dir %{_libdir}/dhcp
%dir %_libdir/dhcp %{_libdir}/dhcp/lib*
%_libdir/dhcp/lib* %dir %{_includedir}/dhcp
%dir %{_prefix}/include/dhcp %{_includedir}/dhcp/*
%{_prefix}/include/dhcp/* %{_mandir}/man3/omapi.3%{?ext_man}
%doc %{_mandir}/man3/omapi.3.gz %{_mandir}/man3/dhcpctl.3%{?ext_man}
%doc %{_mandir}/man3/dhcpctl.3.gz
%changelog %changelog

View File

@ -1,88 +0,0 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2006 Novell, Inc. All rights reserved.
Service Description XML Document for dhcpd.
This file should be placed in /etc/omc/svcinfo.d
Note: The name of the service is the name of this file without the .xml
file extension.
-->
<serviceDescription version="1.0">
<!-- Caption for display purposes -->
<caption>ISC DHCP Server</caption>
<!-- Description of this service -->
<description>
ISC Dynamic Host Configuration Protocol Server
</description>
<!--
The startCommand tag specifies the command line that will be
invoked to start the service. The return code from this command
must be as follows:
0 - success
1 - generic or unspecified error
2 - invalid or excess argument(s)
3 - unimplemented feature (e.g. "reload")
4 - user had insufficient privileges
5 - program is not installed
6 - program is not configured
7 - program is not running
-->
<startCommand>/usr/sbin/rcdhcpd start</startCommand>
<!--
The reStartCommand tag specifies the command line that will be
invoked to restart the service. The return code from this command
must be as specified in the startCommand tag.
-->
<reStartCommand>/usr/sbin/rcdhcpd restart</reStartCommand>
<!--
The stopCommand tag specifies the command line that will be
invoked to stop the service. The return code from this command
must be as specified in the startCommand tag.
-->
<stopCommand>/usr/sbin/rcdhcpd stop</stopCommand>
<!--
The statusCommand specifies the command line that can be run
that will report on the status of the service. The return code
from this command line should be as follows:
0 - service up and running
1 - service dead, but /var/run/ pid file exists
2 - service dead, but /var/lock/ lock file exists
3 - service not running (unused)
4 - service status unknown :-(
-->
<statusCommand>/usr/sbin/rcdhcpd status</statusCommand>
<!--
The processInformation tag allows the XML Service provider to
identify the processes that belong to the service. This allows
the ServiceProcess associations to be instrumented.
If the process_information tag is not specifed, the will be no
ServiceProcess association for the service.
-->
<processInformation>
<name>dhcpd</name>
<modulePath>/usr/sbin/dhcpd</modulePath>
</processInformation>
<!--
Define the services that this service has a dependency on.
There must be a corresponding Service Description XML file
for the antecedent service in the /etc/omc/svcinfo.d directory.
-->
<dependsOn>
<serviceName>network</serviceName>
</dependsOn>
</serviceDescription>

View File

@ -1,88 +0,0 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2006 Novell, Inc. All rights reserved.
Service Description XML Document for dhcpd6.
This file should be placed in /etc/omc/svcinfo.d
Note: The name of the service is the name of this file without the .xml
file extension.
-->
<serviceDescription version="1.0">
<!-- Caption for display purposes -->
<caption>ISC DHCPv6 4.x Server</caption>
<!-- Description of this service -->
<description>
ISC Dynamic Host Configuration Protocol for IPv6 Server
</description>
<!--
The startCommand tag specifies the command line that will be
invoked to start the service. The return code from this command
must be as follows:
0 - success
1 - generic or unspecified error
2 - invalid or excess argument(s)
3 - unimplemented feature (e.g. "reload")
4 - user had insufficient privileges
5 - program is not installed
6 - program is not configured
7 - program is not running
-->
<startCommand>/etc/init.d/dhcpd6 start</startCommand>
<!--
The reStartCommand tag specifies the command line that will be
invoked to restart the service. The return code from this command
must be as specified in the startCommand tag.
-->
<reStartCommand>/etc/init.d/dhcpd6 restart</reStartCommand>
<!--
The stopCommand tag specifies the command line that will be
invoked to stop the service. The return code from this command
must be as specified in the startCommand tag.
-->
<stopCommand>/etc/init.d/dhcpd6 stop</stopCommand>
<!--
The statusCommand specifies the command line that can be run
that will report on the status of the service. The return code
from this command line should be as follows:
0 - service up and running
1 - service dead, but /var/run/ pid file exists
2 - service dead, but /var/lock/ lock file exists
3 - service not running (unused)
4 - service status unknown :-(
-->
<statusCommand>/etc/init.d/dhcpd6 status</statusCommand>
<!--
The processInformation tag allows the XML Service provider to
identify the processes that belong to the service. This allows
the ServiceProcess associations to be instrumented.
If the process_information tag is not specifed, the will be no
ServiceProcess association for the service.
-->
<processInformation>
<name>dhcpd6</name>
<modulePath>/usr/sbin/dhcpd6</modulePath>
</processInformation>
<!--
Define the services that this service has a dependency on.
There must be a corresponding Service Description XML file
for the antecedent service in the /etc/omc/svcinfo.d directory.
-->
<dependsOn>
<serviceName>network</serviceName>
</dependsOn>
</serviceDescription>