6 |
Name: dhcp |
Name: dhcp |
7 |
Epoch: 3 |
Epoch: 3 |
8 |
Version: %{major_version}%{patch_version} |
Version: %{major_version}%{patch_version} |
9 |
Release: %mkrel 1 |
Release: %mkrel 2 |
10 |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client |
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client |
11 |
License: Distributable |
License: Distributable |
12 |
Group: System/Servers |
Group: System/Servers |
23 |
Source12: dhcpd.service |
Source12: dhcpd.service |
24 |
Source14: dhcpd6.service |
Source14: dhcpd6.service |
25 |
Source16: dhcrelay.service |
Source16: dhcrelay.service |
26 |
|
Source17: dhcpd.tmpfiles |
27 |
|
Source18: dhclient.tmpfiles |
28 |
|
Source19: dhcrelay.tmpfiles |
29 |
# mageia patches |
# mageia patches |
30 |
Patch100: dhcp-4.2.2-ifup.patch |
Patch100: dhcp-4.2.2-ifup.patch |
31 |
Patch101: dhcp-4.2.2-fix-format-errors.patch |
Patch101: dhcp-4.2.2-fix-format-errors.patch |
163 |
%serverbuild |
%serverbuild |
164 |
%configure2_5x --enable-paranoia --enable-early-chroot \ |
%configure2_5x --enable-paranoia --enable-early-chroot \ |
165 |
--with-ldapcrypto \ |
--with-ldapcrypto \ |
166 |
--with-srv-lease-file=%{_var}/lib/dhcp/dhcpd.leases \ |
--with-srv-lease-file=%{_var}/lib/dhcpd/dhcpd.leases \ |
167 |
--with-srv6-lease-file=%{_var}/lib/dhcp/dhcpd6.leases \ |
--with-srv6-lease-file=%{_var}/lib/dhcpd/dhcpd6.leases \ |
168 |
--with-cli-lease-file=%{_var}/lib/dhcp/dhclient.leases \ |
--with-cli-lease-file=%{_var}/lib/dhclient/dhclient.leases \ |
169 |
--with-cli6-lease-file=%{_var}/lib/dhcp/dhclient6.leases \ |
--with-cli6-lease-file=%{_var}/lib/dhclient/dhclient6.leases \ |
170 |
--with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \ |
--with-srv-pid-file=/run/dhcpd/dhcpd.pid \ |
171 |
--with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \ |
--with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \ |
172 |
--with-cli-pid-file=%{_var}/run/dhclient.pid \ |
--with-cli-pid-file=/run/dhclient/dhclient.pid \ |
173 |
--with-cli6-pid-file=%{_var}/run/dhclient6.pid \ |
--with-cli6-pid-file=/run/dhclient/dhclient6.pid \ |
174 |
--with-relay-pid-file=%{_var}/run/dhcrelay.pid |
--with-relay-pid-file=/run/dhcrelay/dhcrelay.pid \ |
175 |
|
--disable-static |
176 |
%make |
%make |
177 |
|
|
178 |
%install |
%install |
179 |
rm -rf %{buildroot} |
rm -rf %{buildroot} |
180 |
|
|
|
install -d %{buildroot}%{_bindir} |
|
|
install -d %{buildroot}%{_sysconfdir}/sysconfig |
|
|
install -d %{buildroot}%{_var}/lib/dhcp |
|
|
install -d %{buildroot}%{_var}/run/dhcpd |
|
|
|
|
181 |
%makeinstall_std |
%makeinstall_std |
182 |
|
|
183 |
# Install correct dhclient-script |
# Install correct dhclient-script |
184 |
%{__mkdir} -p %{buildroot}/sbin |
install -d %{buildroot}/sbin |
185 |
%{__mv} %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient |
mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient |
186 |
%{__install} -p -m 0755 client/scripts/linux %{buildroot}/sbin/dhclient-script |
install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script |
187 |
|
|
188 |
install -d %{buildroot}%{_unitdir} |
install -d %{buildroot}%{_unitdir} |
189 |
install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service |
install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service |
190 |
install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service |
install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service |
191 |
install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service |
install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service |
192 |
|
|
193 |
install -m0755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}/ |
install -d %{buildroot}%{_tmpfilesdir} |
194 |
install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ |
install -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf |
195 |
install -m0755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir}/ |
install -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf |
196 |
|
install -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf |
197 |
|
|
198 |
|
install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir} |
199 |
|
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir} |
200 |
|
install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir} |
201 |
|
|
202 |
# install exit-hooks script to /etc/ |
# install exit-hooks script to /etc/ |
203 |
install -m0755 %{SOURCE9} %{buildroot}%{_sysconfdir}/ |
install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir} |
204 |
|
|
205 |
|
install -d %{buildroot}%{_sysconfdir}/sysconfig |
206 |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF |
207 |
# You can set here various option for dhcpd |
# You can set here various option for dhcpd |
208 |
|
|
219 |
# Define OPTIONS with any other options to pass to the dhcpd server. |
# Define OPTIONS with any other options to pass to the dhcpd server. |
220 |
# See dhcpd(8) for available options and syntax. |
# See dhcpd(8) for available options and syntax. |
221 |
OPTIONS="-q" |
OPTIONS="-q" |
|
|
|
222 |
EOF |
EOF |
223 |
|
|
224 |
touch %{buildroot}%{_var}/lib/dhcp/dhcpd.leases |
install -d %{buildroot}%{_var}/lib/dhcpd |
225 |
touch %{buildroot}%{_var}/lib/dhcp/dhclient.leases |
touch %{buildroot}%{_var}/lib/dhcpd/dhcpd.leases |
226 |
|
install -d %{buildroot}%{_var}/lib/dhclient |
227 |
|
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases |
228 |
|
|
229 |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF |
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF |
230 |
# Define SERVERS with a list of one or more DHCP servers where |
# Define SERVERS with a list of one or more DHCP servers where |
248 |
|
|
249 |
# remove unwanted file |
# remove unwanted file |
250 |
rm -f %{buildroot}%{_sysconfdir}/dhclient.conf |
rm -f %{buildroot}%{_sysconfdir}/dhclient.conf |
251 |
|
rm -f %{buildroot}%{_libdir}/*.a |
252 |
|
|
253 |
%pre server |
%pre server |
254 |
%_pre_useradd dhcpd /dev/null /bin/false |
%_pre_useradd dhcpd /dev/null /bin/false |
255 |
|
|
256 |
%post server |
%post server |
257 |
%_post_service dhcpd |
%_post_service dhcpd |
258 |
|
systemd-tmpfiles --create %{name}.conf |
259 |
# New dhcpd lease file |
# New dhcpd lease file |
260 |
if [ ! -f %{_var}/lib/dhcp/dhcpd.leases ]; then |
if [ ! -f %{_var}/lib/dhcpd/dhcpd.leases ]; then |
261 |
touch %{_var}/lib/dhcp/dhcpd.leases |
touch %{_var}/lib/dhcpd/dhcpd.leases |
262 |
fi |
fi |
263 |
|
|
264 |
%preun server |
%preun server |
266 |
|
|
267 |
%post relay |
%post relay |
268 |
%_post_service dhcrelay |
%_post_service dhcrelay |
269 |
|
systemd-tmpfiles --create %{name}.conf |
270 |
|
|
271 |
%preun relay |
%preun relay |
272 |
%_preun_service dhcrelay |
%_preun_service dhcrelay |
273 |
|
|
274 |
%post client |
%post client |
275 |
touch /var/lib/dhcp/dhclient.leases |
touch %{_var}/lib/dhclient/dhclient.leases |
276 |
|
systemd-tmpfiles --create %{name}.conf |
277 |
|
|
278 |
%postun client |
%postun client |
279 |
rm -rf /var/lib/dhcp/dhclient.leases |
rm -rf %{_var}/lib/dhclient/dhclient.leases |
280 |
|
|
281 |
%files common |
%files common |
282 |
%doc README contrib/ldap/README.ldap RELNOTES |
%doc README contrib/ldap/README.ldap RELNOTES |
283 |
%doc contrib/3.0b1-lease-convert |
%doc contrib/3.0b1-lease-convert |
|
%dir %{_var}/lib/dhcp |
|
284 |
%{_mandir}/man5/dhcp-options.5* |
%{_mandir}/man5/dhcp-options.5* |
285 |
|
|
286 |
%files doc |
%files doc |
290 |
%doc server/dhcpd.conf tests/failover contrib/ldap/dhcp.schema |
%doc server/dhcpd.conf tests/failover contrib/ldap/dhcp.schema |
291 |
%{_unitdir}/dhcpd.service |
%{_unitdir}/dhcpd.service |
292 |
%{_unitdir}/dhcpd6.service |
%{_unitdir}/dhcpd6.service |
293 |
|
%{_tmpfilesdir}/dhcpd.conf |
294 |
%config(noreplace) %{_sysconfdir}/dhcpd.conf |
%config(noreplace) %{_sysconfdir}/dhcpd.conf |
295 |
%config(noreplace) %{_sysconfdir}/dhclient-exit-hooks |
%config(noreplace) %{_sysconfdir}/dhclient-exit-hooks |
296 |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd |
|
%config(noreplace) %ghost %{_var}/lib/dhcp/dhcpd.leases |
|
297 |
%{_sbindir}/dhcpd |
%{_sbindir}/dhcpd |
298 |
%{_sbindir}/dhcpreport.pl |
%{_sbindir}/dhcpreport.pl |
299 |
%{_sbindir}/dhcpd-conf-to-ldap |
%{_sbindir}/dhcpd-conf-to-ldap |
305 |
%{_mandir}/man5/dhcpd.leases.5* |
%{_mandir}/man5/dhcpd.leases.5* |
306 |
%{_mandir}/man5/dhcp-eval.5* |
%{_mandir}/man5/dhcp-eval.5* |
307 |
%{_mandir}/man8/dhcpd.8* |
%{_mandir}/man8/dhcpd.8* |
308 |
%dir %{_var}/run/dhcpd |
%dir %{_var}/lib/dhcpd |
309 |
|
%config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd.leases |
310 |
|
|
311 |
%files relay |
%files relay |
312 |
%{_unitdir}/dhcrelay.service |
%{_unitdir}/dhcrelay.service |
313 |
|
%{_tmpfilesdir}/dhcrelay.conf |
314 |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay |
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay |
315 |
%{_sbindir}/dhcrelay |
%{_sbindir}/dhcrelay |
316 |
%{_mandir}/man8/dhcrelay.8* |
%{_mandir}/man8/dhcrelay.8* |
317 |
|
|
318 |
%files client |
%files client |
319 |
%doc client/dhclient.conf |
%doc client/dhclient.conf |
|
%config(noreplace) %ghost %{_var}/lib/dhcp/dhclient.leases |
|
320 |
%attr (0755,root,root) /sbin/dhclient-script |
%attr (0755,root,root) /sbin/dhclient-script |
321 |
|
%{_tmpfilesdir}/dhclient.conf |
322 |
/sbin/dhclient |
/sbin/dhclient |
323 |
%{_mandir}/man5/dhclient.conf.5* |
%{_mandir}/man5/dhclient.conf.5* |
324 |
%{_mandir}/man5/dhclient.leases.5* |
%{_mandir}/man5/dhclient.leases.5* |
325 |
%{_mandir}/man8/dhclient.8* |
%{_mandir}/man8/dhclient.8* |
326 |
%{_mandir}/man8/dhclient-script.8* |
%{_mandir}/man8/dhclient-script.8* |
327 |
|
%dir %{_var}/lib/dhclient |
328 |
|
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases |
329 |
|
|
330 |
%files devel |
%files devel |
331 |
%{_includedir}/* |
%{_includedir}/* |
|
%{_libdir}/*.a |
|
332 |
%{_mandir}/man3/* |
%{_mandir}/man3/* |