Github messages for voidlinux
 help / color / mirror / Atom feed
From: anubhavkini <anubhavkini@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] New package: opensnitch-1.3.6
Date: Wed, 12 May 2021 10:53:17 +0200	[thread overview]
Message-ID: <20210512085317.JoRqSj4N6okePCvcjy9x857KeDfTeeqRQ1st4DhweQY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29849@inbox.vuxu.org>

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

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

https://github.com/anubhavkini/void-packages opensnitch
https://github.com/void-linux/void-packages/pull/29849

[WIP] New package: opensnitch-1.3.6
<!-- 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
-->


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

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

From 7f19221f10aee4fdcc3db6e5dc23869e0855c3ea Mon Sep 17 00:00:00 2001
From: Anubhav Kini <anubhavkini@gmail.com>
Date: Wed, 12 May 2021 14:21:48 +0530
Subject: [PATCH] New package: opensnitch-1.3.6

---
 srcpkgs/opensnitch/files/opensnitchd/run  |  3 +
 srcpkgs/opensnitch/patches/cc-check.patch | 11 ++++
 srcpkgs/opensnitch/patches/musl-int.patch | 14 +++++
 srcpkgs/opensnitch/template               | 68 +++++++++++++++++++++++
 4 files changed, 96 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-int.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..d9aa34169f54
--- /dev/null
+++ b/srcpkgs/opensnitch/files/opensnitchd/run
@@ -0,0 +1,3 @@
+#!/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..470dd5ecffb4
--- /dev/null
+++ b/srcpkgs/opensnitch/patches/cc-check.patch
@@ -0,0 +1,11 @@
+--- daemon/netfilter/queue.go
++++ 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-int.patch b/srcpkgs/opensnitch/patches/musl-int.patch
new file mode 100644
index 000000000000..ce6af3c6e4c7
--- /dev/null
+++ b/srcpkgs/opensnitch/patches/musl-int.patch
@@ -0,0 +1,14 @@
+--- daemon/netfilter/queue.h
++++ daemon/netfilter/queue.h
+@@ -14,6 +14,11 @@
+ #include <linux/netfilter.h>
+ #include <libnetfilter_queue/libnetfilter_queue.h>
+ 
++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/template b/srcpkgs/opensnitch/template
new file mode 100644
index 000000000000..889c515e1b29
--- /dev/null
+++ b/srcpkgs/opensnitch/template
@@ -0,0 +1,68 @@
+# Template file for 'opensnitch'
+pkgname=opensnitch
+version=1.3.6
+revision=1
+build_wrksrc="daemon"
+build_style=go
+go_import_path="github.com/evilsocket/opensnitch/daemon"
+go_package="${go_import_path}"
+go_mod_mode="mod"
+hostmakedepends="pkg-config python3-setuptools"
+makedepends="libnetfilter_queue-devel python3-devel"
+depends="python3-grpcio-tools 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="Anubhav Kini <anubhavkini@gmail.com>"
+license="GPL-3.0-only"
+homepage="https://github.com/evilsocket/opensnitch"
+distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz"
+checksum=a02e49a5ed79db8f21788188f16a28684d5f54f583bb4d338e3386484ee1663a
+
+_py() {
+	cd ../ui
+	if [ -n "$CROSS_BUILD" ]; then
+		PYPREFIX="$XBPS_CROSS_BASE"
+		CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+		LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+		CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
+		LDSHARED="${CC} -shared $LDFLAGS"
+		for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+			f=${f##*/}
+			_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+		done
+		env CC="$CC" LDSHARED="$LDSHARED" \
+			PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
+			PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib} \
+			_PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME" \
+			LDFLAGS="$LDFLAGS" python3 setup.py \
+				${@:-install --prefix=/usr --root=${DESTDIR}} ${make_install_args}
+	else
+		python3 setup.py ${@:-install --prefix=/usr --root=${DESTDIR}} ${make_install_args}
+	fi
+}
+
+post_build() {
+	# build ui
+	_py build
+}
+
+do_install() {
+	# rename bin daemon to opensnitchd
+	for f in ${GOPATH}/bin/* ${GOPATH}/bin/**/*; do
+	    if [ -f "$f" ] && [ -x "$f" ]; then
+	        vbin "$f" opensnitchd
+	        break
+	    fi
+	done
+
+	vinstall "default-config.json" 644 "/etc/opensnitchd/"
+	vinstall "system-fw.json" 644 "/etc/opensnitchd/"
+	vsv opensnitchd
+
+	#install ui
+	_py
+}

  parent reply	other threads:[~2021-05-12  8:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 11:16 [PR PATCH] " itsanubhavkini
2021-03-29 12:19 ` FollieHiyuki
2021-03-29 12:24 ` ericonr
2021-03-29 12:24 ` ericonr
2021-03-29 12:24 ` ericonr
2021-03-29 13:48 ` [PR PATCH] [Updated] " itsanubhavkini
2021-03-29 13:50 ` Duncaen
2021-03-29 13:54 ` itsanubhavkini
2021-03-29 13:55 ` itsanubhavkini
2021-03-29 13:58 ` itsanubhavkini
2021-03-29 14:02 ` itsanubhavkini
2021-03-29 14:05 ` Duncaen
2021-03-29 14:07 ` itsanubhavkini
2021-03-29 14:24 ` ericonr
2021-03-29 14:34 ` Duncaen
2021-03-29 14:35 ` Duncaen
2021-04-01  5:45 ` [PR PATCH] [Updated] [WIP] " itsanubhavkini
2021-05-12  6:39 ` anubhavkini
2021-05-12  7:02 ` anubhavkini
2021-05-12  7:27 ` anubhavkini
2021-05-12  8:34 ` anubhavkini
2021-05-12  8:53 ` anubhavkini [this message]
2021-05-12  8:59 ` anubhavkini
2021-05-13  4:15 ` anubhavkini
2021-05-13  6:07 ` ericonr
2021-06-03  5:54 ` [PR PATCH] [Closed]: " anubhavkini

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=20210512085317.JoRqSj4N6okePCvcjy9x857KeDfTeeqRQ1st4DhweQY@z \
    --to=anubhavkini@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).