SummaryRefsLogTreeCommitDiffStats
path: root/Makefile.am
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2017-02-22 15:49:18 +0100
committerMathieu Lirzin <mthl@gnu.org>2017-09-28 13:19:28 +0200
commit245f1ae3380330e31bfdcb7f4fe17698a2fa021d (patch)
treea2859f5b0545a54d7949cf0ef7f2219901faed25 /Makefile.am
parentf284b524465afcac4ff248ae5aecfefa7348d05f (diff)
downloadmcron-245f1ae3380330e31bfdcb7f4fe17698a2fa021d.tar.gz
mcron-245f1ae3380330e31bfdcb7f4fe17698a2fa021d.tar.bz2
mcron-245f1ae3380330e31bfdcb7f4fe17698a2fa021d.zip
build: Replace "--enable-no-vixie-clobber" with "--disable-multi-user".
* configure.ac: Define "--disable-multi-user" option instead of "--enable-no-vixie-clobber". * Makefile.am (install-exec-hook) [MULTI_USER]: Only set crontab setuid bit. (bin_PROGRAMS): Keep only 'mcron' by default. (bin_PROGRAMS) [MULTI_USER]: Add 'crontab' (sbin_PROGRAMS) [MULTI_USER]: Add 'cron'. (noinst_PROGRAMS) [!MULTI_USER]: Add 'cron' and 'crontab'. (dist_man_MANS): Move 'crontab.1' and 'cron.8' ... (extra_mans): here. New variable. (dist_man_MANS) [MULTI_USER]: Add it. (all-local) [!MULTI_USER]: New target. Depend on it. (EXTRA_DIST) [!MULTI_USER]: Distribute it. (MAINTAINERCLEANFILES): Clean it.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am44
1 files changed, 21 insertions, 23 deletions
diff --git a/Makefile.am b/Makefile.am
index ce3ad57..7602341 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,8 +21,14 @@
## Programs. ##
## ---------- ##
-bin_PROGRAMS = bin/mcron bin/crontab
+bin_PROGRAMS = bin/mcron
+
+if MULTI_USER
+bin_PROGRAMS += bin/crontab
sbin_PROGRAMS = bin/cron
+else
+noinst_PROGRAMS = bin/cron bin/crontab
+endif
AM_CPPFLAGS = \
-DPACKAGE_LOAD_PATH=\"$(moduledir)\" \
@@ -160,26 +166,10 @@ EXTRA_DIST = \
#full program prefix
fpp = $(DESTDIR)$(bindir)/@real_program_prefix@
+if MULTI_USER
install-exec-hook:
- @if [ "x@NO_VIXIE_CLOBBER@" != "xyes" -a "`id -u`" -eq "0" ]; then \
- rm -f $(fpp)cron$(EXEEXT) > /dev/null 2>&1; \
- $(INSTALL) --mode='u=rwx' mcron$(EXEEXT) $(fpp)cron$(EXEEXT); \
- rm -f $(fpp)crontab$(EXEEXT) > /dev/null 2>&1; \
- $(INSTALL) --mode='u=rwxs,og=rx' mcron$(EXEEXT) $(fpp)crontab$(EXEEXT); \
- $(INSTALL) -d --mode='u=rwx' $(DESTDIR)/var/cron; \
- $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)/var/run; \
- $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)@GUILE_SITE@; \
- $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)@GUILE_SITE@/mcron; \
- elif [ "x@NO_VIXIE_CLOBBER@" = "xyes" ]; then \
- echo "Not installing Vixie-style programs"; \
- else \
- echo "+++ WARNING: NON-ROOT INSTALL: ONLY mcron WILL BE INSTALLED, NOT ANY OF THE VIXIE REPLACEMENT PROGRAMS"; \
- fi
-
-uninstall-hook:
- if [ "`id -u`" -eq "0" ]; then \
- rm -f $(fpp){cron,crontab}$(EXEEXT); \
- fi
+ chmod u+s $(fpp)crontab$(EXEEXT)
+endif
## --------------- ##
## Documentation. ##
@@ -188,11 +178,19 @@ uninstall-hook:
info_TEXINFOS = doc/mcron.texi
doc_mcron_TEXINFOS = doc/fdl.texi
nodist_doc_mcron_TEXINFOS = doc/config.texi
-dist_man_MANS = \
- $(srcdir)/doc/mcron.1 \
+dist_man_MANS = $(srcdir)/doc/mcron.1
+extra_mans = \
$(srcdir)/doc/crontab.1 \
$(srcdir)/doc/cron.8
+if MULTI_USER
+dist_man_MANS += $(extra_mans)
+else
+# Build, distribute, but do not install the extra man pages.
+all-local: $(extra_mans)
+EXTRA_DIST += $(extra_mans)
+endif
+
# XXX: Allow the inclusion of 'doc/fdl.texi' and 'doc/config.texi' inside
# 'doc/mcron.texi' for 'dvi' and 'pdf' targets.
TEXI2DVI = texi2dvi -I doc
@@ -218,7 +216,7 @@ $(srcdir)/doc/crontab.1: src/mcron/scripts/crontab.scm bin/crontab
$(srcdir)/doc/cron.8: src/mcron/scripts/cron.scm bin/cron
-@prog="cron"; man_section=8; $(gen_man)
-MAINTAINERCLEANFILES = $(dist_man_MANS)
+MAINTAINERCLEANFILES = $(dist_man_MANS) $(extra_mans)
## -------------- ##
## Silent rules. ##