File: rules

package info (click to toggle)
libzstd 1.5.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-updates
  • size: 10,352 kB
  • sloc: ansic: 89,030; sh: 3,788; python: 3,466; cpp: 2,927; makefile: 2,329; asm: 390
file content (72 lines) | stat: -rwxr-xr-x 1,854 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# Export build tools for all targets to avoid build hash changes.
DPKG_EXPORT_BUILDTOOLS=1

include /usr/share/dpkg/default.mk

include /usr/share/debhelper/dh_package_notes/package-notes.mk

export DH_VERBOSE=1

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_CMAKE_CONFIGURE_OPTS := \
	-DCMAKE_LIBRARY_ARCHITECTURE=${DEB_HOST_MULTIARCH} \
	-DZSTD_LEGACY_SUPPORT:BOOL=ON \

ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	DH_CMAKE_CONFIGURE_OPTS += -DBUILD_TESTING:BOOL=OFF
else
	DH_CMAKE_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/${DEB_HOST_MULTIARCH}
	dh_auto_install -D contrib/pzstd

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

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
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
endif

build:
	dh $@

.PHONY: build