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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
#!/usr/bin/make -f
# -*- makefile -*-
# The package build supports three optional features. To enable/disable them,
# modify DEB_BUILD_OPTIONS accordingly:
# * PAM support default: ON disable: DEB_BUILD_OPTIONS=nopam
# * SELinux support default: ON disable: DEB_BUILD_OPTIONS=noselinux
# * audit support default: OFF enable: DEB_BUILD_OPTIONS=withaudit
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Retrieve architecture-related variables
include /usr/share/dpkg/architecture.mk
# Enable cross-compiling support
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
export CC=$(DEB_HOST_GNU_TYPE)-gcc
endif
# Customize build flags
export DEB_CFLAGS_MAINT_APPEND += -Wall -Wno-unused -Wno-comment
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# debug is enabled by default
ifneq (,$(findstring nodebug,$(DEB_BUILD_OPTIONS)))
DEBUG_DEFS = -DDEBUGGING=0
else
DEBUG_DEFS = -DDEBUGGING=1
endif
export DEBUG_DEFS
# PAM is enabled by default
ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS)))
PAM_DEFS = -DUSE_PAM
PAM_LIBS = -lpam
export PAM_DEFS PAM_LIBS
endif
# SELinux and audit are only available on Linux
ifeq ($(DEB_HOST_ARCH_OS), linux)
# SELinux is enabled by default
ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS)))
SELINUX_DEFS = -DWITH_SELINUX
SELINUX_LIBS = -lselinux
export SELINUX_DEFS SELINUX_LIBS
endif
# audit is disabled by default
ifneq (,$(findstring withaudit,$(DEB_BUILD_OPTIONS)))
AUDIT_DEFS = -DWITH_AUDIT
AUDIT_LIBS = -laudit
export AUDIT_DEFS AUDIT_LIBS
endif
endif # Linux
%:
dh $@
override_dh_auto_clean:
dh_auto_clean
: # remove generated man pages
for f in debian/crontab.1 debian/crontab.5 debian/cron.8; do \
rm -f $$f $$f.xml; \
done
override_dh_auto_install: manpages
: # Empty target to bypass the auto-detected install target in Makefile
: #
: # this step is automatic with DebHelper >= 14
dh_installsysusers
COMMON_ETC = debian/cron-daemon-common/etc
# beginning with release 3.0pl1-139, the configuration files
# are managed by the package cron-daemon-common
override_dh_install-indep:
install -m 644 debian/crontab.main $(COMMON_ETC)/crontab
install -m 644 debian/placeholder $(COMMON_ETC)/cron.d/.placeholder
install -m 644 debian/placeholder $(COMMON_ETC)/cron.hourly/.placeholder
install -m 644 debian/placeholder $(COMMON_ETC)/cron.daily/.placeholder
install -m 644 debian/placeholder $(COMMON_ETC)/cron.weekly/.placeholder
install -m 644 debian/placeholder $(COMMON_ETC)/cron.monthly/.placeholder
install -m 644 debian/placeholder $(COMMON_ETC)/cron.yearly/.placeholder
SUBST_DATE = s/@SOURCE_DATE@/$$(date -d @$$SOURCE_DATE_EPOCH -u +%F)/
manpages:
for f in debian/crontab.1 debian/crontab.5 debian/cron.8; do \
sed "$(SUBST_DATE)" $$f.in.xml > $$f.xml; \
xsltproc --nonet --param man.charmap.use.subset "0" \
--param make.year.ranges "1" --param make.single.year.ranges "1" \
--output $$f \
/usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl\
$$f.xml; \
done
.PHONY: manpages
|