TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / packaging / debian / rules
blob5a2dddbd31c51901a465065bdbcc3eeefbabf7fe
1 #!/usr/bin/make -f
2 # Originally made with the aid of dh_make, by Craig Small
3 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4 # Some lines taken from debmake, by Cristoph Lameter.
5 # Rewritten to use dh, by Balint Reczey
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
10 distrelease := $(shell lsb_release -cs)
11 ifeq ($(distrelease),n/a)
12 distrelease := sid
13 endif
15 include /usr/share/dpkg/pkg-info.mk
17 # Fetch our Stratoshark version. This is pretty janky, but will have to do for now.
18 PROJECT_MAJOR_VERSION = $(shell grep '^set(PROJECT_MAJOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
19 PROJECT_MINOR_VERSION = $(shell grep '^set(PROJECT_MINOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
20 PROJECT_PATCH_VERSION = $(shell grep '^set(PROJECT_PATCH_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
21 LOG_PROJECT_MAJOR_VERSION = $(shell grep '^set(LOG_PROJECT_MAJOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
22 LOG_PROJECT_MINOR_VERSION = $(shell grep '^set(LOG_PROJECT_MINOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
23 LOG_PROJECT_PATCH_VERSION = $(shell grep '^set(LOG_PROJECT_PATCH_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
24 STRATOSHARK_VERSION = $(shell echo $(DEB_VERSION) | sed -e "s/$(PROJECT_MAJOR_VERSION)\.$(PROJECT_MINOR_VERSION)\.$(PROJECT_PATCH_VERSION)/$(LOG_PROJECT_MAJOR_VERSION)\.$(LOG_PROJECT_MINOR_VERSION)\.$(LOG_PROJECT_PATCH_VERSION)/")
26 # This has to be exported to make some magic below work.
27 export DH_OPTIONS
29 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
31 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
32 MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
33 endif
35 ifeq ($(MAKE),ninja)
36 DH_BUILDSYSTEM = cmake+ninja
37 else
38 DH_BUILDSYSTEM = cmake
39 endif
41 ifneq ($(filter pkg.wireshark.stratoshark,$(DEB_BUILD_PROFILES)),)
42 CONFIGURE_SWITCHES += -DBUILD_stratoshark=ON -DBUILD_falcodump=ON
43 endif
46 dh $@ --with python3 --buildsystem $(DH_BUILDSYSTEM) --with quilt
48 override_dh_auto_configure:
49 dh_auto_configure -- \
50 -DBUILD_xxx2deb=ON \
51 -DBUILD_corbaidl2wrs=ON \
52 $(CONFIGURE_SWITCHES)
53 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \
54 debian/stratoshark.postinst.in > debian/stratoshark.postinst
56 override_dh_auto_build:
57 # Ignore warnings from asn2wrs.py about duplicate field names.
58 PYTHONWARNINGS='ignore:The same:UserWarning::0' \
59 $(MAKE) -C $(CURDIR)/obj-* asn1
60 dh_auto_build
61 $(MAKE) -C $(CURDIR)/obj-* user_guide_html developer_guide_html
62 # fix links in documentation
63 sed -i "s|$(CURDIR)/doc|..|" obj-*/doc/ws*g_html_chunked/*.html
64 ifeq (,$(filter $(DEB_BUILD_OPTIONS),nocheck))
65 # Required for the "unittests" suite.
66 $(MAKE) -C $(CURDIR)/obj-* test-programs
67 endif
69 override_dh_dwz:
70 # run dh_dwz only with debhelper (>= 12.6) to work around https://bugs.debian.org/939164
71 dpkg -l debhelper | awk '/debhelper/ {print $$3}' | xargs dpkg --compare-versions 12.6 gt || dh_dwz
73 override_dh_auto_install:
74 dh_auto_install
75 ifeq ($(MAKE),ninja)
76 DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C $(CURDIR)/obj-* install-headers
77 else
78 $(MAKE) DESTDIR=$(CURDIR)/debian/tmp -C $(CURDIR)/obj-* install-headers
79 endif
80 rm -rf $(CURDIR)/debian/tmp/usr/share/wireshark/COPYING
82 override_dh_install:
83 dh_install
84 # check all necessary headers are included
85 $(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/wireshark -o /dev/null
87 override_dh_fixperms:
88 dh_fixperms
89 chmod 644 debian/wireshark-dev/usr/share/pyshared/make-plugin-reg.py \
90 debian/wireshark-dev/usr/share/pyshared/wireshark_be.py \
91 debian/wireshark-dev/usr/share/pyshared/wireshark_gen.py
93 override_dh_auto_test:
94 ifeq (,$(filter $(DEB_BUILD_OPTIONS),nocheck))
95 # XXX Add -- --verbose?
96 dh_auto_test
97 else
98 @echo '"DEB_BUILD_OPTIONS" has "nocheck". Skipping tests'
99 endif
101 override_dh_makeshlibs:
102 for package in $$(grep 'Package: lib.*[0-9]$$' debian/control | cut -d' ' -f2); do \
103 lib=$${package%%[0-9]*};\
104 major=$${package##*[a-z]}; \
105 echo "$$lib $$major $$package (= $(DEB_VERSION))" > debian/$$package.shlibs; \
106 done
107 dh_makeshlibs
109 override_dh_gencontrol:
110 dh_gencontrol
111 dh_gencontrol -pstratoshark -- -v$(STRATOSHARK_VERSION)