]> git.pld-linux.org Git - packages/dhcp.git/blobdiff - dhcp.spec
- build with USE_SOCKET_FALLBACK. Without that dhcp-relay always uses the last interf...
[packages/dhcp.git] / dhcp.spec
index ca51ef6f4bc1fa19b23b0b09426ca1b642042bd7..b49fdb9df80948a8738ca138536f95e9ed2a5cf9 100644 (file)
--- a/dhcp.spec
+++ b/dhcp.spec
@@ -1,24 +1,35 @@
+#
+# Conditional build:
+%bcond_with    ldap    # with support for ldap storage
+#
 Summary:       DHCP Server
-Summary(es):   Servidor DHCP (Protocolo de configuración dinámica de hosts)
+Summary(es):   Servidor DHCP
 Summary(pl):   Serwer DHCP
 Summary(pt_BR):        Servidor DHCP (Protocolo de configuração dinâmica de hosts)
 Name:          dhcp
-Version:       3.0pl1
-Release:       2
-Epoch:         2
+Version:       3.0.2
+Release:       2.1
+Epoch:         3
 Vendor:                ISC
 License:       distributable
 Group:         Networking/Daemons
 Source0:       ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
+# Source0-md5: 04800a111521e7442749b2ce883f962b
 Source1:       %{name}.init
 Source2:       %{name}-relay.init
 Source3:       %{name}-relay.sysconfig
 Source4:       %{name}d.conf.sample
 Source5:       %{name}.sysconfig
-Patch0:                %{name}-sh.patch
+Patch0:                %{name}-if_buffer_size.patch
+Patch1:                %{name}-ldap.patch
+Patch2:                %{name}-ldap1.patch
+Patch3:                %{name}-gcc343-fix.patch
+URL:           http://www.isc.org/sw/dhcp/
 BuildRequires: groff
-Prereq:                rc-scripts >= 0.2.0
-Prereq:                /sbin/chkconfig
+%{?with_ldap:BuildRequires:    openldap-devel}
+PreReq:                rc-scripts >= 0.2.0
+Requires(post,preun):  /sbin/chkconfig
+Requires(post):        fileutils
 Provides:      dhcpd
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -34,8 +45,7 @@ DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
 direcciones IP alocadas dinámicamente, permite también descubrir
 información sobre la red en que están conectados. BOOTP provee una
 funcionalidad similar, con ciertas restricciones. Este servidor
-también las atiende. Esta versión aún está considerada como un
-software BETA.
+también las atiende.
 
 %description -l pl
 Serwer DHCP (Dynamic Host Configuration Protocol).
@@ -57,7 +67,9 @@ software BETA.
 Summary:       DHCP Client
 Summary(pl):   Klient DHCP
 Group:         Networking/Daemons
+Requires(post):        fileutils
 Obsoletes:     pump
+Obsoletes:     dhclient
 
 %description client
 Dynamic Host Configuration Protocol Client.
@@ -69,8 +81,9 @@ Klient DHCP (Dynamic Host Configuration Protocol).
 Summary:       DHCP Relay Agent
 Summary(pl):   Agent przekazywania informacji DHCP
 Group:         Networking/Daemons
-Prereq:                rc-scripts >= 0.2.0
-Prereq:                /sbin/chkconfig
+PreReq:                rc-scripts >= 0.2.0
+Requires(post,preun):  /sbin/chkconfig
+Requires(post):        fileutils
 
 %description relay
 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
@@ -111,17 +124,28 @@ komunikacji z dzia
 
 %prep
 %setup -q
-%patch0 -p1
 install %{SOURCE4} .
+%patch0 -p1
+%{?with_ldap:%patch1 -p1}
+%{?with_ldap:%patch2 -p1}
+%patch3 -p1
+
+cd doc
+echo "dhcpd complies with the following RFCs:" > rfc-compliance
+ls rfc*.txt >> rfc-compliance
+rm -f rfc*.txt
+cd ..
 
 %build
 # Notice: this is not autoconf configure!!!!!!!
 #         do not change it to %%configure
 ./configure
 
-%{__make} COPTS="%{rpmcflags} \
+%{__make} \
+       COPTS="%{rpmcflags} \
        -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \
-       -D_PATH_DHCLIENT_DB=\\\"/var/lib/%{name}/dhclient.leases\\\"" \
+       -D_PATH_DHCLIENT_DB=\\\"/var/lib/%{name}/dhclient.leases\\\" \
+       -DUSE_SOCKET_FALLBACK" \
        DEBUG="" VARDB="/var/lib/%{name}"
 
 %install
