summaryrefslogtreecommitdiffstats
path: root/main/knock/APKBUILD
blob: 58a63654d5e267a1ae4c5c27dba02906c9676903 (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
52
53
# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=knock
pkgver=0.5
pkgrel=2
pkgdesc="A simple port-knocking daemon"
url="http://www.zeroflux.org/projects/knock"
arch="all"
license="GPL2+"
depends="iptables"
makedepends="libpcap-dev"
install=
subpackages="$pkgname-doc"
source="http://www.zeroflux.org/proj/knock/files/$pkgname-$pkgver.tar.gz
	knock.initd
	knock.confd
	path-max.patch"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
        local i
        cd "$_builddir"
        for i in $source; do
                case $i in
                *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
                esac
        done
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/knockd || return 1
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/knockd || return 1
}

md5sums="ca09d61458974cff90a700aba6120891  knock-0.5.tar.gz
5f05196d700c04287523d184226e2dc2  knock.initd
8067d3b8401a0b5d513c44d3ff436032  knock.confd
1b7efd25668793c9248e530fd804cb54  path-max.patch"