1 | # Where dhcp configuration files are stored
|
---|
2 | %global dhcpconfdir %{_sysconfdir}/dhcp
|
---|
3 |
|
---|
4 | # Base version number from ISC
|
---|
5 | %global basever 3.1
|
---|
6 | %global basedir %{basever}-ESV-R3
|
---|
7 |
|
---|
8 | # LDAP patch version
|
---|
9 | %global ldappatchver %{basever}-2
|
---|
10 |
|
---|
11 | Summary: Dynamic host configuration protocol software
|
---|
12 | Name: dhcp
|
---|
13 | Version: %{basever}
|
---|
14 | Release: 3%{?dist}
|
---|
15 | License: ISC
|
---|
16 | Group: System Environment/Daemons
|
---|
17 | URL: http://isc.org/products/DHCP/
|
---|
18 |
|
---|
19 | Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{basedir}.tar.gz
|
---|
20 | Source1: dhcp-os2.h
|
---|
21 | Source2: dhconf.cmd
|
---|
22 |
|
---|
23 | Patch0: dhcp-os2.patch
|
---|
24 |
|
---|
25 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
---|
26 | #BuildRequires: autoconf
|
---|
27 | #BuildRequires: automake
|
---|
28 | #BuildRequires: groff
|
---|
29 | #BuildRequires: libtool
|
---|
30 | #BuildRequires: openldap-devel
|
---|
31 | #BuildRequires: libcap-ng-devel
|
---|
32 |
|
---|
33 | #Obsoletes: dhcpv6 <= 1.2.0-4
|
---|
34 |
|
---|
35 | %description
|
---|
36 | DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
---|
37 | individual devices on an IP network to get their own network
|
---|
38 | configuration information (IP address, subnetmask, broadcast address,
|
---|
39 | etc.) from a DHCP server. The overall purpose of DHCP is to make it
|
---|
40 | easier to administer a large network. The dhcp package includes the
|
---|
41 | ISC DHCP service and relay agent.
|
---|
42 |
|
---|
43 | To use DHCP on your network, install a DHCP service (or relay agent),
|
---|
44 | and on clients run a DHCP client daemon. The dhcp package provides
|
---|
45 | the ISC DHCP service and relay agent.
|
---|
46 |
|
---|
47 | %package -n dhclient
|
---|
48 | Summary: Provides the dhclient ISC DHCP client daemon and dhclient-script
|
---|
49 | Group: System Environment/Base
|
---|
50 | #Requires: initscripts >= 6.75
|
---|
51 | #Requires(post): coreutils
|
---|
52 | #Requires(post): grep
|
---|
53 |
|
---|
54 | %description -n dhclient
|
---|
55 | DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
---|
56 | individual devices on an IP network to get their own network
|
---|
57 | configuration information (IP address, subnetmask, broadcast address,
|
---|
58 | etc.) from a DHCP server. The overall purpose of DHCP is to make it
|
---|
59 | easier to administer a large network.
|
---|
60 |
|
---|
61 | To use DHCP on your network, install a DHCP service (or relay agent),
|
---|
62 | and on clients run a DHCP client daemon. The dhclient package
|
---|
63 | provides the ISC DHCP client daemon.
|
---|
64 |
|
---|
65 | %package devel
|
---|
66 | Summary: Development headers and libraries for interfacing to the DHCP server
|
---|
67 | Group: Development/Libraries
|
---|
68 | Requires: %{name} = %{epoch}:%{version}-%{release}
|
---|
69 |
|
---|
70 | %description devel
|
---|
71 | Header files and API documentation for using the ISC DHCP libraries. The
|
---|
72 | libdhcpctl and libomapi static libraries are also included in this package.
|
---|
73 |
|
---|
74 | %package debug
|
---|
75 | Summary: HLL debug data for exception handling support.
|
---|
76 |
|
---|
77 | %description debug
|
---|
78 | HLL debug data for exception handling support.
|
---|
79 |
|
---|
80 | %prep
|
---|
81 | %setup -q -n %{name}-%{basedir}
|
---|
82 | cp %{SOURCE1} includes/cf/os2.h
|
---|
83 |
|
---|
84 | # Add in LDAP support
|
---|
85 | #%{__patch} -p1 < ldap-for-dhcp-%{ldappatchver}/%{name}-%{basever}-ldap.patch
|
---|
86 |
|
---|
87 | %patch0 -p1 -b .os2~
|
---|
88 |
|
---|
89 | # Update paths in all man pages
|
---|
90 | for page in client/dhclient.conf.5 client/dhclient.leases.5 \
|
---|
91 | client/dhclient-script.8 client/dhclient.8 ; do
|
---|
92 | %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \
|
---|
93 | -e 's|RUNDIR|%{_localstatedir}/run|g' \
|
---|
94 | -e 's|DBDIR|%{_localstatedir}/lib/dhclient|g' \
|
---|
95 | -e 's|ETCDIR|%{dhcpconfdir}|g' $page
|
---|
96 | done
|
---|
97 |
|
---|
98 | for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do
|
---|
99 | %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \
|
---|
100 | -e 's|RUNDIR|%{_localstatedir}/run|g' \
|
---|
101 | -e 's|DBDIR|%{_localstatedir}/lib/dhcpd|g' \
|
---|
102 | -e 's|ETCDIR|%{dhcpconfdir}|g' $page
|
---|
103 | done
|
---|
104 |
|
---|
105 | #aclocal
|
---|
106 | #libtoolize --copy --force
|
---|
107 | #autoconf
|
---|
108 | #autoheader
|
---|
109 | #automake --foreign --add-missing --copy
|
---|
110 |
|
---|
111 | %build
|
---|
112 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
|
---|
113 | export LDFLAGS="-Zomf"
|
---|
114 | CFLAGS="%{optflags} -D_GNU_SOURCE" \
|
---|
115 | ./configure
|
---|
116 | %{__make} %{?_smp_mflags}
|
---|
117 |
|
---|
118 | %install
|
---|
119 | %{__rm} -rf %{buildroot}
|
---|
120 | %{__make} install DESTDIR=%{buildroot}
|
---|
121 |
|
---|
122 | # Remove files we don't want
|
---|
123 | %{__rm} -f %{buildroot}%{_sysconfdir}/dhclient.conf
|
---|
124 | %{__rm} -f %{buildroot}%{_sysconfdir}/dhcpd.conf
|
---|
125 |
|
---|
126 | # Install correct dhclient-script
|
---|
127 | #%{__mkdir} -p %{buildroot}/sbin
|
---|
128 | #%{__mv} %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
|
---|
129 | #%{__install} -p -m 0755 client/scripts/linux %{buildroot}/sbin/dhclient-script
|
---|
130 | %{__install} -p -m 0755 %{SOURCE2} %{buildroot}%{_sbindir}/dhconf.cmd
|
---|
131 |
|
---|
132 | # Install init scripts
|
---|
133 | #%{__mkdir} -p %{buildroot}%{_initrddir}
|
---|
134 | #%{__install} -p -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/dhcpd
|
---|
135 | #%{__install} -p -m 0755 %{SOURCE8} %{buildroot}%{_initrddir}/dhcpd6
|
---|
136 | #%{__install} -p -m 0755 %{SOURCE3} %{buildroot}%{_initrddir}/dhcrelay
|
---|
137 |
|
---|
138 | # Start empty lease databases
|
---|
139 | %{__mkdir} -p %{buildroot}%{_localstatedir}/lib/
|
---|
140 | touch %{buildroot}%{_localstatedir}/lib/dhcpd.leases
|
---|
141 | #touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd6.leases
|
---|
142 | %{__mkdir} -p %{buildroot}%{_localstatedir}/lib/
|
---|
143 |
|
---|
144 | # Create default sysconfig files for dhcpd and dhcrelay
|
---|
145 | %{__mkdir} -p %{buildroot}%{_sysconfdir}/sysconfig
|
---|
146 |
|
---|
147 | %{__cat} << EOF > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay
|
---|
148 | # Command line options here
|
---|
149 | INTERFACES=""
|
---|
150 | DHCPSERVERS=""
|
---|
151 | EOF
|
---|
152 |
|
---|
153 | %{__cat} <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd
|
---|
154 | # Command line options here
|
---|
155 | DHCPDARGS=
|
---|
156 | EOF
|
---|
157 |
|
---|
158 | #%{__cat} <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd6
|
---|
159 | # Command line options here
|
---|
160 | #DHCPDARGS=
|
---|
161 | #EOF
|
---|
162 |
|
---|
163 | # Copy sample conf files into position (called by doc macro)
|
---|
164 | %{__cp} -p client/dhclient.conf dhclient.conf.sample
|
---|
165 | %{__cp} -p server/dhcpd.conf dhcpd.conf.sample
|
---|
166 | #%{__cp} -p doc/examples/dhclient-dhcpv6.conf dhclient6.conf.sample
|
---|
167 | #%{__cp} -p doc/examples/dhcpd-dhcpv6.conf dhcpd6.conf.sample
|
---|
168 |
|
---|
169 | # Install default (empty) dhcpd.conf:
|
---|
170 | %{__mkdir} -p %{buildroot}%{dhcpconfdir}
|
---|
171 | %{__cat} << EOF > %{buildroot}%{dhcpconfdir}/dhcpd.conf
|
---|
172 | #
|
---|
173 | # DHCP Server Configuration file.
|
---|
174 | # see /usr/share/doc/dhcp*/dhcpd.conf.sample
|
---|
175 | # see 'man 5 dhcpd.conf'
|
---|
176 | #
|
---|
177 | EOF
|
---|
178 |
|
---|
179 | # Install default (empty) dhcpd6.conf:
|
---|
180 | #%{__cat} << EOF > %{buildroot}%{dhcpconfdir}/dhcpd6.conf
|
---|
181 | #
|
---|
182 | # DHCP for IPv6 Server Configuration file.
|
---|
183 | # see /usr/share/doc/dhcp*/dhcpd6.conf.sample
|
---|
184 | # see 'man 5 dhcpd.conf'
|
---|
185 | # run 'service dhcpd6 start' or 'dhcpd -6 -cf /etc/dhcp/dhcpd6.conf'
|
---|
186 | #
|
---|
187 | #EOF
|
---|
188 |
|
---|
189 | # Install dhcp.schema for LDAP configuration
|
---|
190 | #%{__mkdir} -p %{buildroot}%{_sysconfdir}/openldap/schema
|
---|
191 | #%{__install} -p -m 0644 -D ldap-for-dhcp-%{ldappatchver}/dhcp.schema \
|
---|
192 | # %{buildroot}%{_sysconfdir}/openldap/schema
|
---|
193 |
|
---|
194 | # Install empty directory for dhclient.d scripts
|
---|
195 | #%{__mkdir} -p %{buildroot}%{dhcpconfdir}/dhclient.d
|
---|
196 |
|
---|
197 | # Install NetworkManager dispatcher script
|
---|
198 | #%{__mkdir} -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
|
---|
199 | #%{__install} -p -m 0755 %{SOURCE6} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
|
---|
200 |
|
---|
201 | # Install pm-utils script to handle suspend/resume and dhclient leases
|
---|
202 | #%{__mkdir} -p %{buildroot}%{_libdir}/pm-utils/sleep.d
|
---|
203 | #%{__install} -p -m 0755 %{SOURCE7} %{buildroot}%{_libdir}/pm-utils/sleep.d
|
---|
204 |
|
---|
205 | %clean
|
---|
206 | %{__rm} -rf %{buildroot}
|
---|
207 |
|
---|
208 |
|
---|
209 | %files
|
---|
210 | %defattr(-,root,root,-)
|
---|
211 | %doc LICENSE README
|
---|
212 | #ldap-for-dhcp-%{ldappatchver}/README.ldap
|
---|
213 | %doc RELNOTES dhcpd.conf.sample doc/IANA-arp-parameters doc/api+protocol
|
---|
214 | # dhcpd6.conf.sample
|
---|
215 | %doc doc/*.txt
|
---|
216 | # __fedora_contrib/*
|
---|
217 | #ldap-for-dhcp-%{ldappatchver}/*.txt
|
---|
218 | %dir %{_localstatedir}/lib
|
---|
219 | %attr(0750,root,root) %dir %{dhcpconfdir}
|
---|
220 | %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/dhcpd.leases
|
---|
221 | #%verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd6.leases
|
---|
222 | %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
|
---|
223 | #%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd6
|
---|
224 | %config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
|
---|
225 | %config(noreplace) %{dhcpconfdir}/dhcpd.conf
|
---|
226 | #%config(noreplace) %{dhcpconfdir}/dhcpd6.conf
|
---|
227 | #%config(noreplace) %{_sysconfdir}/openldap/schema/dhcp.schema
|
---|
228 | #%dir %{_sysconfdir}/NetworkManager
|
---|
229 | #%dir %{_sysconfdir}/NetworkManager/dispatcher.d
|
---|
230 | #%{_sysconfdir}/NetworkManager/dispatcher.d/10-dhclient
|
---|
231 | #%{_initrddir}/dhcpd
|
---|
232 | #%{_initrddir}/dhcpd6
|
---|
233 | #%{_initrddir}/dhcrelay
|
---|
234 | %{_bindir}/omshell.exe
|
---|
235 | %{_sbindir}/dhcpd.exe
|
---|
236 | %{_sbindir}/dhcrelay.exe
|
---|
237 | %attr(0644,root,root) %{_mandir}/man1/omshell.1
|
---|
238 | %attr(0644,root,root) %{_mandir}/man5/dhcpd.conf.5
|
---|
239 | %attr(0644,root,root) %{_mandir}/man5/dhcpd.leases.5
|
---|
240 | %attr(0644,root,root) %{_mandir}/man8/dhcpd.8
|
---|
241 | %attr(0644,root,root) %{_mandir}/man8/dhcrelay.8
|
---|
242 | %attr(0644,root,root) %{_mandir}/man5/dhcp-options.5
|
---|
243 | %attr(0644,root,root) %{_mandir}/man5/dhcp-eval.5
|
---|
244 |
|
---|
245 | %files -n dhclient
|
---|
246 | %defattr(-,root,root,-)
|
---|
247 | %doc dhclient.conf.sample
|
---|
248 | # README.dhclient.d
|
---|
249 | # dhclient6.conf.sample
|
---|
250 | %attr(0750,root,root) %dir %{dhcpconfdir}
|
---|
251 | #%dir %{dhcpconfdir}/dhclient.d
|
---|
252 | %dir %{_localstatedir}/lib
|
---|
253 | %{_sbindir}/dhclient.exe
|
---|
254 | %{_sbindir}/dhconf.cmd
|
---|
255 | #%attr(0755,root,root) %{_libdir}/pm-utils/sleep.d/56dhclient
|
---|
256 | %attr(0644,root,root) %{_mandir}/man5/dhclient.conf.5
|
---|
257 | %attr(0644,root,root) %{_mandir}/man5/dhclient.leases.5
|
---|
258 | %attr(0644,root,root) %{_mandir}/man8/dhclient.8
|
---|
259 | %attr(0644,root,root) %{_mandir}/man8/dhclient-script.8
|
---|
260 | %attr(0644,root,root) %{_mandir}/man5/dhcp-options.5
|
---|
261 | %attr(0644,root,root) %{_mandir}/man5/dhcp-eval.5
|
---|
262 |
|
---|
263 | %files devel
|
---|
264 | %defattr(-,root,root,-)
|
---|
265 | %{_includedir}/*
|
---|
266 | %{_libdir}/*.a
|
---|
267 | %attr(0644,root,root) %{_mandir}/man3/dhcpctl.3
|
---|
268 | %attr(0644,root,root) %{_mandir}/man3/omapi.3
|
---|
269 |
|
---|
270 | %files debug
|
---|
271 | %defattr(-,root,root)
|
---|
272 | %{_bindir}/*.dbg
|
---|
273 | %{_sbindir}/*.dbg
|
---|
274 |
|
---|
275 | %changelog
|
---|
276 | * Sun Apr 13 2014 yd
|
---|
277 | - r711, Add support for DHCLIENT_BEEP and DHCLIENT_LOGFILE env variables, by Andreas Buchinger.
|
---|
278 |
|
---|
279 | * Mon Jan 30 2012 yd
|
---|
280 | - added dhconf.cmd.
|
---|
281 | - use spawn instead of fork().
|
---|
282 |
|
---|
283 | * Tue Jan 24 2012 yd
|
---|
284 | - initial unixroot build.
|
---|