Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # Export build tools for all targets to avoid build hash changes.
4 DPKG_EXPORT_BUILDTOOLS=1
5
6 include /usr/share/dpkg/default.mk
7
8 include /usr/share/debhelper/dh_package_notes/package-notes.mk
9
10 export DH_VERBOSE=1
11
12 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
13
14 # Upstream's makefiles will respect PREFIX, and this means we avoid a patch
15 export PREFIX=/usr
16
17 HELP2MAN = help2man --no-info --help-option="'-h'" --no-discard-stderr
18 mandir := $(CURDIR)/debian/zstd/usr/share/man/man1
19
20 DH_CMAKE_CONFIGURE_OPTS := \
21 -DCMAKE_LIBRARY_ARCHITECTURE=${DEB_HOST_MULTIARCH} \
22 -DZSTD_LEGACY_SUPPORT:BOOL=ON \
23
24 ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
25 DH_CMAKE_CONFIGURE_OPTS += -DBUILD_TESTING:BOOL=OFF
26 else
27 DH_CMAKE_CONFIGURE_OPTS += -DBUILD_TESTING:BOOL=ON
28 endif
29
30 ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
31 # Verbose output for the default 'make' build system
32 export V=1
33 endif
34
35 %:
36 dh '$@'
37
38 execute_after_dh_auto_clean:
39 dh_auto_clean -D contrib/pzstd
40 dh_auto_clean -D doc/educational_decoder
41 dh_auto_clean \
42 --buildsystem=cmake \
43 --sourcedir=$(CURDIR)/build/cmake
44
45 execute_after_dh_auto_configure:
46 dh_auto_configure \
47 --buildsystem=cmake \
48 --sourcedir=$(CURDIR)/build/cmake \
49 -- \
50 $(DH_CMAKE_CONFIGURE_OPTS)
51
52 execute_after_dh_auto_build:
53 dh_auto_build -D contrib/pzstd
54
55 override_dh_auto_install:
56 dh_auto_install -- libdir=/usr/lib/${DEB_HOST_MULTIARCH}
57 dh_auto_install -D contrib/pzstd
58
59 override_dh_makeshlibs:
60 dh_makeshlibs -plibzstd1 -V'libzstd1 (>= 1.5.5)' --add-udeb=libzstd1-udeb
61
62 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
63 execute_after_dh_installman:
64 cp $(mandir)/zstd.1 $(mandir)/zstdmt.1
65 $(HELP2MAN) --name='parallelized Zstandard compression, a la pigz' contrib/pzstd/pzstd \
66 | perl -pe 's/(\(de\)compression\s\(default:)(\d+)(\))/$$1 All$$3/g' >$(mandir)/pzstd.1
67 endif
68
69 build:
70 dh $@
71
72 .PHONY: build