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.
10 distrelease
:= $(shell lsb_release
-cs
)
11 ifeq ($(distrelease
),n
/a
)
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.
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
)))
36 DH_BUILDSYSTEM
= cmake
+ninja
38 DH_BUILDSYSTEM
= cmake
41 ifneq ($(filter pkg.wireshark.stratoshark
,$(DEB_BUILD_PROFILES
)),)
42 CONFIGURE_SWITCHES
+= -DBUILD_stratoshark
=ON
-DBUILD_falcodump
=ON
45 ifeq ($(wildcard .git
),)
46 CONFIGURE_SWITCHES
+= -DVCSVERSION_OVERRIDE
="$(DEB_VERSION)"
50 dh
$@
--with python3
--buildsystem
$(DH_BUILDSYSTEM
) --with quilt
52 override_dh_auto_configure
:
53 dh_auto_configure
-- \
55 -DBUILD_corbaidl2wrs
=ON \
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
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
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
:
80 DESTDIR
=$(CURDIR
)/debian
/tmp
$(MAKE
) -C
$(CURDIR
)/obj-
* install-headers
82 $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/tmp
-C
$(CURDIR
)/obj-
* install-headers
84 rm -rf
$(CURDIR
)/debian
/tmp
/usr
/share
/wireshark
/COPYING
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
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?
102 @echo
'"DEB_BUILD_OPTIONS" has "nocheck". Skipping tests'
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
; \
113 override_dh_gencontrol
:
115 dh_gencontrol
-pstratoshark
-- -v
$(STRATOSHARK_VERSION
)