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