File: rules

package info (click to toggle)
libzstd 1.5.4%2Bdfsg2-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 10,568 kB
  • sloc: ansic: 84,681; sh: 3,649; python: 3,342; cpp: 2,923; makefile: 2,282; asm: 371
file content (73 lines) | stat: -rwxr-xr-x 1,895 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/make -f

# Export build tools for all targets to avoid build hash changes.
DPKG_EXPORT_BUILDTOOLS=1
include /usr/share/dpkg/buildtools.mk

export DH_VERBOSE=1

arch ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# Upstream's makefiles will respect PREFIX, and this means we avoid a patch
export PREFIX=/usr

HELP2MAN = help2man --no-info --help-option="'-h'" --no-discard-stderr
mandir := $(CURDIR)/debian/zstd/usr/share/man/man1

DH_AUTO_CONFIGURE_OPTS := \
	-DCMAKE_LIBRARY_ARCHITECTURE=${arch} \
	-DZSTD_LEGACY_SUPPORT:BOOL=ON \

ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	DH_AUTO_CONFIGURE_OPTS += -DBUILD_TESTING:BOOL=OFF
else
	DH_AUTO_CONFIGURE_OPTS += -DBUILD_TESTING:BOOL=ON
endif

ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
# Verbose output for the default 'make' build system
export V=1
endif

%:
	dh '$@'

execute_after_dh_auto_clean:
	dh_auto_clean -D contrib/pzstd
	dh_auto_clean -D doc/educational_decoder
	dh_auto_clean \
		--buildsystem=cmake \
		--sourcedir=$(CURDIR)/build/cmake

execute_after_dh_auto_configure:
	dh_auto_configure \
		--buildsystem=cmake \
		--sourcedir=$(CURDIR)/build/cmake \
		-- \
		$(DH_CMAKE_CONFIGURE_OPTS)

execute_after_dh_auto_build:
	dh_auto_build -D contrib/pzstd

override_dh_auto_install:
	dh_auto_install -- libdir=/usr/lib/$(arch)
	dh_auto_install -D contrib/pzstd

ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
execute_after_dh_install:
	cp -r debian/libzstd1/usr debian/libzstd1-udeb/
endif

override_dh_makeshlibs:
	dh_makeshlibs -plibzstd1 -V'libzstd1 (>= 1.5.2)' --add-udeb=libzstd1-udeb

execute_after_dh_installman:
	cp $(mandir)/zstd.1 $(mandir)/zstdmt.1
	$(HELP2MAN) --name='parallelized Zstandard compression, a la pigz' contrib/pzstd/pzstd \
	| perl -pe 's/(\(de\)compression\s\(default:)(\d+)(\))/$$1 All$$3/g' >$(mandir)/pzstd.1

build:
	dh $@

.PHONY: build