1Summary: The Internet Systems Consortium (ISC) DHCP server 2Name: dhcp 3%define version 3.0.2 4Version: %{version} 5Release: 2tac 6Group: System Environment/Daemons 7Source: /usr/local/src/RPM/SOURCES/dhcp-%{version}.tar.gz 8Copyright: ISC 9BuildRoot: /var/tmp/dhcp-%{version}-root 10 11%description 12Dhcp includes the DHCP server which is used for dynamically configuring 13hosts on a network. Host configuration items such as IP address, name 14servers, domain name, etc. can all be retrieved from the DHCP server by 15a DHCP client. This eases the burden of network wide configuration by 16putting all of the configuration into one place. 17 18%package client 19Summary: A DHCP client 20Group: System Environment/Configuration 21 22%description client 23Dhcp client is a DHCP client for various UNIX operating systems. It allows 24a UNIX machine to obtain it's networking parameters from a DHCP server. 25 26%package relay 27Summary: A DHCP relay 28Group: System Environment/Daemons 29 30%description relay 31Dhcp relay is a relay agent for DHCP packets. It is used on a subnet with 32DHCP clients to "relay" their requests to a subnet that has a DHCP server 33on it. Because DHCP packets can be broadcast, they will not be routed off 34of the local subnet. The DHCP relay takes care of this for the client. 35 36%package devel 37Summary: Development headers and libraries for the dhcpctl API 38Group: Development/Libraries 39 40%description devel 41Dhcp devel contains all of the libraries and headers for developing with 42the dhcpctl API. 43 44%prep 45%setup -q -n dhcp-%{version} 46# do some file editing 47egrep "VARRUN 48ETC 49VARDB" site.conf | sed -e 's/ *=/=/g' -e 's/= */=/g' > vars 50. ./vars 51cat << EOF >> includes/site.h 52#define _PATH_DHCPD_PID "$VARRUN/dhcpd.pid" 53#define _PATH_DHCPD_DB "$ETC/dhcpd.leases" 54#define _PATH_DHCPD_CONF "$ETC/dhcpd.conf" 55EOF 56./configure --with-nsupdate 57 58%build 59make 60 61%install 62rm -rf $RPM_BUILD_ROOT 63mkdir -p $RPM_BUILD_ROOT/usr/local/sbin 64 65make DESTDIR="$RPM_BUILD_ROOT" install 66 67%ifos linux 68mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/{init,rc0,rc1,rc2,rc3,rc4,rc5,rc6}.d 69install -m 755 linux.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/dhcpd 70%else 71%ifos solaris 72mkdir -p ${RPM_BUILD_ROOT}/etc/init.d 73sed -e s'|@PREFIX@|%{_prefix}|g' < contrib/solaris.init > ${RPM_BUILD_ROOT}/etc/init.d/dhcpd 74chmod 755 ${RPM_BUILD_ROOT}/etc/init.d/dhcpd 75%endif 76%endif 77 78# strip binaries and libraries 79strip $RPM_BUILD_ROOT%{_prefix}/sbin/* || : 80for i in `find $RPM_BUILD_ROOT/ -type 'f' -perm '+a=x' ! -name 'lib*so*'`; do 81 file $i |grep -q "not stripped" && strip $i 82done 83 84%post 85%ifos linux 86 /sbin/chkconfig --add dhcpd 87 /etc/rc.d/init.d/dhcpd start 88%else 89 %ifos solaris 90 ln /etc/init.d/dhcpd /etc/rc2.d/S90dhcpd 91 ln /etc/init.d/dhcpd /etc/rc0.d/K30dhcpd 92 /etc/init.d/dhcpd start 93 %else 94 echo "Unknown O/S. You will need to manually configure your\nsystem" 95 echo "to start the DHCP server on system startup." 96 %endif 97%endif 98 99%preun 100if [ $1 = 0 ]; then 101 %ifos linux 102 /etc/rc.d/init.d/dhcpd stop 103 /sbin/chkconfig --del dhcpd 104 %else 105 %ifos solaris 106 /etc/init.d/dhcpd stop 107 rm /etc/rc2.d/S90dhcpd 108 rm /etc/rc0.d/K30dhcpd 109 %else 110 echo "Unknown O/S. You will need to manually clean up the DHCP" 111 echo "server startup\n in your system startup environment." 112 %endif 113 %endif 114fi 115 116%clean 117rm -rf $RPM_BUILD_ROOT 118 119%files 120%defattr(-,root,root) 121%doc COPYRIGHT DOCUMENTATION ISC-LICENSE CHANGES README RELNOTES doc/* 122 123%{_prefix}/sbin/dhcpd 124%{_prefix}/man/cat1m/dhcpd.1m 125%{_prefix}/man/cat4/dhcpd.conf.4 126%{_prefix}/man/cat4/dhcpd.leases.4 127%{_prefix}/man/cat4/dhcp-options.4 128%{_prefix}/man/cat4/dhcp-eval.4 129%{_prefix}/man/cat4/dhcp-contrib.4 130%ifos linux 131%config /etc/rc.d/init.d/dhcpd 132%else 133%ifos solaris 134%config /etc/init.d/dhcpd 135%endif 136%endif 137 138%files devel 139%{_prefix}/man/cat3 140%{_prefix}/lib 141%{_prefix}/include 142 143%files client 144%{_prefix}/etc/dhclient-script 145%{_prefix}/sbin/dhclient 146%{_prefix}/man/cat1m/dhclient.1m 147%{_prefix}/man/cat1m/dhclient-script.1m 148%{_prefix}/man/cat4/dhclient.conf.4 149%{_prefix}/man/cat4/dhclient.leases.4 150 151%files relay 152%{_prefix}/sbin/dhcrelay 153%{_prefix}/man/cat1m/dhcrelay.1m 154 155%changelog 156* Fri Oct 1 1999 Brian J. Murrell <brian@interlinx.bc.ca> 157- write a spec file for dhcpd 158