Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on debhelper verbose mode.
4 #export DH_VERBOSE=1
5
6 # Set some custom build flags
7 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow,+pie
8 DEB_CFLAGS_MAINT_APPEND = -Wall
9 include /usr/share/dpkg/architecture.mk
10 -include /usr/share/dpkg/buildtools.mk
11
12 CONFFLAGS =
13
14 # Used e.g. for manpages (to build them in a reprodicible way)
15 include /usr/share/dpkg/pkg-info.mk
16 DEB_DATE := $(strip $(shell LC_ALL=C date -u +%F -d@$(SOURCE_DATE_EPOCH)))
17
18 %:
19 dh $@
20
21 ifneq (,$(filter nodoc, $(DEB_BUILD_OPTIONS)))
22 CONFFLAGS += --disable-asciidoc
23 endif
24
25 override_dh_auto_configure:
26 dh_auto_configure -- $(CONFFLAGS) \
27 --with-tmpfilesdir=/usr/lib/tmpfiles.d \
28 --enable-shared \
29 --enable-cryptsetup-reencrypt
30
31 execute_after_dh_auto_build:
32 # build askpass and passdev keyscripts
33 $(CC) -o debian/askpass debian/askpass.c -Wall -Werror $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -pedantic
34 $(CC) -o debian/scripts/passdev debian/scripts/passdev.c -Wall -Werror $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -pedantic
35
36 # build suspend binary
37 $(CC) -o debian/scripts/suspend/cryptsetup-suspend debian/scripts/suspend/cryptsetup-suspend.c \
38 -Wall -Werror $(CFLAGS) $(CPPFLAGS) -I$(CURDIR)/lib $(LDFLAGS) -L$(CURDIR)/.libs -lcryptsetup -pedantic
39
40 ifeq (,$(filter nodoc, $(DEB_BUILD_OPTIONS)))
41 # generate manpages
42 sed 's/VERSION/$(DEB_VERSION)/;s/DATE/$(DEB_DATE)/' \
43 debian/doc/variables.xml.in >debian/doc/variables.xml
44 xsltproc --nonet --xinclude -o debian/doc/ \
45 /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
46 debian/doc/manpages.xml
47 pod2man --section=8 --center="Administrative commands" \
48 --release="$(DEB_VERSION)" debian/scripts/luksformat \
49 debian/doc/luksformat.8
50 endif
51
52 # generate gettext po files (for luksformat)
53 $(MAKE) -C debian/scripts/po all luksformat.pot
54
55 execute_before_dh_auto_test:
56 # tests/fake_token_path.so and tests/fake_systemd_tpm_path.so are built without global $(CFLAGS)
57 @echo "blhc: ignore-line-regexp: ([0-9A-Za-z_]+-)*gcc\\s.*\\s\\.\\./tests/[0-9A-Za-z_-]+\\.c(\\s.*)?"
58
59 execute_after_dh_auto_install:
60 # install gettext po files (for luksformat)
61 $(MAKE) -C debian/scripts/po DESTDIR=$(CURDIR)/debian/cryptsetup-bin install
62
63 execute_after_dh_install:
64 # install apport files when building on Ubuntu
65 ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
66 mkdir -p $(CURDIR)/debian/cryptsetup/usr/share/apport/package-hooks
67 install -m 0644 debian/cryptsetup.apport \
68 $(CURDIR)/debian/cryptsetup/usr/share/apport/package-hooks/cryptsetup.py
69 endif
70
71 override_dh_installinit:
72 dh_installinit -pcryptsetup --no-start --name=cryptdisks
73 dh_installinit -pcryptsetup --no-start --name=cryptdisks-early
74
75 execute_after_dh_auto_clean:
76 $(MAKE) -C debian/scripts/po update clean
77 if [ -f $(CURDIR)/debian/cryptsetup-initramfs.preinst.in ]; then \
78 mv -fT $(CURDIR)/debian/cryptsetup-initramfs.preinst.in $(CURDIR)/debian/cryptsetup-initramfs.preinst; \
79 fi
80
81 override_dh_bugfiles:
82 dh_bugfiles -A
83
84 execute_after_dh_fixperms-arch:
85 chmod 0755 debian/cryptsetup/usr/lib/cryptsetup/checks/*
86 chmod 0755 debian/cryptsetup/usr/lib/cryptsetup/scripts/decrypt_*
87 chmod 0755 debian/cryptsetup-suspend/usr/lib/cryptsetup/scripts/suspend/cryptsetup-suspend-wrapper
88 chmod 0755 debian/cryptsetup-suspend/usr/lib/systemd/system-shutdown/cryptsetup-suspend.shutdown
89 ifeq (,$(filter noudeb, $(DEB_BUILD_PROFILES)))
90 chmod 0755 debian/cryptsetup-udeb/usr/lib/cryptsetup/checks/*
91 chmod 0755 debian/cryptsetup-udeb/usr/lib/cryptsetup/scripts/decrypt_*
92 endif
93
94 execute_after_dh_fixperms-indep:
95 chmod 0755 debian/cryptsetup-initramfs/usr/share/cryptsetup/initramfs/bin/*
96 chmod 0755 debian/cryptsetup-initramfs/usr/share/initramfs-tools/hooks/*
97 chmod 0755 debian/cryptsetup-initramfs/usr/share/initramfs-tools/scripts/*/*