Github messages for voidlinux
 help / color / mirror / Atom feed
From: cinerea0 <cinerea0@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: opensnitch-1.5.1
Date: Sat, 04 Jun 2022 05:11:56 +0200	[thread overview]
Message-ID: <20220604031156.-8SaMVGmX_pIXwrSWPSMpEyu25qyBFh7BEnL3jHAYoE@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-32730@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

There is an updated pull request by cinerea0 against master on the void-packages repository

https://github.com/cinerea0/void-packages snitch
https://github.com/void-linux/void-packages/pull/32730

New package: opensnitch-1.5.1
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->
---
Closes #28819. Picks up where #29849 left off before being closed by the author.

A patch file from https://github.com/void-linux/void-packages/pull/32730.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-snitch-32730.patch --]
[-- Type: text/x-diff, Size: 12194 bytes --]

From 898b5b83ef807411420b29f53f9a850a0e0d512b Mon Sep 17 00:00:00 2001
From: cinerea0 <cinerea0@disroot.org>
Date: Fri, 3 Jun 2022 22:37:04 -0400
Subject: [PATCH 1/5] New package: protobuf-go-1.28.0

---
 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..2260246de16a
--- /dev/null
+++ b/srcpkgs/protobuf-go/template
@@ -0,0 +1,17 @@
+# Template file for 'protobuf-go'
+pkgname=protobuf-go
+version=1.28.0
+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 <cinerea0@protonmail.com>"
+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=e59ae9ace31c3a84bddf1bc3f04a04c498adb9ea7f9fcde60db91bba33d55171
+
+post_install() {
+	vlicense LICENSE
+}

From 7671b2920a25348ec83dc95756ed0e9a9e62118d Mon Sep 17 00:00:00 2001
From: cinerea0 <cinerea0@disroot.org>
Date: Fri, 3 Jun 2022 23:10:11 -0400
Subject: [PATCH 2/5] New package: protoc-gen-go-grpc-1.2.0

---
 srcpkgs/protoc-gen-go-grpc/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/protoc-gen-go-grpc/template

diff --git a/srcpkgs/protoc-gen-go-grpc/template b/srcpkgs/protoc-gen-go-grpc/template
new file mode 100644
index 000000000000..4caeae146e1f
--- /dev/null
+++ b/srcpkgs/protoc-gen-go-grpc/template
@@ -0,0 +1,14 @@
+# Template file for 'protoc-gen-go-grpc'
+pkgname=protoc-gen-go-grpc
+version=1.2.0
+revision=1
+wrksrc="grpc-go-cmd-${pkgname}-v${version}"
+build_wrksrc="cmd/protoc-gen-go-grpc"
+build_style=go
+go_import_path="google.golang.org/grpc/cmd/protoc-gen-go-grpc"
+short_desc="Generates Go language bindings of protobuf services for gRPC"
+maintainer="cinerea0 <cinerea0@protonmail.com>"
+license="Apache-2.0"
+homepage="https://github.com/grpc/grpc-go/tree/master/cmd/protoc-gen-go-grpc"
+distfiles="https://github.com/grpc/grpc-go/archive/refs/tags/cmd/protoc-gen-go-grpc/v${version}.tar.gz"
+checksum=cbca93d6dce724248dfdea6303bf27ed24cc3ed9cf8f7485eb825682eab21284

From 71dd874bd39093b880ee3b20618f372ebb69997a Mon Sep 17 00:00:00 2001
From: cinerea0 <cinerea0@disroot.org>
Date: Fri, 3 Jun 2022 23:10:42 -0400
Subject: [PATCH 3/5] New package: python3-unicode-slugify-0.1.5

---
 srcpkgs/python3-unicode-slugify/template | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/python3-unicode-slugify/template

diff --git a/srcpkgs/python3-unicode-slugify/template b/srcpkgs/python3-unicode-slugify/template
new file mode 100644
index 000000000000..e1c296b04b8d
--- /dev/null
+++ b/srcpkgs/python3-unicode-slugify/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-unicode-slugify'
+pkgname=python3-unicode-slugify
+version=0.1.5
+revision=1
+wrksrc="unicode-slugify-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+short_desc="Slugifier that generates unicode slugs"
+maintainer="cinerea0 <cinerea0@protonmail.com>"
+license="BSD-3-Clause"
+homepage="https://pypi.org/project/unicode-slugify/"
+distfiles="${PYPI_SITE}/u/unicode-slugify/unicode-slugify-${version}.tar.gz"
+checksum=25f424258317e4cb41093e2953374b3af1f23097297664731cdb3ae46f6bd6c3
+make_check=no  # checks were not ported from python2
+
+post_install() {
+	vlicense LICENSE
+}

