opensnitch/utils/packaging/ui/deb/debian/rules
Gustavo Iñiguez Goia 5dd4ef06bb
ui: allow to use multiple protobuffer versions
Protobuffers compiled with protobuf < 3.20.0 are incompatible with
protobuf >= 4.0.0:
https://github.com/evilsocket/opensnitch/wiki/GUI-known-problems#gui-does-not-show-up

This has been a source of problems for some users (#1214, #647), and
in some distributions, previous protobuffer does no longer work due to
incompatibility with the protobuf package version installed
(OpenSuse Tumbleweed).

So in order to solve this issue, we provide several protobuffers,
for old and new protobuf versions:
proto/ui_pb2* for protobuf >= 4.0.0
proto/pre3200/ui_pb2* for protobuf >= 3.6.0 and < 3.20.0

To avoid import errors, each protobuffer must be placed in its own
directory, and the name of the protobuffer files must be named with
the syntax <prefix>_pb2.py/<prefix>_pb2_grpc.py:
  ui_pb2.py and ui_pb2_grpc.py

The default compiled protobuffer will be opensnitch/proto/ui_*.py
instead of opensnitch/ui_*.py
2025-01-03 14:48:35 +01:00

27 lines
795 B
Makefile
Executable file

#!/usr/bin/make -f
# This file was automatically generated by stdeb 0.9.0 at
# Thu, 06 Feb 2020 00:20:02 +0100
%:
dh $@ --with python3 --buildsystem=python_distutils
override_dh_auto_clean:
rm -f opensnitch/resources_rc.py
rm -rf opensnitch/i18n/
python3 setup.py clean -a
find . -name \*.pyc -exec rm {} \;
override_dh_auto_build:
python3 setup.py build --force
override_dh_auto_install:
cd i18n; make
cp -r i18n/locales/ opensnitch/i18n/
pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
find opensnitch/proto/ -name 'ui_pb2_grpc.py' -exec sed -i 's/^import ui_pb2/from . import ui_pb2/' {} \;
python3 setup.py install --force --root=debian/python3-opensnitch-ui --no-compile -O0 --install-layout=deb
override_dh_python2:
dh_python2 --no-guessing-versions