SPECS: dhcp.spec - added ldap-schema package - build with ldap sup...

baggins baggins at pld-linux.org
Tue Apr 17 18:58:03 CEST 2007


Author: baggins                      Date: Tue Apr 17 16:58:03 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- added ldap-schema package
- build with ldap support by default
- don't use hand-crafted and possibly obsolete dhcpd.conf.sample
- s/fileutils/coreutils/ in R
- package empty dhclient.conf
- properly package documentation

---- Files affected:
SPECS:
   dhcp.spec (1.138 -> 1.139) 

---- Diffs:

================================================================
Index: SPECS/dhcp.spec
diff -u SPECS/dhcp.spec:1.138 SPECS/dhcp.spec:1.139
--- SPECS/dhcp.spec:1.138	Tue Apr 17 16:05:16 2007
+++ SPECS/dhcp.spec	Tue Apr 17 18:57:57 2007
@@ -1,7 +1,7 @@
 # $Revision$, $Date$
 #
 # Conditional build:
-%bcond_with	ldap	# with support for ldap storage
+%bcond_without	ldap	# without support for ldap storage
 #
 Summary:	DHCP Server
 Summary(es.UTF-8):	Servidor DHCP
@@ -18,9 +18,8 @@
 # Source0-md5:	d09be1a80982b78482e8fbd416924468
 Source1:	%{name}.init
 Source2:	%{name}-relay.init
-Source3:	%{name}-relay.sysconfig
-Source4:	%{name}d.conf.sample
-Source5:	%{name}.sysconfig
+Source3:	%{name}.sysconfig
+Source4:	%{name}-relay.sysconfig
 Patch0:		%{name}-dhclient.script.patch
 Patch1:		%{name}-if_buffer_size.patch
 # http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch
@@ -34,13 +33,15 @@
 BuildRequires:	groff
 %{?with_ldap:BuildRequires:	openldap-devel}
 %{?with_ldap:BuildRequires:	openssl-devel}
-BuildRequires:	rpmbuild(macros) >= 1.268
-Requires(post):	fileutils
+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)
 
+%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
@@ -71,11 +72,23 @@
 atende aquelas requisições. Esta versão é ainda considerada um
 software BETA.
 
+%package ldap-schema
+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 ldap-schema
+This package contains LDAPv3 schema for use with the DHCP Server.
+
+%description ldap-schema -l pl.UTF-8
+Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
+
 %package client
 Summary:	DHCP Client
 Summary(pl.UTF-8):	Klient DHCP
 Group:		Networking/Daemons
-Requires(post):	fileutils
 Requires:	coreutils
 Requires:	iproute2
 Requires:	net-tools
@@ -92,7 +105,7 @@
 Summary:	DHCP Relay Agent
 Summary(pl.UTF-8):	Agent przekazywania informacji DHCP
 Group:		Networking/Daemons
-Requires(post):	fileutils
+Requires(post):	coreutils
 Requires(post,preun):	/sbin/chkconfig
 Requires:	rc-scripts >= 0.2.0
 
@@ -135,7 +148,6 @@
 
 %prep
 %setup -q -n %{name}-%{version}%{_pre}
-install %{SOURCE4} .
 %patch0 -p1
 %patch1 -p1
 %{?with_ldap:%patch2 -p1}
@@ -165,8 +177,7 @@
 
 %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}}
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT \
@@ -185,16 +196,19 @@
 	VARDBC=/var/lib/dhclient \
 	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 %{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
 
-mv $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3 \
-	$RPM_BUILD_ROOT%{_mandir}/man1/omshell.1
+install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
+%if %{with ldap}
+install contrib/dhcp.schema $RPM_BUILD_ROOT%{schemadir}
+%endif
 
-install client/scripts/linux $RPM_BUILD_ROOT%{_sbindir}/dhclient-script
+touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
 
 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases
 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
@@ -213,6 +227,16 @@
 	/sbin/chkconfig --del dhcpd
 fi
 
+%post ldap-schema
+%openldap_schema_register %{schemadir}/dhcp.schema -d core
+%service -q ldap restart
+
+%postun ldap-schema
+if [ "$1" = "0" ]; then
+	%openldap_schema_unregister %{schemadir}/dhcp.schema
+	%service -q ldap restart
+fi
+
 %post client
 if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then
 	mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases
@@ -242,21 +266,31 @@
 
 %files
 %defattr(644,root,root,755)
-%doc doc/* README RELNOTES dhcpd.conf.sample LICENSE
-%{?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
-%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
 
+%if %{with ldap}
+%files ldap-schema
+%defattr(644,root,root,755)
+%doc contrib/dhcpd-conf-to-ldap.pl
+%{schemadir}/*.schema
+%endif
+
 %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*
@@ -282,6 +316,14 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.139  2007/04/17 16:57:57  baggins
+- added ldap-schema package
+- build with ldap support by default
+- don't use hand-crafted and possibly obsolete dhcpd.conf.sample
+- s/fileutils/coreutils/ in R
+- package empty dhclient.conf
+- properly package documentation
+
 Revision 1.138  2007/04/17 14:05:16  baggins
 - sanitize versioning to avoid bumping epoch
 - updated ldap patch
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/dhcp.spec?r1=1.138&r2=1.139&f=u



More information about the pld-cvs-commit mailing list