Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # The package build supports three optional features. To enable/disable them,
5 # modify DEB_BUILD_OPTIONS accordingly:
6 # * PAM support default: ON disable: DEB_BUILD_OPTIONS=nopam
7 # * SELinux support default: ON disable: DEB_BUILD_OPTIONS=noselinux
8 # * audit support default: OFF enable: DEB_BUILD_OPTIONS=withaudit
9 #
10 # Uncomment this to turn on verbose mode.
11 #export DH_VERBOSE=1
12
13 # Retrieve architecture-related variables
14 include /usr/share/dpkg/architecture.mk
15
16 # Enable cross-compiling support
17 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
18 export CC=$(DEB_HOST_GNU_TYPE)-gcc
19 endif
20
21 # Customize build flags
22 export DEB_CFLAGS_MAINT_APPEND += -Wall -Wno-unused -Wno-comment
23 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
24
25 # debug is enabled by default
26 ifneq (,$(findstring nodebug,$(DEB_BUILD_OPTIONS)))
27 DEBUG_DEFS = -DDEBUGGING=0
28 else
29 DEBUG_DEFS = -DDEBUGGING=1
30 endif
31 export DEBUG_DEFS
32
33 # PAM is enabled by default
34 ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS)))
35 PAM_DEFS = -DUSE_PAM
36 PAM_LIBS = -lpam
37 export PAM_DEFS PAM_LIBS
38 endif
39
40 # SELinux and audit are only available on Linux
41 ifeq ($(DEB_HOST_ARCH_OS), linux)
42 # SELinux is enabled by default
43 ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS)))
44 SELINUX_DEFS = -DWITH_SELINUX
45 SELINUX_LIBS = -lselinux
46 export SELINUX_DEFS SELINUX_LIBS
47 endif
48
49 # audit is disabled by default
50 ifneq (,$(findstring withaudit,$(DEB_BUILD_OPTIONS)))
51 AUDIT_DEFS = -DWITH_AUDIT
52 AUDIT_LIBS = -laudit
53 export AUDIT_DEFS AUDIT_LIBS
54 endif
55 endif # Linux
56
57
58 %:
59 dh $@
60
61 override_dh_auto_clean:
62 dh_auto_clean
63 : # remove generated man pages
64 for f in debian/crontab.1 debian/crontab.5 debian/cron.8; do \
65 rm -f $$f $$f.xml; \
66 done
67
68
69 override_dh_auto_install: manpages
70 : # Empty target to bypass the auto-detected install target in Makefile
71
72 COMMON_ETC = debian/cron-daemon-common/etc
73 # beginning with release 3.0pl1-139, the configuration files
74 # are managed by the package cron-daemon-common
75
76 override_dh_install-indep:
77 install -m 644 debian/crontab.main $(COMMON_ETC)/crontab
78 install -m 644 debian/placeholder $(COMMON_ETC)/cron.d/.placeholder
79 install -m 644 debian/placeholder $(COMMON_ETC)/cron.hourly/.placeholder
80 install -m 644 debian/placeholder $(COMMON_ETC)/cron.daily/.placeholder
81 install -m 644 debian/placeholder $(COMMON_ETC)/cron.weekly/.placeholder
82 install -m 644 debian/placeholder $(COMMON_ETC)/cron.monthly/.placeholder
83 install -m 644 debian/placeholder $(COMMON_ETC)/cron.yearly/.placeholder
84
85 SUBST_DATE = s/@SOURCE_DATE@/$$(date -d @$$SOURCE_DATE_EPOCH -u +%F)/
86
87 manpages:
88 for f in debian/crontab.1 debian/crontab.5 debian/cron.8; do \
89 sed "$(SUBST_DATE)" $$f.in.xml > $$f.xml; \
90 xsltproc --nonet --param man.charmap.use.subset "0" \
91 --param make.year.ranges "1" --param make.single.year.ranges "1" \
92 --output $$f \
93 /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl\
94 $$f.xml; \
95 done
96
97 .PHONY: manpages