1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
#!/usr/bin/make -f
# Originally made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.
# Rewritten to use dh, by Balint Reczey
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpkg/pkg-info.mk
QT6_BUILD_DEPS = qt6-5compat-dev, qt6-base-dev, qt6-base-dev-tools, qt6-multimedia-dev, qt6-tools-dev
QT6_DEPS = libqt6svg6,\n qt6-qpa-plugins
QT6_RECOMMENDS = libqt6multimedia6
QT5_BUILD_DEPS = qtbase5-dev, qtbase5-dev-tools, qtbase5-dev-tools, qtmultimedia5-dev, qttools5-dev
QT5_DEPS = libqt5svg5
QT5_RECOMMENDS = libqt5multimedia5-plugins
STRATOSHARK_BUILD_DEPS = libfalcosecurity0-dev [$(shell sed -n 's/^Architecture: //p' debian/control.stratoshark.in)], uthash-dev
CONTROL_IN_SED_CMD =
ifneq ($(filter jammy,$(DEB_DISTRIBUTION)),)
CONTROL_IN_SED_CMD := $(CONTROL_IN_SED_CMD)s/@QT_BUILD_DEPS@/$(QT5_BUILD_DEPS)/;s/@QT_DEPS@/$(QT5_DEPS)/;s/@QT_RECOMMENDS@/$(QT5_RECOMMENDS)/;s/, qt/,\\n qt/g;
else
CONTROL_IN_SED_CMD := $(CONTROL_IN_SED_CMD)s/@QT_BUILD_DEPS@/$(QT6_BUILD_DEPS)/;s/@QT_DEPS@/$(QT6_DEPS)/;s/@QT_RECOMMENDS@/$(QT6_RECOMMENDS)/;s/, qt/,\\n qt/g;
endif
# work around #1115719
export DEB_CPPFLAGS_MAINT_APPEND = -I/usr/include/falcosecurity
ifneq ($(filter jammy noble,$(DEB_DISTRIBUTION)),)
CONTROL_IN_SED_CMD := $(CONTROL_IN_SED_CMD)s/^ *@STRATOSHARK_BUILD_DEPS@/\# $(STRATOSHARK_BUILD_DEPS)/;
CONTROL_STRATOSHARK_IN =
else
CONTROL_IN_SED_CMD := $(CONTROL_IN_SED_CMD)s/@STRATOSHARK_BUILD_DEPS@/$(STRATOSHARK_BUILD_DEPS)/;
CONTROL_STRATOSHARK_IN = debian/control.stratoshark.in
ifneq (,$(filter $(shell sed -n 's/^Architecture: //p' debian/control.stratoshark.in),$(DEB_HOST_ARCH)))
CONFIGURE_STRATOSHARK = -DBUILD_stratoshark=ON -DBUILD_falcodump=ON
endif
endif
# TODO: To be removed after https://gitlab.com/wireshark/wireshark/-/merge_requests/22733 is merged.
export STRATOSHARK_VERSION_EXTRA = .0.unofficial
# TODO: Update after https://gitlab.com/wireshark/wireshark/-/merge_requests/22733 is merged.
STRATOSHARK_MAJOR_VERSION = $(shell grep '^set(STRATOSHARK_MAJOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
STRATOSHARK_MINOR_VERSION = $(shell grep '^set(STRATOSHARK_MINOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
STRATOSHARK_PATCH_VERSION = $(shell grep '^set(STRATOSHARK_PATCH_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
STRATOSHARK_VERSION = $(STRATOSHARK_MAJOR_VERSION).$(STRATOSHARK_MINOR_VERSION).$(STRATOSHARK_PATCH_VERSION)$(STRATOSHARK_VERSION_EXTRA)$(shell echo $(DEB_VERSION) | sed 's/[^-]*//')
# This has to be exported to make some magic below work.
export DH_OPTIONS
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export docdir = /usr/share/doc/wireshark-doc
%:
dh $@ --with python3 --buildsystem cmake
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_xxx2deb=ON -DBUILD_corbaidl2wrs=ON \
-DVCSVERSION_OVERRIDE="Git v$(DEB_VERSION_UPSTREAM) packaged as $(DEB_VERSION)" \
-DUSE_qt6=$$(if grep -q qt6-base-dev debian/control; then echo ON; else echo OFF; fi) \
$(CONFIGURE_STRATOSHARK)
override_dh_auto_build-arch:
# regenerate ASN.1 dissectors
# Ignore warnings from asn2wrs.py about duplicate field names.
PYTHONWARNINGS='ignore:The same:UserWarning::0' \
$(MAKE) -C $(CURDIR)/obj-* asn1
dh_auto_build -a
override_dh_auto_build-indep:
# Ignore warnings from asn2wrs.py about duplicate field names.
PYTHONWARNINGS='ignore:The same:UserWarning::0' \
$(MAKE) -C $(CURDIR)/obj-* asn1
dh_auto_build -i
$(MAKE) -C $(CURDIR)/obj-* user_guide_html developer_guide_html
# fix links in documentation
sed -i "s|$(CURDIR)/doc|..|" obj-*/doc/ws*g_html_chunked/*.html
override_dh_dwz:
# run dh_dwz only with debhelper (>= 12.6) to work around https://bugs.debian.org/939164
dpkg -l debhelper | awk '/debhelper/ {print $$3}' | xargs dpkg --compare-versions 12.6 gt || dh_dwz
override_dh_auto_install-arch:
dh_auto_install -a
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp -C $(CURDIR)/obj-* install-headers
# fixes #1068410, can be dropped in wireshark 4.4
cp epan/dfilter/dfilter-loc.h debian/tmp/usr/include/wireshark/epan/dfilter/
rm -f debian/*.shlibs
mkdir -p $(CURDIR)/debian/tmp/etc/wireshark/
override_dh_auto_install-indep:
dh_auto_install -i
rm -rf $(CURDIR)/debian/tmp/usr/share/doc/wireshark/COPYING
cp debian/license-text-about-dialog $(CURDIR)/debian/tmp/usr/share/wireshark/ABOUT.GPL
override_dh_install-arch:
dh_install -a
# check all necessary headers are included
$(CC) -c debian/headers-check.c $(shell pkg-config --cflags glib-2.0) $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS) -Idebian/libwireshark-dev/usr/include -Idebian/libwireshark-dev/usr/include/wireshark -Idebian/libwiretap-dev/usr/include/wireshark -Idebian/libwsutil-dev/usr/include -Idebian/libwsutil-dev/usr/include/wireshark -o /dev/null
override_dh_fixperms-arch:
dh_fixperms -a
chmod 644 debian/wireshark-dev/usr/share/pyshared/make-plugin-reg.py \
debian/wireshark-dev/usr/share/pyshared/wireshark_be.py \
debian/wireshark-dev/usr/share/pyshared/wireshark_gen.py
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) -C obj-* test-programs
ifneq (,$(filter hppa m68k powerpc ppc64 sparc64 s390x,$(DEB_HOST_ARCH)))
# reported as https://gitlab.com/wireshark/wireshark/-/issues/15945
-env LC_ALL=C.UTF-8 dh_auto_test
else
env LC_ALL=C.UTF-8 dh_auto_test
endif
endif
override_dh_clean:
dh_clean -- debian/control
# regenerate debian/control
sed "$(CONTROL_IN_SED_CMD)" debian/control.in $(CONTROL_STRATOSHARK_IN) > debian/control
# ignore #653916
@echo 'blhc: ignore-line-regexp: .*CMakeCXXCompilerABI.cpp .*'
override_dh_gencontrol:
-dh_gencontrol -pstratoshark -- -v$(STRATOSHARK_VERSION)
dh_gencontrol --remaining-packages
|