# # spec file for package dhcp (Version 4.2.0.P1) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild %define isc_version 4.2.0-P1 %define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services %define omc_prefix /usr/share/omc %define omc_svcdir %{omc_prefix}/svcinfo.d %define with_ldap 1 Name: dhcp %if 0%{?with_ldap:1} BuildRequires: CASA-devel BuildRequires: openldap2-devel %endif BuildRequires: dos2unix License: BSD3c(or similar) Group: Productivity/Networking/Boot/Servers AutoReqProv: on Version: 4.2.0.P1 Release: 0 Summary: Common Files Used by ISC DHCP Software Url: http://www.isc.org/software/dhcp Source0: dhcp-%{isc_version}.tar.bz2 # Source10: rc.dhcpd Source11: rc.dhcpd6 Source12: rc.dhcrelay Source13: rc.dhcrelay6 Source14: sysconfig.dhcpd Source15: sysconfig.syslog-dhcpd Source16: sysconfig.dhcrelay Source19: if-up.d.dhcpd-restart-hook # Source20: dhclient.conf Source21: dhclient6.conf Source22: dhcpd.conf Source23: dhcpd6.conf Source24: dhclient-script # Source30: dhcpd.xml Source31: dhcpd6.xml Source32: SuSEfirewall2.dhcp-server # Source40: dhcp.LIESMICH Source41: dhcp.README Source42: dhcp.README.upgrade Source43: DDNS-howto.txt Source44: contrib.tar.gz Source45: examples.tar.gz # Patch10: dhcp-4.1.1-default-paths.diff # paranoia patch is included now, but not the # additional patch by thomas@suse.de not ... Patch11: dhcp-4.1.1-paranoia.diff Patch12: dhcp-4.1.1-man-includes.diff Patch13: dhcp-4.1.1-tmpfile.diff Patch14: dhcp-4.1.1-in6_pktinfo-prototype.diff Patch15: contrib-lease-path.diff Patch20: dhcp-4.1.1-dhclient-exec-filedes.diff Patch21: dhcp-4.2.0-P1-dhclient-send-hostname-rml.diff ## patch lives here: http://www.suse.de/~mt/git/dhcp-ldap.git/ Patch30: dhcp-4.2.0-P1-ldap-patch-mt01.diff.bz2 Patch39: dhcp-4.2.0-P1-no-libcrypto.diff Patch40: dhcp-4.1.1-P1-lpf-bind-msg-fix.diff Patch41: dhcp-4.1.1-P1-relay-no-ip-on-interface.diff Patch42: dhcp-4.1.1-P1-optional-value-infinite-loop.diff ## PreReq: /bin/touch /sbin/chkconfig sysconfig BuildRoot: %{_tmppath}/%{name}-%{version}-build %package server License: BSD3c(or similar) Summary: ISC DHCP Server Group: Productivity/Networking/Boot/Servers Requires: net-tools dhcp = %{version} PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd Provides: dhcp_server dhcp_server6 AutoReqProv: on %package client License: BSD3c(or similar) Summary: ISC DHCP Client Group: Productivity/Networking/Boot/Clients Requires: net-tools dhcp = %{version} /sbin/arping /usr/bin/host PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /bin/grep Provides: dhcp_client dhcp_client6 AutoReqProv: on %package relay License: BSD3c(or similar) Summary: ISC DHCP Relay Agent Group: Productivity/Networking/Boot/Servers Requires: net-tools dhcp = %{version} PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp Provides: dhcp_relay dhcp_relay6 AutoReqProv: on %package devel License: BSD3c(or similar) Summary: Header Files and Libraries for dhcpctl API Group: Development/Libraries/C and C++ Requires: dhcp = %{version} %package doc License: BSD3c(or similar) Summary: Documentation Group: Productivity/Networking/Boot/Servers %description This package contains common programs used by both the ISC DHCP server ("dhcp-server" package) and client ("dhcp-client") as the omshell and common manual pages. Authors: -------- Internet Systems Consortium, Inc. %description server This package contains the ISC DHCP server. Please read the documentation in /usr/share/doc/packages/dhcp-server regarding configuration of the DHCP server. Authors: -------- Internet Systems Consortium, Inc. %description client 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 configure the network setup. IP address, hostname, routing, nameserver, netmask, and broadcast can be dynamically assigned while booting the machine. It is configurable via the configuration file /etc/dhclient.conf and you can define your own 'hooks' to be used by the /sbin/dhclient-script (which is called by the daemon). Authors: -------- Internet Systems Consortium, Inc. %description relay This is the ISC DHCP relay agent. It can be used as a 'gateway' for DHCP messages across physical network segments. This is necessary because requests can be broadcast, and they will normally not be routed. Authors: -------- Internet Systems Consortium, Inc. %description doc This package contains additional documentation files provided with the software. The manual pages are in the corresponding packages. Authors: -------- Internet Systems Consortium, Inc. %description devel This package contains all of the libraries and headers for developing with the Internet Software Consortium (ISC) dhcpctl API. Authors: -------- Internet Systems Consortium, Inc. %prep %setup -q -n %{name}-%{isc_version} -a 44 -a 45 ## %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p0 %patch20 -p1 %patch21 -p1 %if 0%{?with_ldap:1} %patch30 -p1 %endif %patch39 -p1 %patch40 -p1 %patch41 -p1 %patch42 -p1 ## find . -type f -name \*.cat\* -exec rm -f {} \; dos2unix contrib/ms2isc/* %build CFLAGS="$RPM_OPT_FLAGS -W -Wall -fno-strict-aliasing -Wno-unused" %ifarch ppc ppc64 s390x # bugs 134590, 171532 CFLAGS="$CFLAGS -fsigned-char" %endif %ifarch ia64 %sparc alpha s390x ppc64 x86_64 CFLAGS="$CFLAGS -fPIE" %else CFLAGS="$CFLAGS -fpie" %endif LDFLAGS="-pie" FFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" export RPM_OPT_FLAGS LDFLAGS export CFLAGS FFLAGS CXXFLAGS # %{?suse_update_config:%{suse_update_config -f}} libtoolize --force autoreconf # %configure \ --enable-dhcpv6 \ --enable-failover \ --enable-paranoia \ --enable-early-chroot \ %if 0%{?with_ldap:%with_ldap} --with-ldap \ --with-ldapcrypto \ --with-ldapcasa \ %endif --with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \ --with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \ --with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \ --with-cli6-lease-file=%{_localstatedir}/lib/dhcp6/dhclient.leases \ --with-srv-pid-file=%{_localstatedir}/run/dhcpd.pid \ --with-srv-lease-file=%{_localstatedir}/lib/dhcp/db/dhcpd.leases \ --with-srv6-pid-file=%{_localstatedir}/run/dhcpd6.pid \ --with-srv6-lease-file=%{_localstatedir}/lib/dhcp6/db/dhcpd6.leases # make %{?_smp_mflags} %check # with a minimal config, see if it runs echo "ddns-update-style interim;" > testconf ./server/dhcpd -4 -t -cf testconf || exit 1 ./server/dhcpd -6 -t -cf testconf || exit 1 # check syntax in our scripts 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 bash -n $RPM_SOURCE_DIR/dhclient-script %install export RPM_BUILD_ROOT make install DESTDIR="$RPM_BUILD_ROOT" # # directories install -d -m0755 $RPM_BUILD_ROOT/sbin install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/init.d install -d -m0755 $RPM_BUILD_ROOT/%{susefw2dir} install -d -m0755 $RPM_BUILD_ROOT/%{omc_svcdir} %if 0%{?with_ldap:%with_ldap} install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema %endif install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/run install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates # chroot jail install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/etc install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/dev install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/%_lib install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/var/run install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/db # move the dhclient binary to /sbin mv -f $RPM_BUILD_ROOT/usr/sbin/dhclient $RPM_BUILD_ROOT/sbin/ # provide a ...6 link, so we know it supports DHCPv6 ln -sf dhcpd $RPM_BUILD_ROOT%{_sbindir}/dhcpd6 ln -sf dhcrelay $RPM_BUILD_ROOT%{_sbindir}/dhcrelay6 ln -sf dhclient $RPM_BUILD_ROOT/sbin/dhclient6 # install our adopted config examples and dhclient-script: install -m0644 $RPM_SOURCE_DIR/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhcpd6.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0644 $RPM_SOURCE_DIR/dhclient6.conf $RPM_BUILD_ROOT%{_sysconfdir}/ install -m0750 $RPM_SOURCE_DIR/dhclient-script $RPM_BUILD_ROOT/sbin/ # init scripts install -m0755 $RPM_SOURCE_DIR/rc.dhcpd \ $RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd ln -sf %{_sysconfdir}/init.d/dhcpd \ $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd install -m0755 $RPM_SOURCE_DIR/rc.dhcpd6 \ $RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd6 ln -sf %{_sysconfdir}/init.d/dhcpd6 \ $RPM_BUILD_ROOT%{_sbindir}/rcdhcpd6 install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay \ $RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay ln -sf %{_sysconfdir}/init.d/dhcrelay \ $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay6 \ $RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay6 ln -sf %{_sysconfdir}/init.d/dhcrelay6 \ $RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay6 # sysconfig files install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcpd \ $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/ install -m0644 $RPM_SOURCE_DIR/sysconfig.syslog-dhcpd \ $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/ install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcrelay \ $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/ # another config files and scripts %if 0%{?with_ldap:%with_ldap} install -m0644 contrib/ldap/dhcp.schema \ $RPM_BUILD_ROOT%{_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 \ $RPM_BUILD_ROOT/%{susefw2dir}/dhcp-server install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts install -m0755 $RPM_SOURCE_DIR/if-up.d.dhcpd-restart-hook \ $RPM_BUILD_ROOT/etc/sysconfig/network/scripts/dhcpd-restart-hook ln -sf ../scripts/dhcpd-restart-hook \ $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/60-dhcpd-restart-hook # fix manual page permissions find $RPM_BUILD_ROOT/%{_mandir} -type f | xargs chmod 644 # copy some documentation and examples from src dir install -m0644 $RPM_SOURCE_DIR/dhcp.LIESMICH LIESMICH.SuSE install -m0644 $RPM_SOURCE_DIR/dhcp.README README.SuSE install -m0644 $RPM_SOURCE_DIR/dhcp.README.upgrade README.upgrade install -m0644 $RPM_SOURCE_DIR/DDNS-howto.txt . cp doc/examples/* ./examples/ rm -f doc/{References.xml,Makefile*} rm -f contrib/dhcp.spec %pre server /usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||: %post server %{fillup_and_insserv -n dhcpd dhcpd dhcpd6} %{fillup_only -ans syslog dhcpd} # update? if [ ${FIRST_ARG:-0} -gt 1 ]; then if grep -q '^DHCPD_RUN_AS=.*nobody' etc/sysconfig/dhcpd; then tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX) sed 's|^DHCPD_RUN_AS=.*|DHCPD_RUN_AS="dhcpd"|' etc/sysconfig/dhcpd \ > $tmpfile && mv $tmpfile etc/sysconfig/dhcpd rm -f $tmpfile fi if grep -q '^DHCPD_BINARY=.*dhcpd\..*' etc/sysconfig/dhcpd; then tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX) sed 's|^DHCPD_BINARY=.*|DHCPD_BINARY=""|' etc/sysconfig/dhcpd \ > $tmpfile && mv $tmpfile etc/sysconfig/dhcpd rm -f $tmpfile fi fi exit 0 %preun server %stop_on_removal dhcpd %stop_on_removal dhcpd6 %postun server %restart_on_update dhcpd %restart_on_update dhcpd6 %insserv_cleanup %post relay %{rename_sysconfig_variable -f etc/sysconfig/dhcrelay DHCRELAY6_LOWER_INTERFACES_ARGS DHCRELAY6_LOWER_INTERFACES} %{rename_sysconfig_variable -f etc/sysconfig/dhcrelay DHCRELAY6_UPPER_INTERFACES_ARGS DHCRELAY6_UPPER_INTERFACES} %{fillup_and_insserv -n dhcrelay dhcrelay dhcrelay6} %preun relay %stop_on_removal dhcrelay %stop_on_removal dhcrelay6 %postun relay %restart_on_update dhcrelay %restart_on_update dhcrelay6 %insserv_cleanup %post client test -e %{_localstatedir}/lib/dhcp/dhclient.leases || \ touch %{_localstatedir}/lib/dhcp/dhclient.leases test -e %{_localstatedir}/lib/dhcp6/dhclient6.leases || \ touch %{_localstatedir}/lib/dhcp6/dhclient6.leases %clean if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %files %defattr(-,root,root) %config %{susefw2dir}/dhcp-server %{_bindir}/omshell %doc %{_mandir}/man1/omshell.1.gz %doc %{_mandir}/man5/dhcp-eval.5.gz %doc %{_mandir}/man5/dhcp-options.5.gz %files doc %defattr(-,root,root) %doc LICENSE README RELNOTES %doc LIESMICH.* README.* %doc DDNS-howto.txt doc/* %doc contrib examples %files server %defattr(-,root,root) %{_sbindir}/dhcpd %{_sbindir}/dhcpd6 %{_sbindir}/rcdhcpd %{_sbindir}/rcdhcpd6 %config %{_sysconfdir}/init.d/dhcpd %config %{_sysconfdir}/init.d/dhcpd6 %config(noreplace) %{_sysconfdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhcpd6.conf %dir %{_localstatedir}/lib/dhcp %dir %{_localstatedir}/lib/dhcp/etc %dir %{_localstatedir}/lib/dhcp/dev %dir %{_localstatedir}/lib/dhcp/%_lib %dir %{_localstatedir}/lib/dhcp/var %dir %{_localstatedir}/lib/dhcp/var/run %attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp/db %dir %{_localstatedir}/lib/dhcp6 %dir %{_localstatedir}/lib/dhcp6/etc %dir %{_localstatedir}/lib/dhcp6/dev %dir %{_localstatedir}/lib/dhcp6/%_lib %dir %{_localstatedir}/lib/dhcp6/var %dir %{_localstatedir}/lib/dhcp6/var/run %attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp6/db %doc %{_mandir}/man8/dhcpd.8.gz %doc %{_mandir}/man5/dhcpd.conf.5.gz %doc %{_mandir}/man5/dhcpd.leases.5.gz %if 0%{?with_ldap:%with_ldap} %dir %{_sysconfdir}/openldap %dir %{_sysconfdir}/openldap/schema %attr(0644, root, root) %config %{_sysconfdir}/openldap/schema/dhcp.schema %endif %{omc_svcdir}/dhcpd.xml %{omc_svcdir}/dhcpd6.xml %{_sysconfdir}/sysconfig/network/scripts/dhcpd-restart-hook %{_sysconfdir}/sysconfig/network/if-up.d/60-dhcpd-restart-hook %{_localstatedir}/adm/fillup-templates/sysconfig.dhcpd %{_localstatedir}/adm/fillup-templates/sysconfig.syslog-dhcpd %files client %defattr(-,root,root) /sbin/dhclient /sbin/dhclient6 /sbin/dhclient-script %config(noreplace) %{_sysconfdir}/dhclient.conf %config(noreplace) %{_sysconfdir}/dhclient6.conf %doc %{_mandir}/man5/dhclient.conf.5.gz %doc %{_mandir}/man5/dhclient.leases.5.gz %doc %{_mandir}/man8/dhclient.8.gz %doc %{_mandir}/man8/dhclient-script.8.gz %dir %{_localstatedir}/lib/dhcp %dir %{_localstatedir}/lib/dhcp6 %files relay %defattr(-,root,root) %{_sbindir}/dhcrelay %{_sbindir}/dhcrelay6 %{_sbindir}/rcdhcrelay %{_sbindir}/rcdhcrelay6 %config %{_sysconfdir}/init.d/dhcrelay %config %{_sysconfdir}/init.d/dhcrelay6 %doc %{_mandir}/man8/dhcrelay.8.gz %{_localstatedir}/adm/fillup-templates/sysconfig.dhcrelay %files devel %defattr(-,root,root) %_libdir/lib* %{_prefix}/include/* %doc %{_mandir}/man3/omapi.3.gz %doc %{_mandir}/man3/dhcpctl.3.gz %changelog