mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-25 16:20:55 +02:00
app-admin/opensnitch: add use flag 'systemd' and check kernel config
Signed-off-by: Kai-Chun Ning <kaichun.ning@gmail.com>
This commit is contained in:
parent
53f32a9d8e
commit
bc52b88bbb
2 changed files with 29 additions and 7 deletions
13
app-admin/opensnitch/files/systemd.patch
Normal file
13
app-admin/opensnitch/files/systemd.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/daemon/opensnitchd.service b/daemon/opensnitchd.service
|
||||
index 014e79e..8a81d0e 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 -rules-path /etc/opensnitchd/rules
|
||||
+ExecStart=/usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules -ui-socket unix:///tmp/osui.sock -cpu-profile /tmp/cpu.profile -mem-profile /tmp/mem.profile
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..10} )
|
||||
inherit distutils-r1
|
||||
inherit distutils-r1 linux-info systemd
|
||||
|
||||
# copy from daemon/go.mod
|
||||
# old: go mod vendor && grep "# g" ./vendor/modules.txt | sort
|
||||
|
|
@ -42,6 +42,7 @@ SRC_URI="https://github.com/evilsocket/opensnitch/archive/refs/tags/v${PV}.tar.g
|
|||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
IUSE="systemd"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
# dev-go/go-text:=
|
||||
|
|
@ -56,16 +57,20 @@ RDEPEND="
|
|||
dev-python/pyinotify[${PYTHON_USEDEP}]
|
||||
dev-python/PyQt5[sql,${PYTHON_USEDEP}]
|
||||
"
|
||||
#FIXME: add config check:
|
||||
#CONFIG_NETFILTER_XT_MATCH_CONNTRACK
|
||||
|
||||
CONFIG_CHECK="NETFILTER_XT_MATCH_CONNTRACK"
|
||||
|
||||
pkg_pretend() {
|
||||
linux-info_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
rm -r src/${EGO_PN}/ui/tests
|
||||
|
||||
emake -C src/${EGO_PN} protocol
|
||||
cd src/${EGO_PN}/ui
|
||||
pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
|
||||
sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2*
|
||||
use systemd && cd "${WORKDIR}/${P}/src/${EGO_PN}" && eapply "${FILESDIR}/systemd.patch"
|
||||
eapply_user
|
||||
}
|
||||
|
||||
|
|
@ -89,11 +94,15 @@ src_install(){
|
|||
pushd src/${EGO_PN}/daemon >/dev/null || die
|
||||
insinto /etc/opensnitchd/rules
|
||||
insinto /etc/opensnitchd/
|
||||
# @cp opensnitchd.service /etc/systemd/system/
|
||||
doins default-config.json
|
||||
doins system-fw.json
|
||||
popd >/dev/null || die
|
||||
|
||||
newinitd "${FILESDIR}"/opensnitch.initd ${PN}
|
||||
|
||||
if use systemd; then
|
||||
pushd src/${EGO_PN}/daemon >/dev/null || die
|
||||
systemd_dounit opensnitchd.service
|
||||
popd >/dev/null || die
|
||||
else
|
||||
newinitd "${FILESDIR}"/opensnitch.initd ${PN}
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue