]> git.pld-linux.org Git - packages/dhcp.git/blobdiff - dhcp.spec
- enable timeouts even if not debugging
[packages/dhcp.git] / dhcp.spec
index 96b688b92717809f747cbfd65a25d23e08c2996d..d1e768b1377457d390d285c88b9bf3082a663cfe 100644 (file)
--- a/dhcp.spec
+++ b/dhcp.spec
@@ -1,41 +1,53 @@
 #
 # Conditional build:
 #
 # Conditional build:
-%bcond_with    ldap    # with support for ldap storage
+%bcond_without ldap    # without support for ldap storage
 #
 Summary:       DHCP Server
 #
 Summary:       DHCP Server
-Summary(es):   Servidor DHCP
-Summary(pl):   Serwer DHCP
-Summary(pt_BR):        Servidor DHCP (Protocolo de configuração dinâmica de hosts)
+Summary(es.UTF-8):     Servidor DHCP
+Summary(pl.UTF-8):     Serwer DHCP
+Summary(pt_BR.UTF-8):  Servidor DHCP (Protocolo de configuração dinâmica de hosts)
 Name:          dhcp
 Name:          dhcp
-Version:       3.1.0a1
-Release:       0.5
-Epoch:         3
+Version:       3.1.0
+Release:       3
+Epoch:         4
 License:       distributable
 Group:         Networking/Daemons
 Source0:       ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
 License:       distributable
 Group:         Networking/Daemons
 Source0:       ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
-# Source0-md5: a326c6f135b9fa3ad24988312c784be5
+# Source0-md5: 27d179a3c3fbef576566b456a1168246
 Source1:       %{name}.init
 Source2:       %{name}-relay.init
 Source1:       %{name}.init
 Source2:       %{name}-relay.init
-Source3:       %{name}-relay.sysconfig
-Source4:       %{name}d.conf.sample
-Source5:       %{name}.sysconfig
-Patch0:                %{name}-if_buffer_size.patch
-Patch1:                %{name}-ldap.patch
-Patch2:                %{name}-ldap1.patch
+Source3:       %{name}.sysconfig
+Source4:       %{name}-relay.sysconfig
+Source5:       %{name}-libdhcp4client.pc
+Source6:       %{name}-dhcp4client.h
+Source7:       %{name}-libdhcp4client.make
+Source8:       %{name}-libdhcp_control.h
+Patch0:                %{name}-dhclient.script.patch
+Patch1:                %{name}-if_buffer_size.patch
+# http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch
+Patch2:                %{name}-ldap.patch
 Patch3:                %{name}-client-script-redhat.patch
 Patch4:                %{name}-3.0.3-x-option.patch
 Patch5:                %{name}-typo.patch
 Patch6:                %{name}-arg-concat.patch
 Patch3:                %{name}-client-script-redhat.patch
 Patch4:                %{name}-3.0.3-x-option.patch
 Patch5:                %{name}-typo.patch
 Patch6:                %{name}-arg-concat.patch
+Patch7:                %{name}-split-VARDB.patch
+Patch8:        %{name}-timeouts.patch
+Patch9:                %{name}-options.patch
+Patch10:               %{name}-libdhcp4client.patch
+Patch11:       %{name}-prototypes.patch
 URL:           http://www.isc.org/sw/dhcp/
 BuildRequires: groff
 URL:           http://www.isc.org/sw/dhcp/
 BuildRequires: groff
-%{?with_ldap:BuildRequires:    openldap-devel}
-BuildRequires: rpmbuild(macros) >= 1.268
-Requires(post):        fileutils
+%{?with_ldap:BuildRequires:    openldap-devel >= 2.4.6}
+%{?with_ldap:BuildRequires:    openssl-devel}
+BuildRequires: rpmbuild(macros) >= 1.304
+Requires(post):        coreutils
 Requires(post,preun):  /sbin/chkconfig
 Requires:      rc-scripts >= 0.2.0
 Provides:      dhcpd
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 Requires(post,preun):  /sbin/chkconfig
 Requires:      rc-scripts >= 0.2.0
 Provides:      dhcpd
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                schemadir       /usr/share/openldap/schema
+
 %description
 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
 individual devices on an IP network to get their own network
 %description
 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
 individual devices on an IP network to get their own network
@@ -43,48 +55,62 @@ 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.
 
 etc.) from a DHCP server. The overall purpose of DHCP is to make it
 easier to administer a large network.
 
-%description -l es
+%description -l es.UTF-8
 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
 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
+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
 funcionalidad similar, con ciertas restricciones. Este servidor
-también las atiende.
+también las atiende.
 
 
-%description -l pl
+%description -l pl.UTF-8
 Serwer DHCP (Dynamic Host Configuration Protocol).
 
 Serwer DHCP (Dynamic Host Configuration Protocol).
 
-DHCP to protokó³ pozwalaj±cy urz±dzeniom pracuj±cym w sieci IP na
+DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na
 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
-rozg³oszeniowego itp.) z serwera DHCP. U³atwia on administrowanie
-du¿ymi sieciami IP.
+rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie
+dużymi sieciami IP.
 
 
-%description -l pt_BR
+%description -l pt_BR.UTF-8
 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
-endereços IP alocados dinamicamente, permite também descobrir
-informações sobre a rede em que estão conectados. BOOTP provê uma
-funcionalidade similar, com certas restrições. Este servidor também
-atende aquelas requisições. Esta versão é ainda considerada um
+endereços IP alocados dinamicamente, permite também descobrir
+informações sobre a rede em que estão conectados. BOOTP provê uma
+funcionalidade similar, com certas restrições. Este servidor também
+atende aquelas requisições. Esta versão é ainda considerada um
 software BETA.
 
 software BETA.
 
+%package -n openldap-schema-dhcp
+Summary:       LDAP Schema for DHCP Server
+Summary(pl.UTF-8):     Schemat LDAP dla serwera DHCP
+Group:         Networking/Daemons
+Requires(post,postun): sed >= 4.0
+Requires:      openldap-servers
+
+%description -n openldap-schema-dhcp
+This package contains LDAPv3 schema for use with the DHCP Server.
+
+%description -n openldap-schema-dhcp -l pl.UTF-8
+Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
+
 %package client
 Summary:       DHCP Client
 %package client
 Summary:       DHCP Client
-Summary(pl):   Klient DHCP
+Summary(pl.UTF-8):     Klient DHCP
 Group:         Networking/Daemons
 Group:         Networking/Daemons
-Requires(post):        fileutils
+Requires:      coreutils
+Requires:      iproute2
+Requires:      net-tools
 Obsoletes:     dhclient
 Obsoletes:     dhclient
-Obsoletes:     pump
 
 %description client
 Dynamic Host Configuration Protocol Client.
 
 
 %description client
 Dynamic Host Configuration Protocol Client.
 
-%description client -l pl
+%description client -l pl.UTF-8
 Klient DHCP (Dynamic Host Configuration Protocol).
 
 %package relay
 Summary:       DHCP Relay Agent
 Klient DHCP (Dynamic Host Configuration Protocol).
 
 %package relay
 Summary:       DHCP Relay Agent
-Summary(pl):   Agent przekazywania informacji DHCP
+Summary(pl.UTF-8):     Agent przekazywania informacji DHCP
 Group:         Networking/Daemons
 Group:         Networking/Daemons
-Requires(post):        fileutils
+Requires(post):        coreutils
 Requires(post,preun):  /sbin/chkconfig
 Requires:      rc-scripts >= 0.2.0
 
 Requires(post,preun):  /sbin/chkconfig
 Requires:      rc-scripts >= 0.2.0
 
@@ -95,15 +121,15 @@ DHCP server on it. Because DHCP packets can be broadcast, they will
 not be routed off of the local subnet. The DHCP relay takes care of
 this for the client.
 
 not be routed off of the local subnet. The DHCP relay takes care of
 this for the client.
 
-%description relay -l pl
-Agent przekazywania DHCP (Dynamic Host Configuration Protocol) miêdzy
-podsieciami. Poniewa¿ komunikaty DHCP mog± byæ przekazywane w formie
-rozg³oszeniowej, bez tego agenta nie zostan± przerutowane do innej
+%description relay -l pl.UTF-8
+Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między
+podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie
+rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej
 podsieci.
 
 %package devel
 Summary:       DHCP development includes and libs
 podsieci.
 
 %package devel
 Summary:       DHCP development includes and libs
-Summary(pl):   Pliki nag³ówkowe i biblioteki dla oprogramowania DHCP
+Summary(pl.UTF-8):     Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
 Group:         Development/Libraries
 
 %description devel
 Group:         Development/Libraries
 
 %description devel
@@ -116,26 +142,72 @@ used by the ISC DHCP server.
 The dhcpctl set of functions provide an API that can be used to
 communicate with and manipulate a running ISC DHCP server.
 
 The dhcpctl set of functions provide an API that can be used to
 communicate with and manipulate a running ISC DHCP server.
 
-%description devel -l pl
+%description devel -l pl.UTF-8
 Zawiera biblioteki OMAPI oraz dhcpctl.
 
 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
 Zawiera biblioteki OMAPI oraz dhcpctl.
 
 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
