]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - dhcp/dhcp.nm
libstatgrab: New package.
[people/ms/ipfire-3.x.git] / dhcp / dhcp.nm
CommitLineData
cc52c523 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
cc52c523
MT
4###############################################################################
5
802ea3af 6name = dhcp
444c1184
MT
7version = 4.2.4
8release = 1
cc52c523 9
802ea3af
MT
10groups = Networking/Daemons
11url = http://isc.org/products/DHCP/
12license = ISC
13summary = Dynamic host configuration protocol software.
cc52c523 14
802ea3af 15description
6df985df
SS
16 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
17 individual devices on an IP network to get their own network
18 configuration information (IP address, subnetmask, broadcast address,
1f9bc2f0 19 etc.) from a DHCP server. The overall purpose of DHCP is to make it
cc52c523 20 easier to administer a large network.
802ea3af
MT
21end
22
444c1184 23source_dl = ftp://ftp.isc.org/isc/dhcp/%{version}/
6df985df
SS
24
25# Apply patches in a special order.
26patches = \
27 dhcp-4.2.2-remove-bind.patch \
444c1184 28 dhcp-4.2.4-P1-remove-dst.patch \
6df985df 29 dhcp-4.2.0-errwarn-message.patch \
444c1184 30 dhcp-4.2.4-options.patch \
6df985df
SS
31 dhcp-4.2.0-release-by-ifup.patch \
32 dhcp-4.2.0-dhclient-decline-backoff.patch \
444c1184 33 dhcp-4.2.4-unicast-bootp.patch \
6df985df
SS
34 dhcp-4.2.2-dhclient-usage.patch \
35 dhcp-4.2.0-default-requested-options.patch \
36 dhcp-4.2.2-xen-checksum.patch \
37 dhcp-4.2.1-manpages.patch \
444c1184 38 dhcp-4.2.4-paths.patch \
6df985df 39 dhcp-4.2.2-CLOEXEC.patch \
6df985df
SS
40 dhcp-4.2.0-garbage-chars.patch \
41 dhcp-4.2.0-missing-ipv6-not-fatal.patch \
42 dhcp-4.2.0-add_timeout_when_NULL.patch \
444c1184 43 dhcp-4.2.4-64_bit_lease_parse.patch \
6df985df
SS
44 dhcp-4.2.2-capability.patch \
45 dhcp-4.2.0-logpid.patch \
444c1184 46 dhcp-4.2.4-UseMulticast.patch \
6df985df
SS
47 dhcp-4.2.1-sendDecline.patch \
48 dhcp-4.2.1-retransmission.patch \
444c1184 49 dhcp-4.2.4-rfc3442-classless-static-routes.patch \
6df985df 50 dhcp-4.2.0-honor-expired.patch \
6df985df 51 dhcp-4.2.2-sharedlib.patch \
444c1184
MT
52 dhcp-4.2.4-PPP.patch \
53 dhcp-4.2.3-paranoia.patch \
54 dhcp-4.2.4-lpf-ib.patch \
55 dhcp-4.2.4-improved-xid.patch \
6df985df 56 dhcp-4.2.2-gpxe-cid.patch \
444c1184
MT
57 dhcp-4.2.4-systemtap.patch \
58 dhcp-4.2.3-dhclient-decline-onetry.patch \
59 dhcp-4.2.3-P2-log_perror.patch \
60 dhcp-4.2.4-getifaddrs.patch \
61 dhcp-4.2.4-send_release.patch \
62 dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch \
63 dhcp-4.2.4-failOverPeer.patch \
64 dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch \
65 dhcp-4.2.4-P1-interval.patch
802ea3af
MT
66
67build
6df985df
SS
68 requires
69 autoconf
70 automake
71 bind-devel>=9
72 bind-devel<10
73 groff
74 libtool
75 openldap-devel
76 libcap-ng-devel
0111cbc9 77 systemd-units
6df985df
SS
78 end
79
444c1184 80 CFLAGS += -fno-strict-aliasing
6df985df 81
802ea3af 82 configure_options += \
b781eae5 83 --sysconfdir=%{sysconfdir}/dhcp \
802ea3af 84 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
b781eae5 85 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
802ea3af 86 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
6df985df 87 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
3dd085a5 88 --with-srv-pid-file=/run/dhcpd.pid \
6df985df 89 --with-srv6-pid-file=/run/dhcpd6.pid \
3dd085a5 90 --with-cli-pid-file=/run/dhclient.pid \
6df985df
SS
91 --with-cli6-pid-file=/run/dhclient6.pid \
92 --with-relay-pid-file=/run/dhcrelay.pid \
93 --with-ldap \
94 --with-ldapcrypto \
95 --with-libbind=/usr/include/ \
96 --with-libbind-libs=/usr/lib/ \
97 --disable-static \
98 --enable-paranoia \
99 --enable-early-chroot
100
101 prepare_cmds
102 # Remove bundled BIND source
103 rm -rvf %{DIR_APP}/bind/bind.tar.gz
104
444c1184
MT
105 # Remove dst.
106 rm -rvf dst includes/isc-dhcp
107
6df985df 108 # Regenerate build environment
444c1184 109 #libtoolize --copy --force
6df985df
SS
110 autoreconf --verbose --force --install
111 end
802ea3af
MT
112
113 install_cmds
b781eae5 114 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
802ea3af
MT
115
116 # Move the client to /sbin, create dirs
117 # and remove the default config.
118 mkdir -pv %{BUILDROOT}/sbin
119 mv -v %{BUILDROOT}/usr/sbin/dhclient %{BUILDROOT}/sbin/dhclient
120
121 install -v -m 755 %{DIR_SOURCE}/dhclient-script \
122 %{BUILDROOT}/sbin/dhclient-script
3dd085a5
SS
123
124 # Create runtime folders.
802ea3af 125 mkdir -pv %{BUILDROOT}/var/lib/dhclient
3dd085a5
SS
126 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
127
128 # Create empty lease files.
129 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
6df985df 130 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
3dd085a5 131 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
6df985df 132 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
802ea3af
MT
133 end
134end
135
136packages
137 package %{name}
6df985df 138 requires
b781eae5
MT
139 dhcp-common = %{thisver}
140 dhcp-libs = %{thisver}
141 /usr/lib/network/helpers/dhcpd-config-helper
6df985df
SS
142 end
143
144 prerequires += shadow-utils
145
b781eae5
MT
146 configfiles
147 %{sysconfdir}/dhcp
148 end
149
6df985df
SS
150 script prein
151 getent group dhcpd >/dev/null || groupadd -r dhcpd
152 getent passwd dhcpd >/dev/null || \
153 useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \
154 -c "User for the DHCP server" dhcpd
6df985df
SS
155 end
156
157 # Just search for new unit files that were just installed.
158 script postin
159 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
160 end
161
162 # Disable the service that is to be removed and stop it if it is still running.
163 script preun
164 /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || :
165 /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || :
166 /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || :
167 /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || :
168 /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || :
169 /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || :
170 end
171
172 # Just tell systemd that unitfiles have been removed.
173 script postun
174 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
175 end
176
177 # Try to restart the service if it is running.
178 script postup
179 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
180 /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || :
181 /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || :
182 /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
183 end
184 end
185
186 package dhclient
187 summary = DHCP client daemon and dhclient-script.
188 description = %{summary}
189
190 requires
b781eae5
MT
191 dhcp-common = %{thisver}
192 dhcp-libs = %{thisver}
6df985df
SS
193 end
194
195 files
0111cbc9 196 %{unitdir}/dhclient*.service
6df985df
SS
197 /sbin
198 /usr/share/man/man5/dhclient*
199 /usr/share/man/man8/dhclient*
200 /var/lib/dhclient
201 end
0111cbc9
MT
202
203 script postin
204 systemctl daemon-reload >/dev/null 2>&1 || :
205 end
206
207 script postun
208 systemctl daemon-reload >/dev/null 2>&1 || :
209 end
210
211 script postup
212 systemctl daemon-reload >/dev/null 2>&1 || :
213 end
214
6df985df
SS
215 end
216
217 package %{name}-common
218 summary = Common files used by the dhcp client and server.
219 description = %{summary}
1f9bc2f0 220
b781eae5
MT
221 requires
222 dhcp-libs = %{thisver}
223 end
224
6df985df
SS
225 files
226 /usr/bin/
227 /usr/share/man/man1/omshell.1*
228 /usr/share/man/man5/dhcp-options.5*
229 /usr/share/man/man5/dhcp-eval.5*
230 end
231 end
232
233 package %{name}-libs
234 template LIBS
235 end
236
237 package %{name}-devel
238 template DEVEL
802ea3af 239 end
1f9bc2f0
MT
240
241 package %{name}-debuginfo
242 template DEBUGINFO
243 end
802ea3af 244end