From 5d250d633438ecd6a71e3d412ce1bfbef5e1535a Mon Sep 17 00:00:00 2001 From: cinerea0 Date: Tue, 21 Sep 2021 14:35:55 -0400 Subject: [PATCH 1/2] New package: protobuf-go-1.27.1 --- srcpkgs/protobuf-go/template | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 srcpkgs/protobuf-go/template diff --git a/srcpkgs/protobuf-go/template b/srcpkgs/protobuf-go/template new file mode 100644 index 000000000000..8f4bddbbae8d --- /dev/null +++ b/srcpkgs/protobuf-go/template @@ -0,0 +1,17 @@ +# Template file for 'protobuf-go' +pkgname=protobuf-go +version=1.27.1 +revision=1 +build_style=go +go_import_path="google.golang.org/protobuf" +go_package="${go_import_path}/cmd/protoc-gen-go" +short_desc="Go support for Google's protocol buffers" +maintainer="cinerea0 " +license="BSD-3-Clause" +homepage="https://github.com/protocolbuffers/protobuf-go" +distfiles="https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v${version}.tar.gz" +checksum=3ec41a8324431e72f85e0dc0c2c098cc14c3cb1ee8820996c8f46afca2d65609 + +post_install() { + vlicense LICENSE +} From ea101e0b616a7c5ff70bf3fe51386add3b9271bc Mon Sep 17 00:00:00 2001 From: cinerea0 Date: Tue, 21 Sep 2021 14:39:48 -0400 Subject: [PATCH 2/2] New package: opensnitch-1.4.0 --- srcpkgs/opensnitch/files/opensnitchd/run | 4 +++ srcpkgs/opensnitch/patches/cc-check.patch | 13 ++++++++++ srcpkgs/opensnitch/patches/go-sum.patch | 14 ++++++++++ srcpkgs/opensnitch/patches/musl-int.patch | 16 ++++++++++++ .../opensnitch/patches/protoc-gen-go.patch | 14 ++++++++++ srcpkgs/opensnitch/template | 26 +++++++++++++++++++ 6 files changed, 87 insertions(+) create mode 100644 srcpkgs/opensnitch/files/opensnitchd/run create mode 100644 srcpkgs/opensnitch/patches/cc-check.patch create mode 100644 srcpkgs/opensnitch/patches/go-sum.patch create mode 100644 srcpkgs/opensnitch/patches/musl-int.patch create mode 100644 srcpkgs/opensnitch/patches/protoc-gen-go.patch create mode 100644 srcpkgs/opensnitch/template diff --git a/srcpkgs/opensnitch/files/opensnitchd/run b/srcpkgs/opensnitch/files/opensnitchd/run new file mode 100644 index 000000000000..2c1855eef621 --- /dev/null +++ b/srcpkgs/opensnitch/files/opensnitchd/run @@ -0,0 +1,4 @@ +#!/bin/sh + +[ -r conf ] && . ./conf +exec opensnitchd ${OPTS:--rules-path /etc/opensnitchd/rules} diff --git a/srcpkgs/opensnitch/patches/cc-check.patch b/srcpkgs/opensnitch/patches/cc-check.patch new file mode 100644 index 000000000000..004f0861a7d9 --- /dev/null +++ b/srcpkgs/opensnitch/patches/cc-check.patch @@ -0,0 +1,13 @@ +diff --git a/daemon/netfilter/queue.go b/daemon/netfilter/queue.go +index 3797486baf..4ee09d68b5 100644 +--- a/daemon/netfilter/queue.go ++++ b/daemon/netfilter/queue.go +@@ -3,7 +3,7 @@ package netfilter + /* + #cgo pkg-config: libnetfilter_queue + #cgo CFLAGS: -Wall -I/usr/include +-#cgo LDFLAGS: -L/usr/lib64/ -ldl ++#cgo LDFLAGS: -L/usr/lib64 -ldl + + #include "queue.h" + */ diff --git a/srcpkgs/opensnitch/patches/go-sum.patch b/srcpkgs/opensnitch/patches/go-sum.patch new file mode 100644 index 000000000000..19537e68545a --- /dev/null +++ b/srcpkgs/opensnitch/patches/go-sum.patch @@ -0,0 +1,14 @@ +# Need to generate go.sum otherwise we get errors +# https://github.com/evilsocket/opensnitch/commit/35975bc76018dbf37a68283463ab9d74948b6892 +diff --git a/daemon/Makefile b/daemon/Makefile +index 1acfbb0d19..618e96d543 100644 +--- a/daemon/Makefile ++++ b/daemon/Makefile +@@ -12,6 +12,7 @@ install: + @systemctl daemon-reload + + opensnitchd: $(SRC) ++ @go get + @go build -o opensnitchd . + + clean: diff --git a/srcpkgs/opensnitch/patches/musl-int.patch b/srcpkgs/opensnitch/patches/musl-int.patch new file mode 100644 index 000000000000..99a23ff22674 --- /dev/null +++ b/srcpkgs/opensnitch/patches/musl-int.patch @@ -0,0 +1,16 @@ +diff --git a/daemon/netfilter/queue.h b/daemon/netfilter/queue.h +index 64c3ea7c0c..2ced3bb39e 100644 +--- a/daemon/netfilter/queue.h ++++ b/daemon/netfilter/queue.h +@@ -14,6 +14,11 @@ + #include + #include + ++typedef unsigned int uint; ++typedef uint8_t u_int8_t; ++typedef uint16_t u_int16_t; ++typedef uint32_t u_int32_t; ++ + typedef struct { + uint verdict; + uint mark; diff --git a/srcpkgs/opensnitch/patches/protoc-gen-go.patch b/srcpkgs/opensnitch/patches/protoc-gen-go.patch new file mode 100644 index 000000000000..a368a305fe95 --- /dev/null +++ b/srcpkgs/opensnitch/patches/protoc-gen-go.patch @@ -0,0 +1,14 @@ +# Allow building with newer protoc-gen-go +diff --git a/proto/Makefile b/proto/Makefile +index 2af601d599..c7429bbd96 100644 +--- a/proto/Makefile ++++ b/proto/Makefile +@@ -1,7 +1,7 @@ + all: ../daemon/ui/protocol/ui.pb.go ../ui/opensnitch/ui_pb2.py + + ../daemon/ui/protocol/ui.pb.go: ui.proto +- protoc -I. ui.proto --go_out=plugins=grpc:../daemon/ui/protocol/ --go_opt=paths=source_relative ++ protoc -I. ui.proto --go_out=paths=source_relative:../daemon/ui/protocol/ + + ../ui/opensnitch/ui_pb2.py: ui.proto + python3 -m grpc_tools.protoc -I. --python_out=../ui/opensnitch/ --grpc_python_out=../ui/opensnitch/ ui.proto diff --git a/srcpkgs/opensnitch/template b/srcpkgs/opensnitch/template new file mode 100644 index 000000000000..fe0c0076c856 --- /dev/null +++ b/srcpkgs/opensnitch/template @@ -0,0 +1,26 @@ +# Template file for 'opensnitch' +pkgname=opensnitch +version=1.4.0 +revision=1 +build_style=gnu-makefile +hostmakedepends="git go pkg-config protobuf protobuf-go + python3-PyQt5-devel-tools python3-setuptools" +makedepends="libnetfilter_queue-devel libpcap-devel python3-devel python3-grpcio-tools" +depends="python3-googleapis-common-protos python3-grpcio python3-slugify + python3-inotify python3-PyQt5 python3-PyQt5-sql qt5-wayland qt5-plugin-sqlite" +conf_files="/etc/opensnitchd/default-config.json + /etc/opensnitchd/system-fw.json" +make_dirs="/etc/opensnitchd/rules/ 0755 root root + /etc/opensnitchd/ 0755 root root" +short_desc="GNU/Linux port of the Little Snitch application firewall" +maintainer="cinerea0 " +license="GPL-3.0-only" +homepage="https://github.com/evilsocket/opensnitch" +distfiles="https://github.com/evilsocket/opensnitch/archive/refs/tags/v${version}.tar.gz" +checksum=bd8e4a15653de22121ce2a5013952c8becb2cb965448780ca53da7a453a74be1 + +post_install() { + vinstall "default-config.json" 644 "/etc/opensnitchd/" + vinstall "system-fw.json" 644 "/etc/opensnitchd/" + vsv opensnitchd +}