-odpytywania o ich stan. Aktualnie jest u¿ywana przez serwer ISC DHCP.
+odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
+
+dhcpctl to zbiór funkcji tworzących API, które może być używane do
+komunikacji z działającym serwerem ISC DHCP i jego kontroli.
+
+%package -n libdhcp4client
+Summary:       The DHCP client in a library for invocation by other programs
+Summary(pl.UTF-8):     Klient DHCP w postaci biblioteki do wykorzystania w innych programach
+Group:         Development/Libraries
+
+%description -n libdhcp4client
+Provides the client for the DHCP protocol.
+
+%description -n libdhcp4client -l pl.UTF-8
+Ten pakiet zawiera klienta protokołu DHCP.
+
+%package -n libdhcp4client-devel
+Summary:       Header files for development with the DHCP client library
+Summary(pl.UTF-8):     Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP
+Group:         Development/Libraries
+Requires:      libdhcp4client = %{epoch}:%{version}-%{release}
+
+%description -n libdhcp4client-devel
+Header files for development with the DHCP client library.
+
+%description -n libdhcp4client-devel -l pl.UTF-8
+Pliki nagłówkowe do programowania z użyciem biblioteki klienckiej DHCP.
+
+%package -n libdhcp4client-static
+Summary:       Static DHCP client library
+Summary(pl.UTF-8):     Statyczna biblioteka kliencka DHCP
+Group:         Development/Libraries
+Requires:      libdhcp4client-devel = %{epoch}:%{version}-%{release}
 
 
-dhcpctl to zbiór funkcji tworz±cych API, które mo¿e byæ u¿ywane do
-komunikacji z dzia³aj±cym serwerem ISC DHCP i jego kontroli.
+%description -n libdhcp4client-static
+Static DHCP client library.
+
+%description -n libdhcp4client-static -l pl.UTF-8
+Statyczna biblioteka kliencka DHCP.
 
 %prep
 %setup -q
 
 %prep
 %setup -q
-install %{SOURCE4} .
 %patch0 -p1
 %patch0 -p1
-%{?with_ldap:%patch1 -p1}
+%patch1 -p1
 %{?with_ldap:%patch2 -p1}
 %{?with_ldap:%patch2 -p1}
+# These two patches are required for dhcdbd to function
 %patch3 -p1
 %patch3 -p1
-# WTF is this?
-#%patch4 -p1
+%patch4 -p1
+#
 %patch5 -p1
 %patch6 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+
+sed 's/@DHCP_VERSION@/'%{version}'/' < %{SOURCE5} > libdhcp4client.pc
+mkdir -p libdhcp4client
+cp %{SOURCE6} libdhcp4client/dhcp4client.h
+cp %{SOURCE7} libdhcp4client/Makefile.dist
+cp %{SOURCE8} includes/isc-dhcp/libdhcp_control.h
 
 %build
 # NOTE: this is not autoconf configure - do not change it to %%configure
 
 %build
 # NOTE: this is not autoconf configure - do not change it to %%configure
@@ -146,16 +218,16 @@ install %{SOURCE4} .
        CC_OPTIONS="%{rpmcflags} \
                -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \
                -DEXTENDED_NEW_OPTION_INFO \
        CC_OPTIONS="%{rpmcflags} \
                -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \
                -DEXTENDED_NEW_OPTION_INFO \
-               -D_PATH_DHCLIENT_DB=\\\"/var/lib/%{name}/dhclient.leases\\\" \
+               -D_PATH_DHCLIENT_DB=\\\"/var/lib/dhclient/dhclient.leases\\\" \
        "
        LFLAGS="%{rpmldflags}" \
        DEBUG="" \
        "
        LFLAGS="%{rpmldflags}" \
        DEBUG="" \
-       VARDB="/var/lib/%{name}"
+       VARDBS="/var/lib/%{name}"
+       VARDBC="/var/lib/dhclient"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_bindir},%{_mandir}/man{5,8}} \
-       $RPM_BUILD_ROOT{/var/lib/%{name},%{_sysconfdir}/{rc.d/init.d,sysconfig}}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{rc.d/init.d,sysconfig},%{schemadir},%{_pkgconfigdir}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT \
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT \
@@ -170,21 +242,28 @@ install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_bindir},%{_mandir}/man{5,8}} \
        LIBMANEXT=.3 \
        USRMANDIR=%{_mandir}/man1 \
        USRMANEXT=.1 \
        LIBMANEXT=.3 \
        USRMANDIR=%{_mandir}/man1 \
        USRMANEXT=.1 \
