summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c06259b6caf9ce4f519293c7c4bceb486035bb0f (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
pkgname=netplug
pkgver=1.2.9.2
pkgrel=3
pkgdesc="A Linux daemon that manages network interfaces in response to network cables being plugged in and out"
arch=('i686' 'x86_64')
url="http://www.red-bean.com/~bos/"
license=('GPL2')
depends=('iproute2>=2.4.7')
backup=("etc/$pkgname.d/${pkgname}d.conf"
        "etc/$pkgname.d/$pkgname")
source=("$url$pkgname/$pkgname-$pkgver.tar.bz2"
        "http://pkgs.fedoraproject.org/cgit/$pkgname.git/plain/${pkgname}d.service"
        "http://pkgs.fedoraproject.org/cgit/$pkgname.git/plain/$pkgname-$pkgver-man.patch")
md5sums=('1d6db99536bdf875ce441f2c0e45ebf2'
         '4482ef8c71bfb0b0335e9426d2852056'
         '7c44d211426ef68af4b4896b2b870882')

prepare() {
	cd "$pkgname-$pkgver"
	patch -p1 < "$srcdir/$pkgname-$pkgver-man.patch"

	# Place all configuration files in the same directory (/etc/netplug.d)
	sed -e "/^etcdir ?=/ s|/etc/$pkgname|/etc/$pkgname.d|" \
	    -i Makefile
}

build() {
	cd "$pkgname-$pkgver"
	make
}

package() {
	cd "$pkgname-$pkgver"
	make DESTDIR="$pkgdir/" bindir=/usr/bin install

	# Replace default sysvinit script with a systemd unit
	rm -r "$pkgdir/"etc/rc.d
	install -D -m644 {"$srcdir","$pkgdir/"usr/lib/systemd/system}/${pkgname}d.service
}

# vim: set ft=sh ts=4 sw=4 noet: