1 # Contributor: Manolis Tzanidakis
2 # Contributor: kevin <kevin@archlinux.org>
8 pkgdesc="A daemon which brings up/down network interfaces upon cable insertion/removal."
10 url="http://0pointer.de/lennart/projects/ifplugd"
11 install=ifplugd.install
13 depends=('libdaemon' 'bash')
14 backup=('etc/ifplugd/ifplugd.conf')
15 options=('!makeflags' '!emptydirs')
16 source=($url/${pkgname}-${pkgver}.tar.gz
17 ifplugd-0.28-interface.patch
18 ifplugd-fix-return-value.patch
21 md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3'
22 '54eb22844b5aeed161c0b80aa9008570'
23 'f26dbd7597d9d637f0b2b104b11ab820'
24 'f2e8a37af52b79ee0e3c5bcc2470ce10'
25 '3dc2ce45d0e12d155ecc7a5bc9e3ee04')
28 cd ${pkgname}-${pkgver}
29 patch -p0 -i ../ifplugd-0.28-interface.patch
30 patch -p1 -i ../ifplugd-fix-return-value.patch
31 sed 's|/var/run|/run|' -i src/ifplugd.c
35 cd ${pkgname}-${pkgver}
36 CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
37 ./configure --prefix=/usr --sbindir=/usr/bin --mandir=/usr/share/man --sysconfdir=/etc \
38 --with-initdir=/etc/rc.d --disable-xmltoman --disable-subversion --disable-lynx
43 cd ${pkgname}-${pkgver}
44 make DESTDIR="${pkgdir}" install
46 install -D -m755 "${srcdir}"/ifplugd-daemon "${pkgdir}"/usr/bin/ifplugd-daemon
47 # remove the default init script and action script
48 rm -f "${pkgdir}"/etc/{ifplugd/ifplugd.action,rc.d/ifplugd}
49 # install systemd unit
50 install -D -m644 "${srcdir}"/ifplugd.systemd "${pkgdir}"/usr/lib/systemd/system/ifplugd@.service