From a4b233a3f0cb6431f0f1bced7629ef40bfc11615 Mon Sep 17 00:00:00 2001
From: cinerea0 <cinerea0@disroot.org>
Date: Fri, 3 Jun 2022 23:11:08 -0400
Subject: [PATCH 4/5] New package: python3-qt-material-2.12

---
 srcpkgs/python3-qt-material/template | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/python3-qt-material/template

diff --git a/srcpkgs/python3-qt-material/template b/srcpkgs/python3-qt-material/template
new file mode 100644
index 000000000000..115ffa065469
--- /dev/null
+++ b/srcpkgs/python3-qt-material/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-qt-material'
+pkgname=python3-qt-material
+version=2.12
+revision=1
+wrksrc="qt-material-${version}"
+build_style=python3-module
+hostmakedepends="python3-Jinja2 python3-setuptools"
+depends="python3-Jinja2 python3-MarkupSafe"
+short_desc="Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6"
+maintainer="cinerea0 <cinerea0@protonmail.com>"
+license="BSD-2-Clause"
+homepage="https://pypi.org/project/qt-material/"
+distfiles="${PYPI_SITE}/q/qt-material/qt-material-${version}.tar.gz"
+checksum=4ead6710b4fa64f94963bf359422e077a032a84ec8c350804ff743d1be7f4657
+
+post_install() {
+	vlicense LICENSE
+}

From 08740ea9241e102a67799f54226744784a61b866 Mon Sep 17 00:00:00 2001
From: cinerea0 <cinerea0@disroot.org>
Date: Fri, 3 Jun 2022 23:11:38 -0400
Subject: [PATCH 5/5] New package: opensnitch-1.5.1

---
 srcpkgs/opensnitch/files/opensnitchd/run      |  4 ++
 srcpkgs/opensnitch/patches/cc-check.patch     | 14 ++++
 srcpkgs/opensnitch/patches/musl.patch         | 65 +++++++++++++++++++
 .../patches/update-requirements.patch         | 12 ++++
 srcpkgs/opensnitch/template                   | 35 ++++++++++
 5 files changed, 130 insertions(+)
 create mode 100644 srcpkgs/opensnitch/files/opensnitchd/run
 create mode 100644 srcpkgs/opensnitch/patches/cc-check.patch
 create mode 100644 srcpkgs/opensnitch/patches/musl.patch
 create mode 100644 srcpkgs/opensnitch/patches/update-requirements.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..17d202f1da0f
