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 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.
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
46 dh
$@
--with python3
--buildsystem
$(DH_BUILDSYSTEM
) --with quilt
48 override_dh_auto_configure
:
49 dh_auto_configure
-- \
51 -DBUILD_corbaidl2wrs
=ON \
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
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
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
:
76 DESTDIR
=$(CURDIR
)/debian
/tmp
$(MAKE
) -C
$(CURDIR
)/obj-
* install-headers
78 $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/tmp
-C
$(CURDIR
)/obj-
* install-headers
80 rm -rf
$(CURDIR
)/debian
/tmp
/usr
/share
/wireshark
/COPYING
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
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?
98 @echo
'"DEB_BUILD_OPTIONS" has "nocheck". Skipping tests'
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
; \
109 override_dh_gencontrol
:
111 dh_gencontrol
-pstratoshark
-- -v
$(STRATOSHARK_VERSION
)