opensnitch-1.4.2.ebuild

This commit is contained in:
Anton Bolshakov 2021-11-12 11:03:40 +08:00
parent 6e4586dc90
commit 4187796d5a
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
2 changed files with 100 additions and 0 deletions

View file

@ -1,6 +1,7 @@
DIST github.com-evilsocket-ftrace-v1.2.0.tar.gz 16895 BLAKE2B e17f90820eb6c2a5691477a1616753407f27ba509262ea57fffcf269f3e5e9ab8e87d86830796ef9cffeed78d36b4868a23746054cf26d82e0146a2462e8249d SHA512 e7787485a97ca0c1dc31dde2973d795439015d412a0588c813f601dc7eaf80912016675a2674748c4c3f49b50ec11a59274eeccf0fe4052e7249159d29a58909
DIST github.com-fsnotify-fsnotify-v1.4.7.tar.gz 31139 BLAKE2B f2d0aaabfad525fb640beba78991a858ad23203a557a69fc15d2f017b2a693c64c244de435682b1cd9d59e89a97e4ba60c7f95fa99a6145a9dea73b0f334936e SHA512 840943043c49c837641f04b976f2ba610fc03bd31030ca6442744d51fa9241da1905730ea11466e249a5bd37437f1e2a433a012a64ce872a1562c941bd5bfcbf
DIST github.com-golang-glog-23def4e6c14b.tar.gz 19688 BLAKE2B f9ff73060c3b10603472c3ea4f50b4afa6abb5a4e9e7ac43d2a6c2e62541d43ef9f0ef7a8759d9b3281d72e5f90c516ee174c91de9a640a5bdf6877700450d44 SHA512 e9e70cf2a2d74ca813d0cadc23d213a1112ca4d1167abb63d8e0929585fca90c3a5bab1f49db20095c48bf1fe03b4424353c33728d09a201334eb65770888dc5
DIST github.com-golang-net-d8887717615a.tar.gz 974554 BLAKE2B b2bbc83dd2f286f9779d49df7bc3824421b2be83453c025a27f7ec71f013da85e9976c7e593cf3bea06556d81b8806e81e9b06a656436163ef10c6fd809bf3fa SHA512 98373cd861ddee5bc97c1255cc9c97c54b33205bdad9bbd9ef702a2f45fd99e375574c62c20d1813415485d3a212ddbd21bc4d17a9dfe71e066d4eb079ad4d7f
DIST github.com-golang-net-fe3aa8a45271.tar.gz 1103753 BLAKE2B f6275e938bb46dad65d065d838c9ea7c9d9feb1370527cb82f166db4fc085a3d88dcaa6ff1ed3650b978ce094493265a971a2cb2d1b05e8e81d8b66993b3f474 SHA512 99c5b7b08181ea29dd22975e58d5b49a1493ce3180a92f78e9763dc5af60905da0ee94e5b31c3f65b8c6b0295894f3ae3208509d50cdb212478bf716e3c9b692
DIST github.com-golang-protobuf-v1.5.0.tar.gz 171512 BLAKE2B 49fa31ff98d923b0b1db8eb29008b3cbe634e2ab0b106deac1f0ffb69e7762a10e2cabf77e45e4f68a6dfc20f22631480c532b7b137e75ba607d64aa9c79e023 SHA512 1b2316f08bec4651dc196d487b1aebfdf875baa33a5256aad8ea21ee726cdf0835822a58920c5b1af501acbf0e5039e20d621a8247320727f4b1832eb2189110
DIST github.com-golang-sync-6e8e738ad208.tar.gz 17297 BLAKE2B 35c59fe3aa3d01871c451ff571af33f0b58d88c69a6096edad90c0379cc7d3de8e4b4b6ba3a203b62478595a8f1e2f514613d68f3d24030852ffabc407ef5e96 SHA512 c045e44279eb4eea9f9721c524c59d9556f2593a29004874d280dd96bc3d510b9b3f3ab87032a60782cff62f9db8d6d4bc2c50b084b9b4eeec20f6fee35a966d
@ -20,3 +21,4 @@ DIST github.com-vishvananda-netlink-v1.1.0.tar.gz 147026 BLAKE2B 146936d2a959f1a
DIST github.com-vishvananda-netns-0a2b9b5464df.tar.gz 8008 BLAKE2B ce175a1ffce3ab0a62fccc56836e39c4c90d0df28fb60ca3317a4814fea26f1817e0be8cd424c127ff1060b4a7e28907a9cd65dbd85dbf28a5fe8b010e53368e SHA512 187e10380398f7243624b9725e6166be392bc048b74bdfc3d3c61fcb397b28a16d83f5111fceab6cb79e1045075cba00a48ca15bb5c73127ef26c0f50a05f053
DIST opensnitch-1.4.0.tar.gz 999069 BLAKE2B cce63863957e01cedb4e202412e0806f21f39a8c22fca3cda5ef21a97a024a56cee88ae0b9e517277d0d4fae56e122600fa7fb1be860e6803c172feb68dba666 SHA512 35d9811f9b8c3dc073231dfe20c21151280fdb90a0bc355617b5a2f2109e7f9590579f73ceed944447004bc0e8609c78c90bb0b21b95bb339cf4acbb8aca0fa7
DIST opensnitch-1.4.1.tar.gz 999330 BLAKE2B f04866a41306f92539a6763bd03994d8a0fa414276a9ad529b09098451e1fd295f8093246a5782add25540380c1d4bdb950a216ec5faef7d024400812638d2df SHA512 58bc7eecdf129d219f2b4f16fccfd4788af02480f89e4042577a032114ddba176bc53ca299e60057ddd45b946de3cd89a5d21e3dad120aeedff0f62ce2b278a5
DIST opensnitch-1.4.2.tar.gz 999494 BLAKE2B 986612523de0e852fdf2fce109fdb3119fe54d79e46327a4d6ec0ea313adbc8cb13aca0903ed81bd25700d69a96f171eb4ece5a4303476ced4fa5c1af12a6f95 SHA512 e2bdbe479ed1e52f6d036a21f0f6efa37cce88baff7998911e6274bc318ad5260f2b428b94d0c19fad6f4e388fb8332e6639a93d34ab1ef66f51bfe4f836996b

