rules 1.87 KB
Newer Older
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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1


# Add build flags
CFLAGS += -Wall


# Build the config options string
CONFIG_OPTIONS =

# PAM is enabled by default
ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS)))
    CONFIG_OPTIONS += --with-pam
endif

### Linux-only options ###
ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), linux)

# SELINUX is enabled by default
ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS)))
    CONFIG_OPTIONS += --with-selinux
endif

# inotify is enabled by default
ifeq (,$(findstring noinotify,$(DEB_BUILD_OPTIONS)))
    CONFIG_OPTIONS += --with-inotify
endif

# audit is disabled by default
ifneq (,$(findstring withaudit,$(DEB_BUILD_OPTIONS)))
    CONFIG_OPTIONS += --with-audit
endif

endif
### End Linux-only ###


%:
42
	dh $@
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

# Set SPOOL_DIR to Debian's traditional location for crontabs (see Policy)
# Set CRON_GROUP to "crontab" to enable SGID functionality (avoids SUID)
override_dh_auto_configure:
	SPOOL_DIR=/var/spool/cron/crontabs dh_auto_configure CRON_GROUP=crontab -- $(CONFIG_OPTIONS)

override_dh_install:
	dh_install
	# Create /etc/cron.deny to allow crontab(1) for all users by default
	install	-m 644 debian/cronie.deny	debian/cronie/etc/cron.deny
	# System-wide crontab
	install -m 644 debian/crontab.system 	debian/cronie/etc/crontab
	# Placeholders for dpkg
	install -m 644 debian/placeholder 	debian/cronie/etc/cron.d/.placeholder
	install -m 644 debian/placeholder 	debian/cronie/etc/cron.hourly/.placeholder
	install -m 644 debian/placeholder 	debian/cronie/etc/cron.daily/.placeholder
	install -m 644 debian/placeholder 	debian/cronie/etc/cron.weekly/.placeholder
	install -m 644 debian/placeholder 	debian/cronie/etc/cron.monthly/.placeholder
61 62 63
	# systemd service file
	install -d -m 755 debian/cronie/lib/systemd/system/
	install -m 644 contrib/cronie.systemd 	debian/cronie/lib/systemd/system/cronie.service