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