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 sha256sums=('474754ac4ab32d738cbf2a4a3e87ee0a2c71b9048a38bdcd7df1e4f9fd6541f0'
22 '1bdbe17f26f467be2a5f300f20f2f8aa332ffa48cbe50bfc4bbff37de8f1bc67'
23 'cbe50f373a30de95a7520f8084f99dac3f13ff9e73184877ed1add8ddcc2399e'
24 'd69608997bb61d1deeec1525e9e7a018374875ad65ab39111c232210a43af47a'
25 'f41b7a66a478652fa91a523c11943259a6e4b48b984dd314aca6309776533e83')
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