View file

@ -0,0 +1,98 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8..9} )
inherit distutils-r1
# copy from daemon/go.mod
# old: go mod vendor && grep "# g" ./vendor/modules.txt | sort
EGO_PN="github.com/evilsocket/opensnitch"
EGO_VENDOR=(
"github.com/evilsocket/ftrace v1.2.0"
"github.com/fsnotify/fsnotify v1.4.7"
"github.com/golang/glog 23def4e6c14b"
"github.com/golang/protobuf v1.5.0"
"github.com/google/gopacket v1.1.14"
"github.com/google/nftables a285acebcad3"
"github.com/iovisor/gobpf v0.2.0"
"github.com/vishvananda/netlink v1.1.0"
"github.com/vishvananda/netns 0a2b9b5464df"
"golang.org/x/net d8887717615a github.com/golang/net"
"golang.org/x/sync 6e8e738ad208 github.com/golang/sync"
"golang.org/x/sys 7fc4e5ec1444 github.com/golang/sys"
"golang.org/x/text v0.3.0 github.com/golang/text"
"google.golang.org/grpc v1.27.0 github.com/grpc/grpc-go"
"google.golang.org/protobuf v1.26.0 github.com/protocolbuffers/protobuf-go"
"google.golang.org/genproto 7fd901a49ba6 github.com/googleapis/go-genproto"
"github.com/koneu/natend ec0926ea948d1549773caebd030b217dc31ba55c"
"github.com/mdlayher/netlink v1.4.1"
"github.com/josharian/native b6b71def0850a2fbd7e6875f8e28217a48c5bcb4"
"github.com/mdlayher/socket 9dbe287ded84b2af7d29eedef2693df69e11ce74"
)
inherit golang-vcs-snapshot
DESCRIPTION="Desktop application firewall"
HOMEPAGE="https://github.com/evilsocket/opensnitch"
SRC_URI="https://github.com/evilsocket/opensnitch/archive/v${PV}.tar.gz -> ${P}.tar.gz
${EGO_VENDOR_URI}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="mirror"
# dev-go/go-text:=
DEPEND=">=dev-lang/go-1.13
net-libs/libnetfilter_queue
dev-go/go-protobuf
"
RDEPEND="
dev-python/grpcio-tools[${PYTHON_USEDEP}]
dev-python/python-slugify[${PYTHON_USEDEP}]
dev-python/pyinotify[${PYTHON_USEDEP}]
dev-python/PyQt5[sql,${PYTHON_USEDEP}]
"
#FIXME: add config check:
#CONFIG_NETFILTER_XT_MATCH_CONNTRACK
src_prepare() {
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*
eapply_user
}
src_compile() {
GOPATH="${S}:$(get_golibdir_gopath)" \
GOCACHE="${T}/go-cache" \
go build -v -work -x -ldflags="-s -w" "${EGO_PN}/daemon" || die
pushd src/${EGO_PN}/ui >/dev/null || die
distutils-r1_src_compile
popd >/dev/null || die
}
src_install(){
newbin daemon opensnitchd
pushd src/${EGO_PN}/ui >/dev/null || die
distutils-r1_src_install
popd >/dev/null || die
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}
}