blob: c320fc1e793618fa3c3c89b4580d4cd5f081a707 (
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
54
55
56
57
58
59
60
61
|
# Maintainer: Chipster Julien <julien dot chipster @ archlinux dot fr>
pkgname=gonsupdate
url="https://github.com/Chipsterjulien/gonsupdate"
pkgver=0.1
pkgrel=1
pkgdesc="If necessary, update your ip for nsupdate"
arch=('any')
license=('WTFPL')
makedepends=(go)
options=('!strip')
source=($pkgname-$pkgver.tar.gz)
install=gonsupdate.install
_builddir="$pkgname-$pkgver"
build() {
GOPATH_exist=1
if [ -z $GOPATH ]; then
# path don't exit
GOPATH_exist=0
# create gopath directory
mkdir -p .gopath/{bin,src}
# export var
export GOPATH=~/.gopath
fi
# Getting some lib
go get github.com/op/go-logging
go get github.com/spf13/viper
cd "$_builddir"
go build || return 1
}
package() {
cd "$_builddir"
# gonsupdate.toml
install -Dm644 cfg/"$pkgname".toml \
"$pkgdir"/etc/$pkgname/gonsupdate_sample.toml || return 1
# Create log directory
install -dm755 "$pkgdir"/var/log/$pkgname || return 1
# Create ip directory
install -dm755 "$pkgdir"/var/lib/$pkgname || return 1
# gonsupdate.[timer|service]
install -Dm644 cfg/"$pkgname".timer \
"$pkgdir"/usr/lib/systemd/system/"$pkgname".timer || return 1
install -Dm644 cfg/"$pkgname".service \
"$pkgdir"/usr/lib/systemd/system/"$pkgname".service || return 1
# gonsupdate binary
install -m750 -o root -g root -D "$srcdir"/$pkgname-$pkgver/$pkgname-$pkgver \
"$pkgdir"/usr/bin/$pkgname || return 1
}
sha512sums=('b7b236d6299b91c3dae6ee440372dfd2661960aa0c06dd609468e87de2d1f01659e58e6716773ce436003635158a7950422d098b57223fde2f02d650f2158b79')
|