diff options
author | Chris. H | 2020-01-03 00:43:35 +0100 |
---|---|---|
committer | Chris. H | 2020-01-03 00:43:35 +0100 |
commit | 6931235d3ccbe916a3c6e851e5f25b08857f3bb7 (patch) | |
tree | 2198f031e8b18acd8571a0708afad82066cbb17c | |
parent | c8e994df7ecda2b95bcbb85e567358ef305d5f71 (diff) | |
download | aur-6931235d3ccbe916a3c6e851e5f25b08857f3bb7.tar.gz |
cleanup PKGBUILD; thanks to yochananmarqos
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | PKGBUILD | 98 | ||||
-rw-r--r-- | nosudo.patch | 51 |
3 files changed, 64 insertions, 116 deletions
@@ -1,30 +1,25 @@ pkgbase = opensnitch-git pkgdesc = A GNU/Linux port of the Little Snitch application firewall. - pkgver = 20181008.359_c10e7a3 - pkgrel = 3 - url = https://www.opensnitch.io + pkgver = r379.2b49871 + pkgrel = 1 + url = https://github.com/evilsocket/opensnitch arch = i686 arch = x86_64 - license = GPL + license = GPL3 makedepends = git - makedepends = go-pie makedepends = dep - makedepends = python-setuptools - makedepends = python-pip - depends = python-grpcio - depends = python-grpcio-tools + makedepends = go-pie + depends = libnetfilter_queue + depends = libpcap + depends = python-protobuf-compiler depends = python-pyinotify - depends = python-pyqt5 depends = python-unicode-slugify - depends = libpcap - depends = libnetfilter_queue - depends = desktop-file-utils + depends = python-pyqt5 + depends = python-libconfigparser provides = opensnitch - provides = opensnitch-ui - source = git://github.com/evilsocket/opensnitch.git - source = nosudo.patch - md5sums = SKIP - md5sums = eb5a6c83c3816220799e678e32572705 + conflicts = opensnitch + source = git+https://github.com/evilsocket/opensnitch.git + sha256sums = SKIP pkgname = opensnitch-git @@ -1,63 +1,67 @@ # Maintainer: lsf +# Contributor: Mark Wagie <mark.wagie@tutanota.com> # Contributor: Adam Hose <adis@blad.is> -pkgver=20181008.359_c10e7a3 -pkgrel=3 -_pkgname=opensnitch + pkgname=opensnitch-git +pkgver=r379.2b49871 +pkgrel=1 +pkgdesc="A GNU/Linux port of the Little Snitch application firewall." arch=('i686' 'x86_64') -license=('GPL') -url='https://www.opensnitch.io' -pkgdesc='A GNU/Linux port of the Little Snitch application firewall.' -makedepends=('git' 'go-pie' 'dep' - 'python-setuptools' 'python-pip') -depends=('python-grpcio' 'python-grpcio-tools' 'python-pyinotify' - 'python-pyqt5' 'python-unicode-slugify' - 'libpcap' 'libnetfilter_queue' - 'desktop-file-utils') -provides=('opensnitch' 'opensnitch-ui') - -source=("git://github.com/evilsocket/opensnitch.git" - 'nosudo.patch') - -md5sums=('SKIP' - 'eb5a6c83c3816220799e678e32572705') +url="https://github.com/evilsocket/opensnitch" +license=('GPL3') +makedepends=('git' 'dep' 'go-pie') +depends=('libnetfilter_queue' 'libpcap' 'python-protobuf-compiler' + 'python-pyinotify' 'python-unicode-slugify' 'python-pyqt5' + 'python-libconfigparser') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/evilsocket/opensnitch.git') +sha256sums=('SKIP') pkgver() { - cd "$srcdir/$_pkgname" - local date=$(git log -1 --format="%cd" --date=short | sed s/-//g) - local count=$(git rev-list --count HEAD) - local commit=$(git rev-parse --short HEAD) - echo "$date.${count}_$commit" + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } -build() { - cd "$srcdir/$_pkgname" +prepare() { + mkdir -p gopath/src/github.com/evilsocket + ln -rTsf "$srcdir/${pkgname%-git}" \ + "gopath/src/github.com/evilsocket/${pkgname%-git}" + export GOPATH="$srcdir"/gopath - if [ -L "$srcdir/$_pkgname" ]; then - rm "$srcdir/$_pkgname" -rf - mv "$srcdir/.go/src/$_pkgname/" "$srcdir/$_pkgname" - fi + cd "gopath/src/github.com/evilsocket/${pkgname%-git}/daemon" + dep ensure - rm -rf "$srcdir/.go/src" - mkdir -p "$srcdir/.go/src" - export GOPATH="$srcdir/.go" - mv "$srcdir/$_pkgname" "$srcdir/.go/src/" + cd "$srcdir/${pkgname%-git}" + sed -i 's|local/bin|bin|g' daemon/opensnitchd.service +} - cd "$srcdir/.go/src/$_pkgname/" - ln -sf "$srcdir/.go/src/$_pkgname/" "$srcdir/$_pkgname" +build() { + export GOPATH="$srcdir"/gopath - cd "$GOPATH/src/opensnitch/daemon" - dep ensure - cd "$GOPATH/src/opensnitch" - patch -Np1 -i "${srcdir}/nosudo.patch" + cd "gopath/src/github.com/evilsocket/${pkgname%-git}/daemon" + go build \ + -trimpath \ + -ldflags "-extldflags $LDFLAGS" \ + -o opensnitchd . + + cd "$srcdir/${pkgname%-git}/proto" make + + cd "$srcdir/${pkgname%-git}/ui" + python setup.py build + + # Skipping, too many syntax errors + # cd "$srcdir/${pkgname%-git}" + # python make_ads_rules.py } -package(){ - cd "$srcdir/.go/src/$_pkgname/" - mkdir -p "${pkgdir}"/usr/lib/systemd/system - mkdir -p "${pkgdir}"/usr/bin - make DESTDIR="$pkgdir/" install - cd ui - pip install --isolated --root="$pkgdir" --ignore-installed --no-deps . +package() { + cd "$srcdir/${pkgname%-git}" + install -Dm755 daemon/opensnitchd -t "$pkgdir/usr/bin" + + install -Dm644 daemon/opensnitchd.service -t "$pkgdir/usr/lib/systemd/system" + + cd "$srcdir/${pkgname%-git}/ui" + python setup.py install --root="$pkgdir/" --optimize=1 --skip-build } diff --git a/nosudo.patch b/nosudo.patch deleted file mode 100644 index 14ccabd69dc7..000000000000 --- a/nosudo.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/daemon/Makefile b/daemon/Makefile -index ece2090..2d364f8 100644 ---- a/daemon/Makefile -+++ b/daemon/Makefile -@@ -1,10 +1,9 @@ - all: opensnitchd - - install: -- @mkdir -p /etc/opensnitchd/rules -- @cp opensnitchd /usr/local/bin/ -- @cp opensnitchd.service /etc/systemd/system/ -- @systemctl daemon-reload -+ @mkdir -p $(DESTDIR)/etc/opensnitchd/rules -+ @cp opensnitchd $(DESTDIR)/usr/bin/ -+ @cp opensnitchd.service $(DESTDIR)/usr/lib/systemd/system/ - - deps: - @dep ensure -diff --git a/daemon/opensnitchd.service b/daemon/opensnitchd.service -index e504417..4dfa8fd 100644 ---- a/daemon/opensnitchd.service -+++ b/daemon/opensnitchd.service -@@ -8,7 +8,7 @@ After=network.target - Type=simple - PermissionsStartOnly=true - ExecStartPre=/bin/mkdir -p /etc/opensnitchd/rules --ExecStart=/usr/local/bin/opensnitchd -log-file /var/log/opensnitchd.log -rules-path /etc/opensnitchd/rules -ui-socket unix:///tmp/osui.sock -+ExecStart=/usr/bin/opensnitchd -log-file /var/log/opensnitchd.log -rules-path /etc/opensnitchd/rules -ui-socket unix:///tmp/osui.sock - Restart=always - RestartSec=30 - -diff --git a/ui/Makefile b/ui/Makefile -index 29c1d35..b7ef78b 100644 ---- a/ui/Makefile -+++ b/ui/Makefile -@@ -1,13 +1,13 @@ - all: opensnitch/resources_rc.py - - install: -- @pip3 install . -+ @echo 'nope' - - opensnitch/resources_rc.py: deps - @pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc - - deps: -- @sudo pip3 install -r requirements.txt -+ @echo 'nope' - - clean: - @rm -rf *.pyc |