Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / packaging / debian / rules
blob7f8157a11b069567dde6ecd2633661e5b7b07601
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 STRATOSHARK_MAJOR_VERSION = $(shell grep '^set(STRATOSHARK_MAJOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
22 STRATOSHARK_MINOR_VERSION = $(shell grep '^set(STRATOSHARK_MINOR_VERSION' CMakeLists.txt | sed -e 's/set.* //' -e 's/)//')
23 STRATOSHARK_PATCH_VERSION = $(shell grep '^set(STRATOSHARK_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)/$(STRATOSHARK_MAJOR_VERSION)\.$(STRATOSHARK_MINOR_VERSION)\.$(STRATOSHARK_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
45 ifeq ($(wildcard .git),)
46 CONFIGURE_SWITCHES += -DVCSVERSION_OVERRIDE="$(DEB_VERSION)"
47 endif
50 dh $@ --with python3 --buildsystem $(DH_BUILDSYSTEM) --with quilt
52 override_dh_auto_configure:
53 dh_auto_configure -- \
54 -DBUILD_xxx2deb=ON \
55 -DBUILD_corbaidl2wrs=ON \
56 $(CONFIGURE_SWITCHES)
57 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \
58 debian/stratoshark.postinst.in > debian/stratoshark.postinst
60 override_dh_auto_build:
61 # Ignore warnings from asn2wrs.py about duplicate field names.
62 PYTHONWARNINGS='ignore:The same:UserWarning::0' \
63 $(MAKE) -C $(CURDIR)/obj-* asn1
64 dh_auto_build
65 $(MAKE) -C $(CURDIR)/obj-* user_guide_html developer_guide_html
66 # fix links in documentation
67 sed -i "s|$(CURDIR)/doc|..|" obj-*/doc/ws*g_html_chunked/*.html
68 ifeq (,$(filter $(DEB_BUILD_OPTIONS),nocheck))
69 # Required for the "unittests" suite.
70 $(MAKE) -C $(CURDIR)/obj-* test-programs
71 endif
73 override_dh_dwz:
74 # run dh_dwz only with debhelper (>= 12.6) to work around https://bugs.debian.org/939164
75 dpkg -l debhelper | awk '/debhelper/ {print $$3}' | xargs dpkg --compare-versions 12.6 gt || dh_dwz
77 override_dh_auto_install:
78 dh_auto_install
79 ifeq ($(MAKE),ninja)
80 DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C $(CURDIR)/obj-* install-headers
81 else
82 $(MAKE) DESTDIR=$(CURDIR)/debian/tmp -C $(CURDIR)/obj-* install-headers
83 endif
84 rm -rf $(CURDIR)/debian/tmp/usr/share/wireshark/COPYING
86 override_dh_install:
87 dh_install
88 # check all necessary headers are included
89 $(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
91 override_dh_fixperms:
92 dh_fixperms
93 chmod 644 debian/wireshark-dev/usr/share/pyshared/make-plugin-reg.py \
94 debian/wireshark-dev/usr/share/pyshared/wireshark_be.py \
95 debian/wireshark-dev/usr/share/pyshared/wireshark_gen.py
97 override_dh_auto_test:
98 ifeq (,$(filter $(DEB_BUILD_OPTIONS),nocheck))
99 # XXX Add -- --verbose?
100 dh_auto_test
101 else
102 @echo '"DEB_BUILD_OPTIONS" has "nocheck". Skipping tests'
103 endif
105 override_dh_makeshlibs:
106 for package in $$(grep 'Package: lib.*[0-9]$$' debian/control | cut -d' ' -f2); do \
107 lib=$${package%%[0-9]*};\
108 major=$${package##*[a-z]}; \
109 echo "$$lib $$major $$package (= $(DEB_VERSION))" > debian/$$package.shlibs; \
110 done
111 dh_makeshlibs
113 override_dh_gencontrol:
114 dh_gencontrol
115 dh_gencontrol -pstratoshark -- -v$(STRATOSHARK_VERSION)