-       VARDB=/var/lib/%{name} \
+       VARDBS=/var/lib/%{name} \
+       VARDBC=/var/lib/dhclient \
        FFMANEXT=.5
 
        FFMANEXT=.5
 
+rm $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3*
+
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
 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%{_sysconfdir}/dhcpd.conf
-install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
+install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
+
+install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
+%if %{with ldap}
+install contrib/dhcp.schema $RPM_BUILD_ROOT%{schemadir}
+%endif
 
 
-mv $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3 \
-       $RPM_BUILD_ROOT%{_mandir}/man1/omshell.1
+touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
 
 
-install client/scripts/linux $RPM_BUILD_ROOT%{_sbindir}/dhclient-script
+touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases
+touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
 
 
-touch $RPM_BUILD_ROOT/var/lib/%{name}/{dhcpd,dhclient}.leases
+install libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -200,10 +279,19 @@ if [ "$1" = "0" ];then
        /sbin/chkconfig --del dhcpd
 fi
 
        /sbin/chkconfig --del dhcpd
 fi
 
+%post -n openldap-schema-dhcp
+%openldap_schema_register %{schemadir}/dhcp.schema -d core
+%service -q ldap restart
+
+%postun -n openldap-schema-dhcp
+if [ "$1" = "0" ]; then
+       %openldap_schema_unregister %{schemadir}/dhcp.schema
+       %service -q ldap restart
+fi
+
 %post client
 %post client
-# TODO: fix this
-if [ ! -d /var/lib/dhcp ]; then
-       install -d /var/lib/dhcp
+if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then
+       mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases
 fi
 
 %post relay
 fi
 
 %post relay
@@ -230,25 +318,36 @@ fi
 
 %files
 %defattr(644,root,root,755)
 
 %files
 %defattr(644,root,root,755)
-%doc doc/* README RELNOTES dhcpd.conf.sample
-%{?with_ldap:%doc contrib/*}
+%doc doc/* README RELNOTES server/dhcpd.conf LICENSE
+%doc contrib/ms2isc
+%{?with_ldap:%doc README.ldap Changelog-LDAP contrib/dhcpd-conf-to-ldap.pl}
 %{_mandir}/man1/*
 %{_mandir}/man5/dhcp*
 %{_mandir}/man8/dhcp*
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
 %{_mandir}/man1/*
 %{_mandir}/man5/dhcp*
 %{_mandir}/man8/dhcp*
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
-%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_bindir}/omshell
 %attr(755,root,root) %{_sbindir}/dhcpd
 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
 %attr(750,root,root) %dir /var/lib/%{name}
 %ghost /var/lib/%{name}/dhcpd.leases
 
 %attr(755,root,root) %{_sbindir}/dhcpd
 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
 %attr(750,root,root) %dir /var/lib/%{name}
 %ghost /var/lib/%{name}/dhcpd.leases
 
+%if %{with ldap}
+%files -n openldap-schema-dhcp
+%defattr(644,root,root,755)
+%doc contrib/dhcpd-conf-to-ldap.pl
+%{schemadir}/*.schema
+%endif
+
 %files client
 %defattr(644,root,root,755)
 %files client
 %defattr(644,root,root,755)
+%doc contrib/sethostname.sh
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
 %attr(755,root,root) /sbin/dhclient
 %attr(755,root,root) /sbin/dhclient-script
 %{_mandir}/man[58]/dhclient*
 %attr(755,root,root) /sbin/dhclient
 %attr(755,root,root) /sbin/dhclient-script
 %{_mandir}/man[58]/dhclient*
-%ghost /var/lib/%{name}/dhclient.leases
+%attr(750,root,root) %dir /var/lib/dhclient
+%ghost /var/lib/dhclient/dhclient.leases
 
 %files relay
 %defattr(644,root,root,755)
 
 %files relay
 %defattr(644,root,root,755)
@@ -262,3 +361,17 @@ fi
 %{_mandir}/man3/*
 %{_libdir}/*.a
 %{_includedir}/*
 %{_mandir}/man3/*
 %{_libdir}/*.a
 %{_includedir}/*
+
+%files -n libdhcp4client
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdhcp4client-%{version}.so.*
+
+%files -n libdhcp4client-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdhcp4client.so
+%{_includedir}/*
+%{_pkgconfigdir}/libdhcp4client.pc
+
+%files -n libdhcp4client-static
+%defattr(644,root,root,755)
+%{_libdir}/libdhcp4client.a
This page took 0.044571 seconds and 4 git commands to generate.