]> git.ipfire.org Git - ipfire-3.x.git/blob - dhcp/dhcp.nm
kernel: Disable support for 6RD
[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.3.5b1
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 configure_options += \
41 --sysconfdir=%{sysconfdir}/dhcp \
42 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
43 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
44 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
45 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
46 --with-srv-pid-file=/run/dhcpd.pid \
47 --with-srv6-pid-file=/run/dhcpd6.pid \
48 --with-cli-pid-file=/run/dhclient.pid \
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 \
57 --enable-early-chroot \
58 --enable-binary-leases \
59 --with-systemd
60
61 prepare_cmds
62 # Remove bundled BIND source
63 rm -rvf %{DIR_APP}/bind/bind.tar.gz
64
65 # Regenerate build environment
66 autoreconf --verbose --force --install
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
88 end
89
90 install_cmds
91 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
92
93 # Create runtime folders.
94 mkdir -pv %{BUILDROOT}/var/lib/dhclient
95 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
96
97 # Create empty lease files.
98 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
99 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
100 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
101 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
102 end
103 end
104
105 packages
106 package %{name}
107 requires
108 dhcp-common = %{thisver}
109 dhcp-libs = %{thisver}
110 /usr/lib/network/helpers/dhcpd-config-helper
111 end
112
113 prerequires += shadow-utils
114
115 configfiles
116 %{sysconfdir}/dhcp
117 end
118
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
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
160 dhcp-common = %{thisver}
161 dhcp-libs = %{thisver}
162 %{sbindir}/dhclient-script
163 end
164
165 files
166 %{unitdir}/dhclient*.service
167 %{sbindir}/dhclient
168 /usr/share/man/man5/dhclient*
169 /usr/share/man/man8/dhclient*
170 /var/lib/dhclient
171 end
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
185 end
186
187 package %{name}-common
188 summary = Common files used by the dhcp client and server.
189 description = %{summary}
190
191 requires
192 dhcp-libs = %{thisver}
193 end
194
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
209 end
210
211 package %{name}-debuginfo
212 template DEBUGINFO
213 end
214 end