summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wagie2020-07-27 16:00:00 -0600
committerMark Wagie2020-07-27 16:00:00 -0600
commit76dfd82b53d8e21d625b05e44588f97833e931af (patch)
treeb4e85741a92be30155cc40806e165f6ac35325c4
parent3ea377f202940b5dd20ac6f8c81f96b8c69ba3a1 (diff)
downloadaur-76dfd82b53d8e21d625b05e44588f97833e931af.tar.gz
adjust for package guidelines, use Makefile
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD37
2 files changed, 18 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 11c5903c4ac8..ef57f48d8264 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = opensnitch-git
pkgdesc = A GNU/Linux application firewall
- pkgver = 1.0.0.r5.078df0f
+ pkgver = 1.0.0.r8.08245a0
pkgrel = 1
url = https://github.com/gustavo-iniguez-goya/opensnitch
install = opensnitch.install
diff --git a/PKGBUILD b/PKGBUILD
index efe74def9c25..04ec055dab2a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
# Contributor: Adam Hose <adis@blad.is>
pkgname=opensnitch-git
-pkgver=1.0.0.r5.078df0f
+pkgver=1.0.0.r8.08245a0
pkgrel=1
pkgdesc="A GNU/Linux application firewall"
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
@@ -15,7 +15,7 @@ depends=('libnetfilter_queue' 'libpcap' 'python-grpcio' 'python-protobuf'
optdepends=('logrotate: for logfile rotation support')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
-backup=('etc/opensnitchd/default-config.json')
+backup=("etc/${pkgname%-git}d/default-config.json")
install="${pkgname%-git}.install"
source=('git+https://github.com/gustavo-iniguez-goya/opensnitch.git')
sha256sums=('SKIP')
@@ -30,27 +30,24 @@ prepare() {
ln -rTsf "$srcdir/${pkgname%-git}" \
"gopath/src/github.com/gustavo-iniguez-goya/${pkgname%-git}"
- # Prevent creation of a `go` directory in one's home.
- # Sometimes this directory cannot be removed with even `rm -rf` unless
- # one becomes root or changes the write permissions.
export GOPATH="$srcdir/gopath"
go clean -modcache
cd "$srcdir/${pkgname%-git}"
- sed -i 's|local/bin|bin|g' daemon/opensnitchd.service
+ sed -i 's|local/bin|bin|g' "daemon/${pkgname%-git}d.service"
}
build() {
cd "gopath/src/github.com/gustavo-iniguez-goya/${pkgname%-git}/daemon"
- go build \
- -v \
- -trimpath \
- -buildmode=pie \
- -ldflags "-extldflags \"${LDFLAGS}\"" \
- -o opensnitchd .
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath"
+ make
- # Clean now to ensure makepkg --clean works
- go clean -modcache
+ # Clean mod cache for makepkg -C
+ go clean -modcache
cd "$srcdir/${pkgname%-git}/proto"
make
@@ -61,13 +58,13 @@ build() {
package() {
cd "$srcdir/${pkgname%-git}"
- install -Dm755 daemon/opensnitchd -t "$pkgdir/usr/bin"
- install -Dm644 daemon/opensnitchd.service -t \
+ install -Dm755 "daemon/${pkgname%-git}d" -t "$pkgdir/usr/bin"
+ install -Dm644 "daemon/${pkgname%-git}d.service" -t \
"$pkgdir/usr/lib/systemd/system"
- install -dm755 "$pkgdir/etc/opensnitchd/rules"
- install -Dm644 daemon/default-config.json -t "$pkgdir/etc/opensnitchd"
- install -Dm644 debian/opensnitch.logrotate \
- "$pkgdir/etc/logrotate.d/opensnitch"
+ install -dm755 "$pkgdir/etc/${pkgname%-git}d/rules"
+ install -Dm644 daemon/default-config.json -t "$pkgdir/etc/${pkgname%-git}d"
+ install -Dm644 "debian/${pkgname%-git}.logrotate" \
+ "$pkgdir/etc/logrotate.d/${pkgname%-git}"
cd "$srcdir/${pkgname%-git}/ui"
python setup.py install --root="$pkgdir/" --optimize=1 --skip-build