mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 15:07:14 +08:00
dhcp, dhclient: new version and service files
This commit is contained in:
parent
02270f1b8e
commit
9678ca54dd
@ -4,47 +4,54 @@
|
||||
# maintainer: Samir Benmendil <ram-z[at]chakra-project[dot]org>
|
||||
|
||||
pkgbase=dhcp
|
||||
pkgname=('dhcp'
|
||||
'dhclient')
|
||||
pkgname=('dhcp'
|
||||
'dhclient')
|
||||
# separate patch levels with a period to maintain proper versioning.
|
||||
pkgver=4.2.4.1
|
||||
_pkgver=4.2.4-P1
|
||||
pkgver=4.2.4.2
|
||||
_pkgver=4.2.4-P2
|
||||
pkgrel=1
|
||||
arch=('i686' 'x86_64')
|
||||
license=('custom:isc-dhcp')
|
||||
url="https://www.isc.org/software/dhcp"
|
||||
source=(ftp://ftp.isc.org/isc/${pkgbase}/${_pkgver}/${pkgbase}-${_pkgver}.tar.gz
|
||||
dhcp4 dhcp6 dhcp.conf.d
|
||||
dhcp-4.1.1-missing-ipv6-not-fatal.patch
|
||||
dhclient-script-pathFixes.patch)
|
||||
md5sums=('0ca7181024651f6323951d5498c8020b'
|
||||
'c49b1497837ba56c54e401a66e1bab9b'
|
||||
'12c2f3ae47ed23eb698eb7f1bfd80f20'
|
||||
'8f357e46e1efcbb746f38737a3f977a2'
|
||||
'fd64aeb4f399dcc41ea43089a3811094'
|
||||
'0fc1241ef7879d8be0fe140deb8ae48d')
|
||||
dhcp4
|
||||
dhcp6
|
||||
dhcp.conf.d
|
||||
dhcpd4.service
|
||||
dhcpd6.service
|
||||
dhcp-4.2.4-P2-missing-ipv6-not-fatal.patch
|
||||
dhclient-script-pathFixes.patch)
|
||||
sha256sums=('0f75170e323cd9573e6e09a5d9236725f3e56e3cac5a70a01fe2a9d76b436499'
|
||||
'e857d57c860fef26eabe0142fd6e4fc19453dff2cc1ee4cc9f611368b351229f'
|
||||
'6211936c07986437f6ff982653ad4f26324859c7873cfea41b0f0ed32027d18c'
|
||||
'83bfd784c8496f7543d81c145ccfb31bcbbfbce01c0410d0f6337a59eba53f47'
|
||||
'02ba5fb78c242f6ff57da83b3d4499cf57d54bc95473b182bed1ea7eb47876e8'
|
||||
'8a4a92b0cbd423294dc19d56df753a26f7634494540ef89cca3aff7335b7297d'
|
||||
'96d85d4cdc92a90c54c420fdea993cd02f9339af2220ac5c82e10853ff2c06a4'
|
||||
'c4ec67c0bb06f8113e871e20a7784fea2dd9baa14435b1624b963370fef29136')
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/${pkgname}-${_pkgver}
|
||||
cd "${srcdir}/${pkgname}-${_pkgver}"
|
||||
|
||||
# Define _GNU_SOURCE to fix IPV6.
|
||||
sed '/^CFLAGS="$CFLAGS/ s/INGS"/INGS -D_GNU_SOURCE"/' -i configure
|
||||
|
||||
# Make not having ipv6 non-fatal.
|
||||
patch -p0 -i ${srcdir}/dhcp-4.1.1-missing-ipv6-not-fatal.patch
|
||||
patch -p1 -i "${srcdir}/dhcp-4.2.4-P2-missing-ipv6-not-fatal.patch"
|
||||
|
||||
./configure --prefix=/usr --sysconfdir=/etc \
|
||||
--with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
|
||||
--with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
|
||||
--with-cli-lease-file=/var/state/dhclient/dhclient.leases \
|
||||
--with-cli6-lease-file=/var/state/dhclient/dhclient6.leases
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
|
||||
--with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
|
||||
--with-cli-lease-file=/var/state/dhclient/dhclient.leases \
|
||||
--with-cli6-lease-file=/var/state/dhclient/dhclient6.leases
|
||||
|
||||
make
|
||||
|
||||
patch -i "${srcdir}/dhclient-script-pathFixes.patch" client/scripts/linux
|
||||
}
|
||||
|
||||
package_dhcp(){
|
||||
package_dhcp() {
|
||||
pkgdesc="A DHCP server, client, and relay agent"
|
||||
depends=('openssl>=0.9.8a')
|
||||
backup=('etc/dhcpd.conf' 'etc/conf.d/dhcp')
|
||||
@ -53,23 +60,30 @@ package_dhcp(){
|
||||
cd "${srcdir}/${pkgname}-${_pkgver}"
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
install -D -m755 "${srcdir}/dhcp4" "${pkgdir}/etc/rc.d/dhcp4"
|
||||
install -D -m755 "${srcdir}/dhcp6" "${pkgdir}/etc/rc.d/dhcp6"
|
||||
install -D -m644 "${srcdir}/dhcp.conf.d" "${pkgdir}/etc/conf.d/${pkgbase}"
|
||||
install -D -m0755 "${srcdir}/dhcp4" "${pkgdir}/etc/rc.d/dhcp4"
|
||||
install -D -m0755 "${srcdir}/dhcp6" "${pkgdir}/etc/rc.d/dhcp6"
|
||||
install -D -m0644 "${srcdir}/dhcp.conf.d" "${pkgdir}/etc/conf.d/${pkgbase}"
|
||||
mkdir -p "${pkgdir}/var/state/dhcp"
|
||||
|
||||
# Install systemd service files
|
||||
install -D -m0644 "${srcdir}/dhcpd4.service" "${pkgdir}/usr/lib/systemd/system/dhcpd4.service"
|
||||
install -D -m0644 "${srcdir}/dhcpd6.service" "${pkgdir}/usr/lib/systemd/system/dhcpd6.service"
|
||||
ln -s dhcpd4.service "${pkgdir}/usr/lib/systemd/system/dhcp4.service"
|
||||
ln -s dhcpd6.service "${pkgdir}/usr/lib/systemd/system/dhcp6.service"
|
||||
|
||||
# Remove dhclient
|
||||
make -C client DESTDIR="${pkgdir}" uninstall
|
||||
|
||||
# install licenses
|
||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/dhcp/LICENSE"
|
||||
install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/dhcp/LICENSE"
|
||||
}
|
||||
|
||||
package_dhclient(){
|
||||
package_dhclient() {
|
||||
_pkgname=dhcp
|
||||
pkgdesc="dhclient is standalone client from the dhcp package"
|
||||
depends=('bash' 'iproute2' 'net-tools')
|
||||
|
||||
cd "${srcdir}/${pkgname}-${_pkgver}"
|
||||
|
||||
cd "${srcdir}/${_pkgname}-${_pkgver}"
|
||||
make -C client DESTDIR="${pkgdir}" install
|
||||
|
||||
#move dhclient.conf to dhclient.conf.example
|
||||
@ -78,8 +92,8 @@ package_dhclient(){
|
||||
install -d "${pkgdir}/var/state/dhclient"
|
||||
|
||||
# install dhclient linux script
|
||||
install -Dm755 client/scripts/linux "${pkgdir}/sbin/dhclient-script"
|
||||
install -Dm0755 client/scripts/linux "${pkgdir}/sbin/dhclient-script"
|
||||
|
||||
# install licenses
|
||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/dhclient/LICENSE"
|
||||
install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/dhclient/LICENSE"
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
--- common/discover.c 2009-09-29 21:44:49.000000000 +0200
|
||||
+++ common/discover.c_new 2010-06-30 19:40:02.000000000 +0200
|
||||
@@ -443,7 +443,7 @@
|
||||
diff -Naur dhcp-4.2.4-P2/common/discover.c dhcp-4.2.4-P2.fixed/common/discover.c
|
||||
--- dhcp-4.2.4-P2/common/discover.c 2012-08-24 19:11:21.000000000 +0000
|
||||
+++ dhcp-4.2.4-P2.fixed/common/discover.c 2012-10-02 18:05:29.353084310 +0000
|
||||
@@ -455,7 +455,7 @@
|
||||
}
|
||||
|
||||
#ifdef DHCPv6
|
||||
@ -9,7 +10,7 @@
|
||||
ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
|
||||
if (ifaces->fp6 == NULL) {
|
||||
log_error("Error opening '/proc/net/if_inet6' to "
|
||||
@@ -454,6 +454,8 @@
|
||||
@@ -466,6 +466,8 @@
|
||||
ifaces->fp = NULL;
|
||||
return 0;
|
||||
}
|
||||
@ -18,7 +19,7 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -721,7 +723,7 @@
|
||||
@@ -733,7 +735,7 @@
|
||||
return 1;
|
||||
}
|
||||
#ifdef DHCPv6
|
||||
@ -27,7 +28,7 @@
|
||||
if (local_family == AF_INET6)
|
||||
return next_iface6(info, err, ifaces);
|
||||
}
|
||||
@@ -740,7 +742,8 @@
|
||||
@@ -752,7 +754,8 @@
|
||||
ifaces->sock = -1;
|
||||
#ifdef DHCPv6
|
||||
if (local_family == AF_INET6) {
|
@ -5,10 +5,10 @@ post_install() {
|
||||
#echo "If dhcpd doesn't start, ensure the ipv6 kernel module is loaded."
|
||||
|
||||
echo
|
||||
echo "==> The dhcp server has now two rc.d scripts."
|
||||
echo "==> Use '/etc/rc.d/dhcp6' to use IPv6 dhcp server or"
|
||||
echo "==> '/etc/rc.d/dhcp4' to use IPv4 dhcp server."
|
||||
echo "==> Make sure that you change your DAEMONS array in '/etc/rc.conf'!"
|
||||
echo "==> The dhcp server has two service files."
|
||||
echo "==> Use 'dhcpd6.service' to use IPv6 dhcp server or"
|
||||
echo "==> 'dhcpd4.service' to use IPv4 dhcp server."
|
||||
echo "==> Make sure that you enable your service file with systemctl!"
|
||||
}
|
||||
|
||||
# arg 1: the new package version
|
||||
|
13
dhcp/dhcpd4.service
Normal file
13
dhcp/dhcpd4.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=IPv4 DHCP server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/dhcpd4.pid
|
||||
ExecStart=/usr/sbin/dhcpd -4 -q -pf /run/dhcpd4.pid
|
||||
ExecReload=/bin/kill -TERM $MAINPID
|
||||
KillSignal=SIGINT
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
13
dhcp/dhcpd6.service
Normal file
13
dhcp/dhcpd6.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=IPv6 DHCP server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/dhcpd6.pid
|
||||
ExecStart=/usr/sbin/dhcpd -6 -q -pf /run/dhcpd6.pid
|
||||
ExecReload=/bin/kill -TERM $MAINPID
|
||||
KillSignal=SIGINT
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user