]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - dhcp/dhcp.nm
transmission: Update to 2.80.
[people/amarx/ipfire-3.x.git] / dhcp / dhcp.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = dhcp
7 version = 4.2.4
8 release = 2
9
10 groups = Networking/Daemons
11 url = http://isc.org/products/DHCP/
12 license = ISC
13 summary = Dynamic host configuration protocol software.
14
15 description
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,
19 etc.) from a DHCP server. The overall purpose of DHCP is to make it
20 easier to administer a large network.
21 end
22
23 source_dl = ftp://ftp.isc.org/isc/dhcp/%{version}/
24
25 # Apply patches in a special order.
26 patches = \
27 dhcp-4.2.2-remove-bind.patch \
28 dhcp-4.2.4-P1-remove-dst.patch \
29 dhcp-4.2.0-errwarn-message.patch \
30 dhcp-4.2.4-options.patch \
31 dhcp-4.2.0-release-by-ifup.patch \
32 dhcp-4.2.0-dhclient-decline-backoff.patch \
33 dhcp-4.2.4-unicast-bootp.patch \
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 \
38 dhcp-4.2.4-paths.patch \
39 dhcp-4.2.2-CLOEXEC.patch \
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 \
43 dhcp-4.2.4-64_bit_lease_parse.patch \
44 dhcp-4.2.2-capability.patch \
45 dhcp-4.2.0-logpid.patch \
46 dhcp-4.2.4-UseMulticast.patch \
47 dhcp-4.2.1-sendDecline.patch \
48 dhcp-4.2.1-retransmission.patch \
49 dhcp-4.2.4-rfc3442-classless-static-routes.patch \
50 dhcp-4.2.0-honor-expired.patch \
51 dhcp-4.2.2-sharedlib.patch \
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 \
56 dhcp-4.2.2-gpxe-cid.patch \
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
66
67 build
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
77 systemd-units
78 end
79
80 CFLAGS += -fno-strict-aliasing
81
82 configure_options += \
83 --sysconfdir=%{sysconfdir}/dhcp \
84 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
85 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
86 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
87 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
88 --with-srv-pid-file=/run/dhcpd.pid \
89 --with-srv6-pid-file=/run/dhcpd6.pid \
90 --with-cli-pid-file=/run/dhclient.pid \
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
105 # Remove dst.
106 rm -rvf dst includes/isc-dhcp
107
108 # Regenerate build environment
109 #libtoolize --copy --force
110 autoreconf --verbose --force --install
111 end
112
113 install_cmds
114 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
115
116 # Create runtime folders.
117 mkdir -pv %{BUILDROOT}/var/lib/dhclient
118 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
119
120 # Create empty lease files.
121 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
122 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
123 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
124 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
125 end
126 end
127
128 packages
129 package %{name}
130 requires
131 dhcp-common = %{thisver}
132 dhcp-libs = %{thisver}
133 /usr/lib/network/helpers/dhcpd-config-helper
134 end
135
136 prerequires += shadow-utils
137
138 configfiles
139 %{sysconfdir}/dhcp
140 end
141
142 script prein
143 getent group dhcpd >/dev/null || groupadd -r dhcpd
144 getent passwd dhcpd >/dev/null || \
145 useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \
146 -c "User for the DHCP server" dhcpd
147 end
148
149 # Just search for new unit files that were just installed.
150 script postin
151 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
152 end
153
154 # Disable the service that is to be removed and stop it if it is still running.
155 script preun
156 /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || :
157 /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || :
158 /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || :
159 /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || :
160 /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || :
161 /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || :
162 end
163
164 # Just tell systemd that unitfiles have been removed.
165 script postun
166 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
167 end
168
169 # Try to restart the service if it is running.
170 script postup
171 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
172 /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || :
173 /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || :
174 /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
175 end
176 end
177
178 package dhclient
179 summary = DHCP client daemon and dhclient-script.
180 description = %{summary}
181
182 requires
183 dhcp-common = %{thisver}
184 dhcp-libs = %{thisver}
185 %{sbindir}/dhclient-script
186 end
187
188 files
189 %{unitdir}/dhclient*.service
190 %{sbindir}/dhclient
191 /usr/share/man/man5/dhclient*
192 /usr/share/man/man8/dhclient*
193 /var/lib/dhclient
194 end
195
196 script postin
197 systemctl daemon-reload >/dev/null 2>&1 || :
198 end
199
200 script postun
201 systemctl daemon-reload >/dev/null 2>&1 || :
202 end
203
204 script postup
205 systemctl daemon-reload >/dev/null 2>&1 || :
206 end
207
208 end
209
210 package %{name}-common
211 summary = Common files used by the dhcp client and server.
212 description = %{summary}
213
214 requires
215 dhcp-libs = %{thisver}
216 end
217
218 files
219 /usr/bin/
220 /usr/share/man/man1/omshell.1*
221 /usr/share/man/man5/dhcp-options.5*
222 /usr/share/man/man5/dhcp-eval.5*
223 end
224 end
225
226 package %{name}-libs
227 template LIBS
228 end
229
230 package %{name}-devel
231 template DEVEL
232 end
233
234 package %{name}-debuginfo
235 template DEBUGINFO
236 end
237 end