]>
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 |
530cba5e | 7 | version = 4.4.1 |
d8feb2d7 | 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 | 24 | |
802ea3af | 25 | build |
6df985df SS |
26 | requires |
27 | autoconf | |
28 | automake | |
d8feb2d7 | 29 | bind-devel>=9.9.9-P6 |
6df985df SS |
30 | bind-devel<10 |
31 | groff | |
32 | libtool | |
33 | openldap-devel | |
34 | libcap-ng-devel | |
d8feb2d7 | 35 | systemd-devel |
6df985df SS |
36 | end |
37 | ||
444c1184 | 38 | CFLAGS += -fno-strict-aliasing |
6df985df | 39 | |
530cba5e SS |
40 | PARALLELISMFLAGS = # No parallel build. |
41 | ||
802ea3af | 42 | configure_options += \ |
b781eae5 | 43 | --sysconfdir=%{sysconfdir}/dhcp \ |
802ea3af | 44 | --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \ |
b781eae5 | 45 | --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \ |
802ea3af | 46 | --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \ |
6df985df | 47 | --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \ |
3dd085a5 | 48 | --with-srv-pid-file=/run/dhcpd.pid \ |
6df985df | 49 | --with-srv6-pid-file=/run/dhcpd6.pid \ |
3dd085a5 | 50 | --with-cli-pid-file=/run/dhclient.pid \ |
6df985df SS |
51 | --with-cli6-pid-file=/run/dhclient6.pid \ |
52 | --with-relay-pid-file=/run/dhcrelay.pid \ | |
53 | --with-ldap \ | |
54 | --with-ldapcrypto \ | |
6df985df SS |
55 | --disable-static \ |
56 | --enable-paranoia \ | |
d8feb2d7 SS |
57 | --enable-early-chroot \ |
58 | --enable-binary-leases \ | |
59 | --with-systemd | |
6df985df SS |
60 | |
61 | prepare_cmds | |
6df985df | 62 | # Regenerate build environment |
6df985df | 63 | autoreconf --verbose --force --install |
d8feb2d7 SS |
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 | |
6df985df | 85 | end |
802ea3af MT |
86 | |
87 | install_cmds | |
b781eae5 | 88 | rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf |
802ea3af | 89 | |
3dd085a5 | 90 | # Create runtime folders. |
802ea3af | 91 | mkdir -pv %{BUILDROOT}/var/lib/dhclient |
3dd085a5 SS |
92 | mkdir -pv %{BUILDROOT}/var/lib/dhcpd |
93 | ||
94 | # Create empty lease files. | |
95 | touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases | |
6df985df | 96 | touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases |
3dd085a5 | 97 | touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases |
6df985df | 98 | touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases |
802ea3af MT |
99 | end |
100 | end | |
101 | ||
102 | packages | |
103 | package %{name} | |
6df985df | 104 | requires |
b781eae5 MT |
105 | dhcp-common = %{thisver} |
106 | dhcp-libs = %{thisver} | |
107 | /usr/lib/network/helpers/dhcpd-config-helper | |
6df985df SS |
108 | end |
109 | ||
110 | prerequires += shadow-utils | |
111 | ||
b781eae5 MT |
112 | configfiles |
113 | %{sysconfdir}/dhcp | |
114 | end | |
115 | ||
6df985df SS |
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 | |
6df985df SS |
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 | |
b781eae5 MT |
157 | dhcp-common = %{thisver} |
158 | dhcp-libs = %{thisver} | |
0bb94940 | 159 | %{sbindir}/dhclient-script |
6df985df SS |
160 | end |
161 | ||
162 | files | |
0111cbc9 | 163 | %{unitdir}/dhclient*.service |
0bb94940 | 164 | %{sbindir}/dhclient |
6df985df SS |
165 | /usr/share/man/man5/dhclient* |
166 | /usr/share/man/man8/dhclient* | |
167 | /var/lib/dhclient | |
168 | end | |
0111cbc9 MT |
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 | ||
6df985df SS |
182 | end |
183 | ||
184 | package %{name}-common | |
185 | summary = Common files used by the dhcp client and server. | |
186 | description = %{summary} | |
1f9bc2f0 | 187 | |
b781eae5 MT |
188 | requires |
189 | dhcp-libs = %{thisver} | |
190 | end | |
191 | ||
6df985df SS |
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 | |
802ea3af | 206 | end |
1f9bc2f0 MT |
207 | |
208 | package %{name}-debuginfo | |
209 | template DEBUGINFO | |
210 | end | |
802ea3af | 211 | end |