diff --git a/anda/apps/opensnitch/anda.hcl b/anda/apps/opensnitch/anda.hcl new file mode 100644 index 0000000000..31ac55bb1c --- /dev/null +++ b/anda/apps/opensnitch/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "opensnitch.spec" + } +} diff --git a/anda/apps/opensnitch/opensnitch.spec b/anda/apps/opensnitch/opensnitch.spec new file mode 100644 index 0000000000..981612ce2b --- /dev/null +++ b/anda/apps/opensnitch/opensnitch.spec @@ -0,0 +1,119 @@ +# Generated by go2rpm 1.16.0 +%bcond check 1 +%bcond bootstrap 0 + +# https://github.com/evilsocket/opensnitch +%global goipath github.com/evilsocket/opensnitch +Version: 1.7.0.0 + +%gometa -f + +%global common_description %{expand: +OpenSnitch is a GNU/Linux interactive application firewall inspired by Little +Snitch.} + +%global golicenses LICENSE ui/LICENSE\\\ + ui/opensnitch/res/themes/dark/icons/LICENSE +%global godocs README.md ebpf_prog/README ui/requirements.txt\\\ + ui/i18n/README.md example example example\\\ + utils/packaging/daemon/deb/debian/changelog\\\ + utils/packaging/ui/deb/debian/changelog + +Name: opensnitch +Release: %autorelease +Summary: OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch + +License: GPL-3.0-only AND LGPL-2.1-or-later +URL: %{gourl} +Source: %{gosource} +BuildRequires: gcc-c++ +BuildRequires: python3-devel +BuildRequires: python-rpm-macros +BuildRequires: python3dist(pip) +BuildRequires: python3dist(setuptools) >= 61.0 +BuildRequires: python3dist(wheel) >= 0.37.1 +BuildRequires: python3dist(pyqt5) +BuildRequires: /usr/bin/lrelease-qt5 +BuildRequires: protobuf-compiler +BuildRequires: pkgconfig(libnetfilter_queue) +#BuildRequires: protoc-gen-go +#BuildRequires: /usr/bin/protoc-gen-go-grpc + +%description %{common_description} + +%gopkg + + +%prep +%goprep -A +%autopatch -p1 + +export GOBIN=$(go env GOPATH | sed -E 's/:.+$//')/bin +echo $GOBIN > %_builddir/gobin +go install github.com/golang/protobuf/protoc-gen-go@latest +go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.1 +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0 + +sed -i 's/@pip3 /@python3 -m pip /' ui/Makefile + +%build +pushd ui +%make_build deps +popd + +export GOBIN=$(cat %_builddir/gobin) +export PATH=$GOBIN:$PATH +pushd proto +%make_build +popd + +pushd ui +%make_build +%pyproject_wheel +popd + +%global gomodulesmode GO111MODULE=on +pushd daemon +%gobuild -o ../opensnitchd . +popd + + +%install +%gopkginstall +install -Dm755 opensnitchd -t %buildroot%_bindir + +pushd ui +%if 0%{?fedora} <= 41 +%py3_install +%else +%pyproject_install +%pyproject_save_files %name +%endif +popd + +rm -rf %buildroot%python3_sitelib/tests/ +cp -r %buildroot%python3_sitelib%_usr/ %buildroot%_usr/ --preserve=all --no-target-directory +rm -rf %buildroot%python3_sitelib%_usr + + +%if 0%{?fedora} <= 41 +%files +%{python3_sitelib}/%name/ +%{python3_sitelib}/%name-%{version}-py%{python3_version}.egg-info/ +%else +%files -f %{pyproject_files} +%endif +%license LICENSE +%doc README.md +%_bindir/opensnitch-ui +%_bindir/opensnitchd +%_datadir/applications/opensnitch_ui.desktop +%_iconsdir/hicolor/48x48/apps/opensnitch-ui.png +%_iconsdir/hicolor/64x64/apps/opensnitch-ui.png +%_iconsdir/hicolor/scalable/apps/opensnitch-ui.svg +%_datadir/kservices5/kcm_opensnitch.desktop +%_metainfodir/io.github.evilsocket.opensnitch.appdata.xml + +/usr/share/icons/hicolor/scalable/apps/opensnitch-ui.svg + +%gopkgfiles diff --git a/anda/apps/opensnitch/update.rhai b/anda/apps/opensnitch/update.rhai new file mode 100644 index 0000000000..e69de29bb2