source: spec/trunk/SPECS/dhcp.spec@ 1330

Last change on this file since 1330 was 413, checked in by Yuri Dario, 11 years ago

spec: dhcp, Add support for DHCLIENT_BEEP and DHCLIENT_LOGFILE env variables, by Andreas Buchinger.

File size: 9.1 KB
Line 
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
11Summary: Dynamic host configuration protocol software
12Name: dhcp
13Version: %{basever}
14Release: 3%{?dist}
15License: ISC
16Group: System Environment/Daemons
17URL: http://isc.org/products/DHCP/
18
19Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{basedir}.tar.gz
20Source1: dhcp-os2.h
21Source2: dhconf.cmd
22
23Patch0: dhcp-os2.patch
24
25BuildRoot: %{_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
36DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
37individual devices on an IP network to get their own network
38configuration information (IP address, subnetmask, broadcast address,
39etc.) from a DHCP server. The overall purpose of DHCP is to make it
40easier to administer a large network. The dhcp package includes the
41ISC DHCP service and relay agent.
42
43To use DHCP on your network, install a DHCP service (or relay agent),
44and on clients run a DHCP client daemon. The dhcp package provides
45the ISC DHCP service and relay agent.
46
47%package -n dhclient
48Summary: Provides the dhclient ISC DHCP client daemon and dhclient-script
49Group: System Environment/Base
50#Requires: initscripts >= 6.75
51#Requires(post): coreutils
52#Requires(post): grep
53
54%description -n dhclient
55DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
56individual devices on an IP network to get their own network
57configuration information (IP address, subnetmask, broadcast address,
58etc.) from a DHCP server. The overall purpose of DHCP is to make it
59easier to administer a large network.
60
61To use DHCP on your network, install a DHCP service (or relay agent),
62and on clients run a DHCP client daemon. The dhclient package
63provides the ISC DHCP client daemon.
64
65%package devel
66Summary: Development headers and libraries for interfacing to the DHCP server
67Group: Development/Libraries
68Requires: %{name} = %{epoch}:%{version}-%{release}
69
70%description devel
71Header files and API documentation for using the ISC DHCP libraries. The
72libdhcpctl and libomapi static libraries are also included in this package.
73
74%package debug
75Summary: HLL debug data for exception handling support.
76
77%description debug
78HLL debug data for exception handling support.
79
80%prep
81%setup -q -n %{name}-%{basedir}
82cp %{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
90for 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
96done
97
98for 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
103done
104
105#aclocal
106#libtoolize --copy --force
107#autoconf
108#autoheader
109#automake --foreign --add-missing --copy
110
111%build
112export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
113export LDFLAGS="-Zomf"
114CFLAGS="%{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/
140touch %{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
149INTERFACES=""
150DHCPSERVERS=""
151EOF
152
153%{__cat} <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd
154# Command line options here
155DHCPDARGS=
156EOF
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#
177EOF
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.
Note: See TracBrowser for help on using the repository browser.