@@ -130,24 +154,25 @@ install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_bindir},%{_mandir}/man{5,8}} \
        $RPM_BUILD_ROOT{/var/lib/%{name},%{_sysconfdir}/{rc.d/init.d,sysconfig}}
 
 %{__make} install \
-       DESTDIR="$RPM_BUILD_ROOT" \
-       CLIENTBINDIR="/sbin" \
-       BINDIR="%{_sbindir}" \
-       LIBDIR="%{_libdir}" \
-       INCDIR="%{_includedir}" \
-       ADMMANDIR="%{_mandir}/man8" \
+       DESTDIR=$RPM_BUILD_ROOT \
+       CLIENTBINDIR=/sbin \
+       BINDIR=%{_sbindir} \
+       LIBDIR=%{_libdir} \
+       INCDIR=%{_includedir} \
+       ADMMANDIR=%{_mandir}/man8 \
        ADMMANEXT=.8 \
-       FFMANDIR="%{_mandir}/man5" \
-       LIBMANDIR="%{_mandir}/man3" \
+       FFMANDIR=%{_mandir}/man5 \
+       LIBMANDIR=%{_mandir}/man3 \
        LIBMANEXT=.3 \
-       USRMANDIR="%{_mandir}/man1" \
+       USRMANDIR=%{_mandir}/man1 \
        USRMANEXT=.1 \
-       VARDB="/var/lib/%{name}" \
+       VARDB=/var/lib/%{name} \
        FFMANEXT=.5
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
+install %{SOURCE4} $RPM_BUILD_ROOT/etc/dhcpd.conf
 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
 
 mv $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3 \
@@ -174,10 +199,23 @@ else
        echo "Run \"/etc/rc.d/init.d/dhcpd start\" to start dhcpd daemon."
 fi
 
+%preun
+if [ "$1" = "0" ];then
+       if [ -f /var/lock/subsys/dhcpd ]; then
+               /etc/rc.d/init.d/dhcpd stop >&2
+       fi
+       /sbin/chkconfig --del dhcpd
+fi
+
+%post client
+if [ -d /var/lib/dhcp ]; then
+       install -d /var/lib/dhcp
+fi
+
 %post relay
 /sbin/chkconfig --add dhcp-relay
 if [ -f /var/lock/subsys/dhcrelay ]; then
-       mv /var/lock/subsys/dhcrelay /var/lock/subsys/dhcp-relay
+       mv -f /var/lock/subsys/dhcrelay /var/lock/subsys/dhcp-relay
 fi
 if [ -f /var/lock/subsys/dhcp-relay ]; then
        /etc/rc.d/init.d/dhcp-relay restart >&2
@@ -185,19 +223,6 @@ else
        echo "Run \"/etc/rc.d/init.d/dhcp-relay start\" to start dhcrelay daemon."
 fi
 
-%post client
-if [ -d /var/lib/dhcp ]; then
-       install -d /var/lib/dhcp
-fi
-
-%preun
-if [ "$1" = "0" ];then
-       if [ -f /var/lock/subsys/dhcpd ]; then
-               /etc/rc.d/init.d/dhcpd stop >&2
-       fi
-       /sbin/chkconfig --del dhcpd
-fi
-
 %preun relay
 if [ "$1" = "0" ];then
        if [ -f /var/lock/subsys/dhcp-relay ]; then
@@ -208,6 +233,7 @@ fi
 
 %triggerpostun -- dhcp < 3.0
 if [ `grep ddns-update-style /etc/dhcpd.conf` = "" ]; then
+       umask 027
        echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp
        echo "" >> /etc/dhcpd.conf.tmp
        cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp
@@ -217,10 +243,12 @@ fi
 %files
 %defattr(644,root,root,755)
 %doc doc/* README RELNOTES dhcpd.conf.sample
+%{?with_ldap:%doc contrib/*}
 %{_mandir}/man1/*
 %{_mandir}/man5/dhcp*
 %{_mandir}/man8/dhcp*
 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/dhcpd
+%config(noreplace) %verify(not size mtime md5) /etc/dhcpd.conf
 %attr(755,root,root) %{_bindir}/*
 %attr(755,root,root) %{_sbindir}/dhcpd
 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
This page took 0.076017 seconds and 4 git commands to generate.