]> git.ipfire.org Git - ipfire-3.x.git/blob - dhcp/dhcp.nm
clamav: Update to 0.101.4
[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.4.1
8 release = 1
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 build
26 requires
27 autoconf
28 automake
29 bind-devel>=9.9.9-P6
30 bind-devel<10
31 groff
32 libtool
33 openldap-devel
34 libcap-ng-devel
35 systemd-devel
36 end
37
38 CFLAGS += -fno-strict-aliasing
39
40 PARALLELISMFLAGS = # No parallel build.
41
42 configure_options += \
43 --sysconfdir=%{sysconfdir}/dhcp \
44 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
45 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
46 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
47 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
48 --with-srv-pid-file=/run/dhcpd.pid \
49 --with-srv6-pid-file=/run/dhcpd6.pid \
50 --with-cli-pid-file=/run/dhclient.pid \
51 --with-cli6-pid-file=/run/dhclient6.pid \
52 --with-relay-pid-file=/run/dhcrelay.pid \
53 --with-ldap \
54 --with-ldapcrypto \
55 --disable-static \
56 --enable-paranoia \
57 --enable-early-chroot \
58 --enable-binary-leases \
59 --with-systemd
60
61 prepare_cmds
62 # Regenerate build environment
63 autoreconf --verbose --force --install
64
65 # Change DHCLIENT_DEFAULT_PREFIX_LEN 64 -> 128
66 sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' \
67 includes/site.h
68
69 # Update PATH in all manpages
70 for page in client/dhclient.conf.5 client/dhclient.leases.5 \
71 client/dhclient-script.8 client/dhclient.8 ; do
72
73 sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
74 -e 's|RUNDIR|/run|g' \
75 -e 's|DBDIR|%{localstatedir}/lib/dhclient|g' \
76 -e 's|ETCDIR|%{dhcpconfdir}|g' $page
77 done
78
79 for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do
80 sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
81 -e 's|RUNDIR|/run|g' \
82 -e 's|DBDIR|%{localstatedir}/lib/dhcpd|g' \
83 -e 's|ETCDIR|%{dhcpconfdir}|g' $page
84 done
85 end
86
87 install_cmds
88 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
89
90 # Create runtime folders.
91 mkdir -pv %{BUILDROOT}/var/lib/dhclient
92 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
93
94 # Create empty lease files.
95 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
96 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
97 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
98 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
99 end
100 end
101
102 packages
103 package %{name}
104 requires
105 dhcp-common = %{thisver}
106 dhcp-libs = %{thisver}
107 /usr/lib/network/helpers/dhcpd-config-helper
108 end
109
110 prerequires += shadow-utils
111
112 configfiles
113 %{sysconfdir}/dhcp
114 end
115
116 script prein
117 getent group dhcpd >/dev/null || groupadd -r dhcpd
118 getent passwd dhcpd >/dev/null || \
119 useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \
120 -c "User for the DHCP server" dhcpd
121 end
122
123 # Just search for new unit files that were just installed.
124 script postin
125 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
126 end
127
128 # Disable the service that is to be removed and stop it if it is still running.
129 script preun
130 /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || :
131 /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || :
132 /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || :
133 /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || :
134 /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || :
135 /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || :
136 end
137
138 # Just tell systemd that unitfiles have been removed.
139 script postun
140 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
141 end
142
143 # Try to restart the service if it is running.
144 script postup
145 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
146 /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || :
147 /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || :
148 /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
149 end
150 end
151
152 package dhclient
153 summary = DHCP client daemon and dhclient-script.
154 description = %{summary}
155
156 requires
157 dhcp-common = %{thisver}
158 dhcp-libs = %{thisver}
159 %{sbindir}/dhclient-script
160 end
161
162 files
163 %{unitdir}/dhclient*.service
164 %{sbindir}/dhclient
165 /usr/share/man/man5/dhclient*
166 /usr/share/man/man8/dhclient*
167 /var/lib/dhclient
168 end
169
170 script postin
171 systemctl daemon-reload >/dev/null 2>&1 || :
172 end
173
174 script postun
175 systemctl daemon-reload >/dev/null 2>&1 || :
176 end
177
178 script postup
179 systemctl daemon-reload >/dev/null 2>&1 || :
180 end
181
182 end
183
184 package %{name}-common
185 summary = Common files used by the dhcp client and server.
186 description = %{summary}
187
188 requires
189 dhcp-libs = %{thisver}
190 end
191
192 files
193 /usr/bin/
194 /usr/share/man/man1/omshell.1*
195 /usr/share/man/man5/dhcp-options.5*
196 /usr/share/man/man5/dhcp-eval.5*
197 end
198 end
199
200 package %{name}-libs
201 template LIBS
202 end
203
204 package %{name}-devel
205 template DEVEL
206 end
207
208 package %{name}-debuginfo
209 template DEBUGINFO
210 end
211 end