--- /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..0c3f52b47ef2
--- /dev/null
+++ b/srcpkgs/opensnitch/patches/cc-check.patch
@@ -0,0 +1,14 @@
+# Adjustment for our cross-cc wrapper
+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/musl.patch b/srcpkgs/opensnitch/patches/musl.patch
new file mode 100644
index 000000000000..039d00db7529
--- /dev/null
+++ b/srcpkgs/opensnitch/patches/musl.patch
@@ -0,0 +1,65 @@
+diff --git a/daemon/netfilter/queue.h.old b/daemon/netfilter/queue.h
+index 64c3ea7..998278a 100644
+--- a/daemon/netfilter/queue.h.old
++++ b/daemon/netfilter/queue.h
+@@ -15,16 +15,16 @@
+ #include <libnetfilter_queue/libnetfilter_queue.h>
+ 
+ typedef struct {
+-    uint verdict;
+-    uint mark;
+-    uint mark_set;
+-    uint length;
++    unsigned int verdict;
++    unsigned int mark;
++    unsigned int mark_set;
++    unsigned int length;
+     unsigned char *data;
+ } verdictContainer;
+ 
+ static void *get_uid = NULL;
+ 
+-extern void go_callback(int id, unsigned char* data, int len, uint mark, u_int32_t idx, verdictContainer *vc, uint32_t uid);
++extern void go_callback(int id, unsigned char* data, int len, unsigned int mark, uint32_t idx, verdictContainer *vc, uint32_t uid);
+ 
+ static uint8_t stop = 0;
+ 
+@@ -80,7 +80,7 @@ static int nf_callback(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct n
+     return nfq_set_verdict2(qh, id, vc.verdict, vc.mark, vc.length, vc.data);
+ }
+ 
+-static inline struct nfq_q_handle* CreateQueue(struct nfq_handle *h, u_int16_t queue, u_int32_t idx) {
++static inline struct nfq_q_handle* CreateQueue(struct nfq_handle *h, uint16_t queue, uint32_t idx) {
+     struct nfq_q_handle* qh = nfq_create_queue(h, queue, &nf_callback, (void*)((uintptr_t)idx));
+     if (qh == NULL){
+         printf("ERROR: nfq_create_queue() queue not created\n");
+diff --git a/daemon/netfilter/queue.go.old b/daemon/netfilter/queue.go
+index 902d1dd..016ee92 100644
+--- a/daemon/netfilter/queue.go.old
++++ b/daemon/netfilter/queue.go
+@@ -92,7 +92,7 @@ func (q *Queue) create(queueID uint16) (err error) {
+ 		return fmt.Errorf("Error binding to AF_INET protocol family: %v", err)
+ 	} else if ret, err := C.nfq_bind_pf(q.h, AF_INET6); err != nil || ret < 0 {
+ 		return fmt.Errorf("Error binding to AF_INET6 protocol family: %v", err)
+-	} else if q.qh, err = C.CreateQueue(q.h, C.u_int16_t(queueID), C.u_int32_t(q.idx)); err != nil || q.qh == nil {
++	} else if q.qh, err = C.CreateQueue(q.h, C.uint16_t(queueID), C.uint32_t(q.idx)); err != nil || q.qh == nil {
+ 		q.destroy()
+ 		return fmt.Errorf("Error binding to queue: %v", err)
+ 	}
+@@ -107,14 +107,14 @@ func (q *Queue) create(queueID uint16) (err error) {
+ func (q *Queue) setup() (err error) {
+ 	var ret C.int
+ 
+-	queueSize := C.u_int32_t(NF_DEFAULT_QUEUE_SIZE)
++	queueSize := C.uint32_t(NF_DEFAULT_QUEUE_SIZE)
+ 	bufferSize := C.uint(NF_DEFAULT_PACKET_SIZE)
+ 	totSize := C.uint(NF_DEFAULT_QUEUE_SIZE * NF_DEFAULT_PACKET_SIZE)
+ 
+ 	if ret, err = C.nfq_set_queue_maxlen(q.qh, queueSize); err != nil || ret < 0 {
+ 		q.destroy()
+ 		return fmt.Errorf("Unable to set max packets in queue: %v", err)
+-	} else if C.nfq_set_mode(q.qh, C.u_int8_t(2), bufferSize) < 0 {
++	} else if C.nfq_set_mode(q.qh, C.uint8_t(2), bufferSize) < 0 {
+ 		q.destroy()
+ 		return fmt.Errorf("Unable to set packets copy mode: %v", err)
+ 	} else if q.fd, err = C.nfq_fd(q.h); err != nil {
diff --git a/srcpkgs/opensnitch/patches/update-requirements.patch b/srcpkgs/opensnitch/patches/update-requirements.patch
new file mode 100644
index 000000000000..b276df389203
--- /dev/null
+++ b/srcpkgs/opensnitch/patches/update-requirements.patch
@@ -0,0 +1,12 @@
+# update version to match our package
+diff --git a/ui/requirements.txt b/ui/requirements.txt
+index f29cc1b4ef..66e0de13b2 100644
+--- a/ui/requirements.txt
++++ b/ui/requirements.txt
+@@ -1,5 +1,5 @@
+ grpcio-tools>=1.10.1
+ pyinotify==0.9.6
+-unicode_slugify==0.1.3
++unicode_slugify==0.1.5
+ pyqt5>=5.6
+ protobuf
diff --git a/srcpkgs/opensnitch/template b/srcpkgs/opensnitch/template
new file mode 100644
index 000000000000..85adc42bf11a
--- /dev/null
+++ b/srcpkgs/opensnitch/template
@@ -0,0 +1,35 @@
+# Template file for 'opensnitch'
+pkgname=opensnitch
+version=1.5.1
+revision=1
+build_style=gnu-makefile
+hostmakedepends="git go pkg-config protobuf protobuf-go protoc-gen-go-grpc
+ qt5-host-tools python3-grpcio-tools python3-pip python3-PyQt5-devel-tools
+ python3-setuptools"
+makedepends="libnetfilter_queue-devel libpcap-devel python3-inotify
+ python3-unicode-slugify python3-Unidecode"
+depends="python3-googleapis-common-protos python3-grpcio python3-inotify
+ python3-notify2 python3-pyasn1 python3-PyQt5 python3-PyQt5-sql
+ python3-qt-material python3-unicode-slugify python3-Unidecode 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 <cinerea0@protonmail.com>"
+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=f0e1aa0d6c52ac11d32c8f778479c2d1cecbb733d784e88bf4ecd19580930d4f
+nopie_files="/usr/bin/opensnitchd"
+nocross="Go's 'sys' package uses a -m64 compilation flag which breaks certain ARM builds"
+
+do_install() {
+	vbin daemon/opensnitchd
+	vinstall daemon/default-config.json 0644 etc/opensnitchd
+	vinstall daemon/system-fw.json 0644 etc/opensnitchd
+	cd ui
+	python3 setup.py install --prefix=/usr --root=${DESTDIR}
+	vsv opensnitchd
+}

  parent reply	other threads:[~2022-06-04  3:11 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28  5:25 [PR PATCH] New package: opensnitch-1.3.6 cinerea0
2021-09-12 12:23 ` apirusKde
2021-09-13  3:57 ` [PR PATCH] [Updated] " cinerea0
2021-09-21 18:36 ` [PR PATCH] [Updated] New package: opensnitch-1.4.0 cinerea0
2021-09-21 18:40 ` cinerea0
2021-10-07 18:53 ` cinerea0
2021-10-07 19:01 ` [PR PATCH] [Updated] New package: opensnitch-1.4.1 cinerea0
2021-10-07 19:08 ` cinerea0
2021-10-08  5:23 ` cinerea0
2021-10-12  3:42 ` cinerea0
2021-10-12  3:49 ` cinerea0
2021-10-12  3:56 ` cinerea0
2021-10-12  4:12 ` cinerea0
2021-10-12  4:26 ` cinerea0
2021-10-12 16:07 ` cinerea0
2021-10-12 17:52 ` cinerea0
2021-10-13  0:09 ` cinerea0
2021-10-13  0:19 ` cinerea0
2021-10-13  0:52 ` ericonr
2021-10-13  3:09 ` [PR PATCH] [Updated] " cinerea0
2021-10-13  4:50 ` cinerea0
2021-10-27 14:12 ` [PR PATCH] [Updated] " cinerea0
2021-10-27 14:17 ` cinerea0
2021-11-05  2:56 ` cinerea0
2021-11-12  4:54 ` New package: opensnitch-1.4.2 cinerea0
2021-11-25  0:20 ` [PR PATCH] [Updated] " cinerea0
2022-02-05  2:25 ` [PR PATCH] [Updated] New package: opensnitch-1.4.3 cinerea0
2022-02-05  3:12 ` [PR PATCH] [Updated] New package: opensnitch-1.5.0 cinerea0
2022-02-06 22:59 ` [PR REVIEW] " ericonr
2022-02-06 22:59 ` ericonr
2022-02-06 22:59 ` ericonr
2022-02-07  1:30 ` cinerea0
2022-02-07  2:27 ` ericonr
2022-02-07  2:27 ` ericonr
2022-02-07  4:23 ` [PR PATCH] [Updated] " cinerea0
2022-02-07  4:42 ` cinerea0
2022-02-07  4:52 ` [PR REVIEW] " cinerea0
2022-02-20  2:30 ` cinerea0
2022-06-03  2:11 ` github-actions
2022-06-04  2:40 ` [PR PATCH] [Updated] " cinerea0
2022-06-04  2:56 ` [PR PATCH] [Updated] New package: opensnitch-1.5.1 cinerea0
2022-06-04  3:11 ` cinerea0 [this message]
2022-06-05 22:14 ` cinerea0
2022-09-04  2:16 ` github-actions
2022-09-05  3:02 ` cinerea0
2022-12-06  2:29 ` github-actions
2022-12-16  0:35 ` cinerea0
2023-03-16  1:57 ` github-actions
2023-06-16  1:59 ` github-actions
2023-06-29 14:24 ` [PR PATCH] [Updated] " cinerea0
2023-06-29 14:25 ` cinerea0
2023-09-29  1:45 ` New package: opensnitch-1.6.0 github-actions
2023-10-13  1:46 ` [PR PATCH] [Closed]: " github-actions
2024-01-26  2:41 ` jchook
2024-01-26  2:43 ` cinerea0

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220604031156.-8SaMVGmX_pIXwrSWPSMpEyu25qyBFh7BEnL3jHAYoE@z \
    --to=cinerea0@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).