evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.92k stars 510 forks source link

Is there a way to build a .deb for this? #584

Closed jaggzh closed 2 years ago

jaggzh commented 2 years ago

Is there a way to build a debian package?

Building on linux, debian, stable, I'm using sudo checkinstall make install (to create a package by monitoring the installation). This requires the system python (sudo which pip shows /usr/bin/pip) -- sudo checkinstall make install is also then installing stuff in /usr/local/lib/python3.9 .. (okay, no prob, I guess)..

But it then begins erroring:

    creating /usr/local/lib/python3.9/dist-packages/opensnitch
    creating /usr/local/lib/python3.9/dist-packages/opensnitch/i18n
    creating /usr/local/lib/python3.9/dist-packages/opensnitch/i18n/ro_RO
    copying build/lib/opensnitch/i18n/ro_RO/opensnitch-ro_RO.qm -> /usr/local/lib/python3.9/dist-packages/opensnitch/i18n/ro_RO
    error: [Errno 2] No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-uo8qndcv/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-uo8qndcv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fjpmziix/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/opensnitch-ui Check the logs for full command output.
Traceback (most recent call last):
  File "/usr/bin/pip3", line 33, in <module>
    sys.exit(load_entry_point('pip==20.3.4', 'console_scripts', 'pip3')())

...

  File "/usr/lib/python3.9/shutil.py", line 675, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib/python3.9/shutil.py", line 673, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'addresstablemodel.py'
make[1]: *** [Makefile:4: install] Error 1
make[1]: Leaving directory '/home/jaggz/projects/src/opensnitch/ui'
jaggzh commented 2 years ago

Also:

  running install_scripts
  creating build/bdist.linux-x86_64/wheel/opensnitch_ui-1.5.0rc1.data/scripts
  copying build/scripts-3.9/opensnitch-ui -> build/bdist.linux-x86_64/wheel/opensnitch_ui-1.5.0rc1.data/scripts
  changing mode of build/bdist.linux-x86_64/wheel/opensnitch_ui-1.5.0rc1.data/scripts/opensnitch-ui to 755
  adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
  error: [Errno 2] No such file or directory: 'top_level.txt'
  ----------------------------------------
  ERROR: Failed building wheel for opensnitch-ui
jaggzh commented 2 years ago

Note: sudo checkinstall make install does work for the daemon, from the daemon/ subdir

gustavo-iniguez-goya commented 2 years ago

hi @jaggzh !

I build the packages as explained here: https://github.com/evilsocket/opensnitch/wiki/Building-packages-with-pbuilder

Or:

$ cd opensnitch
opensnitch $ make protocol
opensnitch $ cp -r ui/ opensnitch-ui/
opensnitch $ tar zcf opensnitch-ui_1.5.0~rc1.orig.tar.gz opensnitch-ui/
opensnitch $ cd ui/
opensnitch/ui $ dpkg-buildpackage
jaggzh commented 2 years ago

It felt so close.. briefly... :) The dpkg-buildpackage puts out:

...
cp -r i18n/locales/ opensnitch/i18n/
pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2*
python3 setup.py install --force --root=debian/python3-opensnitch-ui --no-compile -O0 --install-layout=deb  
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --install-layout not recognized
make[1]: *** [debian/rules:28: override_dh_auto_install] Error 1
make[1]: Leaving directory '/home/jaggz/projects/src/opensnitch/ui'