summaryrefslogtreecommitdiff
path: root/extra/ifplugd/PKGBUILD
blob: 91c354179487e449d749da6ed2eb5474276b1c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# $Id: PKGBUILD 165791 2012-08-30 09:38:27Z thomas $
# Contributor: Manolis Tzanidakis
# Contributor: kevin <kevin@archlinux.org>
# Maintainer: 

pkgname=ifplugd
pkgver=0.28
pkgrel=13
pkgdesc="A daemon which brings up/down network interfaces upon cable insertion/removal."
arch=('i686' 'x86_64')
url="http://0pointer.de/lennart/projects/ifplugd"
install=ifplugd.install
license=('GPL2')
depends=('libdaemon' 'bash')
backup=('etc/ifplugd/ifplugd.conf')
options=('!makeflags')
source=($url/${pkgname}-${pkgver}.tar.gz
        ifplugd-0.28-interface.patch
        ifplugd-fix-return-value.patch
        ifplugd
        ifplugd-daemon
        ifplugd.systemd)
md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3'
         '54eb22844b5aeed161c0b80aa9008570'
         'f26dbd7597d9d637f0b2b104b11ab820'
         '1ea9aa64415a5a9e27b84634cd08a7f2'
         'f2e8a37af52b79ee0e3c5bcc2470ce10'
         '3dc2ce45d0e12d155ecc7a5bc9e3ee04')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p0 -i ${srcdir}/ifplugd-0.28-interface.patch
  patch -p1 -i ${srcdir}/ifplugd-fix-return-value.patch
  sed 's|/var/run|/run|' -i src/ifplugd.c
  ./configure --prefix=/usr --sbindir=/usr/bin --mandir=/usr/share/man --sysconfdir=/etc \
      --with-initdir=/etc/rc.d --disable-xmltoman --disable-subversion --disable-lynx
  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install

  # replace the default init script & action files with ours.
  install -D -m755 ${srcdir}/ifplugd ${pkgdir}/etc/rc.d/ifplugd
  install -D -m755 ${srcdir}/ifplugd-daemon ${pkgdir}/usr/bin/ifplugd-daemon
  # remove default action script
  rm -f ${pkgdir}/etc/ifplugd/ifplugd.action
  # install systemd unit
  install -D -m644 ${srcdir}/ifplugd.systemd ${pkgdir}/usr/lib/systemd/system/ifplugd@.service
}