diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 56 | ||||
-rw-r--r-- | birdwatcher4.service | 10 | ||||
-rw-r--r-- | birdwatcher6.service | 10 |
4 files changed, 94 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2c758f6dee3c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = birdwatcher + pkgdesc = An HTTP API server for the BIRD routing daemon + pkgver = r190.5b5b1e2 + pkgrel = 1 + url = https://github.com/ecix/birdwatcher + arch = x86_64 + arch = i686 + license = BSD + makedepends = go + options = !strip + options = !emptydirs + source = birdwatcher4.service + source = birdwatcher6.service + md5sums = 98c680d53e514274a309ee2d9e3a09b6 + md5sums = 5cafb43834c8212e421246e8cd8186c7 + +pkgname = birdwatcher + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a7be9ee3b361 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,56 @@ +# Maintainer: Zhaofeng Li <hello@zhaofeng.li> + +pkgname=birdwatcher +pkgver=r190.5b5b1e2 +pkgrel=1 +pkgdesc="An HTTP API server for the BIRD routing daemon" +arch=('x86_64' 'i686') +url="https://github.com/ecix/birdwatcher" +license=('BSD') +depends=() +makedepends=('go') +options=('!strip' '!emptydirs') +source=( + 'birdwatcher4.service' + 'birdwatcher6.service' +) +md5sums=('98c680d53e514274a309ee2d9e3a09b6' + '5cafb43834c8212e421246e8cd8186c7') +_gourl=github.com/ecix/birdwatcher + +pkgver() { + cd "go/src/${_gourl}" + + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + mkdir -p go + export GOPATH="${srcdir}/go" + + go get -d -x "${_gourl}" +} + +build() { + export GOPATH="${srcdir}/go" + export CGO_ENABLED=0 + + mkdir -p bin + cd bin + + go build \ + -ldflags="-w -s" \ + -gcflags="all=-trimpath=${GOPATH}/src" \ + -asmflags="all=-trimpath=${GOPATH}/src" \ + "${_gourl}" +} + +package() { + install -Dm755 "bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 "go/src/${_gourl}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 "go/src/${_gourl}/etc/ecix/birdwatcher.conf" "${pkgdir}/etc/birdwatcher.conf" + install -Dm644 "${srcdir}/birdwatcher4.service" "${pkgdir}/usr/lib/systemd/system/birdwatcher4.service" + install -Dm644 "${srcdir}/birdwatcher6.service" "${pkgdir}/usr/lib/systemd/system/birdwatcher6.service" +} + +# vim:set ts=2 sw=2 et: diff --git a/birdwatcher4.service b/birdwatcher4.service new file mode 100644 index 000000000000..b923e3525ef6 --- /dev/null +++ b/birdwatcher4.service @@ -0,0 +1,10 @@ +[Unit] +Description=BIRDwatcher IPv4 +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/birdwatcher -config /etc/birdwatcher.conf + +[Install] +WantedBy=multi-user.target diff --git a/birdwatcher6.service b/birdwatcher6.service new file mode 100644 index 000000000000..e34bb8dcd6e3 --- /dev/null +++ b/birdwatcher6.service @@ -0,0 +1,10 @@ +[Unit] +Description=BIRDwatcher IPv6 +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/birdwatcher -6 -config /etc/birdwatcher.conf + +[Install] +WantedBy=multi-user.target |