diff options
author | Rob Austein <sra@hactrn.net> | 2013-02-01 21:50:18 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-02-01 21:50:18 +0000 |
commit | 7ec1ead3187873e775036606f51cb4135408ce09 (patch) | |
tree | c9cd2c216c4ccd6cf26c9c84f9f6b579f5e795b3 | |
parent | 27d85628a8ebe96c3adc2dbeac0e58160c727071 (diff) |
Finally ready to start testing new rcynic install code.
svn path=/branches/tk377/; revision=5002
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | rcynic/Makefile.in | 42 | ||||
-rw-r--r-- | rcynic/rules.darwin.mk | 2 | ||||
-rw-r--r-- | rcynic/rules.freebsd.mk | 2 | ||||
-rw-r--r-- | rcynic/rules.linux.mk | 2 | ||||
-rw-r--r-- | rcynic/rules.unknown.mk | 2 |
7 files changed, 63 insertions, 28 deletions
@@ -631,11 +631,14 @@ OPENSSL_SO_GLOB OPENSSL_CONFIG_COMMAND TOP_LEVEL_SUBDIRS SETUP_PY_INSTALL_LAYOUT +RCYNIC_INSTALL_TARGETS RCYNIC_HTML_DIR RCYNIC_STATIC_RSYNC +RCYNIC_CRON_USER RCYNIC_CONF_TA_DIR RCYNIC_CONF_DATA RCYNIC_CONF_RSYNC +RCYNIC_BIN_RCYNIC RCYNIC_TA_DIR RCYNIC_CONF_FILE RCYNIC_JAIL_DIRS @@ -4593,6 +4596,8 @@ esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_rcynic_jail" >&5 $as_echo "$use_rcynic_jail" >&6; } @@ -4664,6 +4669,23 @@ esac +# Sort out which things to install, depending on rcynic jail status and whether +# we're doing final target installation. + +RCYNIC_INSTALL_TARGETS='install-always' + +if test $use_rcynic_jail = yes +then + RCYNIC_INSTALL_TARGETS="$RCYNIC_INSTALL_TARGETS install-jailed" +fi + +if test $enable_target_installation = yes +then + RCYNIC_INSTALL_TARGETS="$RCYNIC_INSTALL_TARGETS install-postconf" +fi + + + # Now a bunch of checks to figure out what we can do with Python. If # we don't have Python at all, none of the rest of this matters. If # we do have Python, we need to check for required packages and diff --git a/configure.ac b/configure.ac index 2544f64a..7853d374 100644 --- a/configure.ac +++ b/configure.ac @@ -288,9 +288,11 @@ esac AC_SUBST(RCYNIC_JAIL_DIRS) AC_SUBST(RCYNIC_CONF_FILE) AC_SUBST(RCYNIC_TA_DIR) +AC_SUBST(RCYNIC_BIN_RCYNIC) AC_SUBST(RCYNIC_CONF_RSYNC) AC_SUBST(RCYNIC_CONF_DATA) AC_SUBST(RCYNIC_CONF_TA_DIR) +AC_SUBST(RCYNIC_CRON_USER) AC_MSG_RESULT([$use_rcynic_jail]) @@ -360,6 +362,23 @@ esac AC_SUBST(RCYNIC_HTML_DIR) +# Sort out which things to install, depending on rcynic jail status and whether +# we're doing final target installation. + +RCYNIC_INSTALL_TARGETS='install-always' + +if test $use_rcynic_jail = yes +then + RCYNIC_INSTALL_TARGETS="$RCYNIC_INSTALL_TARGETS install-jailed" +fi + +if test $enable_target_installation = yes +then + RCYNIC_INSTALL_TARGETS="$RCYNIC_INSTALL_TARGETS install-postconf" +fi + +AC_SUBST(RCYNIC_INSTALL_TARGETS) + # Now a bunch of checks to figure out what we can do with Python. If # we don't have Python at all, none of the rest of this matters. If # we do have Python, we need to check for required packages and diff --git a/rcynic/Makefile.in b/rcynic/Makefile.in index 4950e05b..9e07a74c 100644 --- a/rcynic/Makefile.in +++ b/rcynic/Makefile.in @@ -143,56 +143,50 @@ static-rsync/rsync: @echo "Building static rsync for use in chroot jail" cd static-rsync; ${MAKE} all -install: ${BIN} ${RSYNC_INSTALL_TARGETS} +install: all ${RCYNIC_INSTALL_TARGETS} -# From here down is a long list of rules to handle installation on -# various platforms. This used to be a set of nasty shell scripts, -# now it's nasty Makefile autoconf AC_SUBST_FILE snippets. -# -# Still working out details here. +install-always: \ + install-directories install-rcynic install-scripts install-rcynic-conf install-crontab -create-rcynic-directories: ${RCYNIC_DIRS} +install-postconf: \ + install-rcynic-user-and-group install-directory-ownership -${RCYNIC_DIRS}: - mkdir -p -v -555 $@ +install-jailed: \ + install-static-rsync install-shared-libraries install-rc-scripts -postconf-rcynic-directories: ${RCYNIC_DATA_DIR} ${RCYNIC_RPKI_RTR_DIR} - chown ${RCYNIC_USER}:${RCYNIC_GROUP} ${RCYNIC_DATA_DIR} ${RCYNIC_RPKI_RTR_DIR} +install-directories: ${RCYNIC_DIRS} -# Old script only installed trust anchors if rcynic.conf was missing. -# Haven't decided yet whether we want to preserve that behavior. +${RCYNIC_DIRS}: + ${INSTALL} -v -d $@ -install-rcynic-trust-anchors: ${RCYNIC_TA_DIR} - @cd sample-trust-anchors; \ - for i in *.tal; \ - do \ - ${INSTALL} -C -p -m 444 "$$i" "${RCYNIC_TA_DIR}/$$i"; \ - done +install-directory-ownership: ${RCYNIC_DATA_DIR} ${RCYNIC_RPKI_RTR_DIR} + chown ${RCYNIC_USER}:${RCYNIC_GROUP} ${RCYNIC_DATA_DIR} ${RCYNIC_RPKI_RTR_DIR} install-rcynic-conf: ${RCYNIC_CONF_FILE} ${RCYNIC_CONF_FILE}: @echo Found no ${RCYNIC_CONF_FILE}, creating sample config. You might want to edit this. - @echo > $@.tmp '# Sample rcynic configuration file. See documentation for details.' + @echo > $@.tmp '# Basic rcynic configuration file with default trust anchors.' + @echo >>$@.tmp '# See documentation for details.' @echo >>$@.tmp '' @echo >>$@.tmp '[rcynic]' @echo >>$@.tmp 'rsync-program = ${RCYNIC_CONF_RSYNC}' @echo >>$@.tmp 'authenticated = ${RCYNIC_CONF_DATA}/authenticated' @echo >>$@.tmp 'unauthenticated = ${RCYNIC_CONF_DATA}/unauthenticated' - @echo >>$@.tmp 'lockfile = ${RCYNIC_CONF_DATA}/lock' @echo >>$@.tmp 'xml-summary = ${RCYNIC_CONF_DATA}/rcynic.xml' @echo >>$@.tmp 'jitter = 600' @echo >>$@.tmp 'use-syslog = true' @echo >>$@.tmp 'log-level = log_usage_err' - @cd ${RCYNIC_TA_DIR}; \ + @cd sample-trust-anchors; \ j=1; \ for i in *.tal; \ do \ + ${INSTALL} -C -p -m 444 "$$i" "${RCYNIC_TA_DIR}/$$i"; \ echo >>$@ "trust-anchor-locator.$$j = ${RCYNIC_CONF_TA_DIR}/$$i"; \ j=$$((j+1)); \ done @chmod 444 $@.tmp - @mv $@.tmp $@ + @mv -f $@.tmp $@ install-rcynic: ${RCYNIC_BIN_RCYNIC} @@ -231,7 +225,7 @@ ${bindir}/validation_status: validation_status # Not sure we want this, test it both ways I guess #.PHONY: .FORCE -configure-rcynic-crontab: .FORCE +install-crontab: .FORCE @echo "Setting up ${RCYNIC_CRON_USER}'s crontab to run rcynic-cron script @crontab -l -u ${RCYNIC_CRON_USER} 2>/dev/null | \ ${AWK} -v t=`hexdump -n 2 -e '"%u\n"' /dev/random` '\ diff --git a/rcynic/rules.darwin.mk b/rcynic/rules.darwin.mk index bbbdf00f..998b5f54 100644 --- a/rcynic/rules.darwin.mk +++ b/rcynic/rules.darwin.mk @@ -1,6 +1,6 @@ # $Id$ -create-rcynic-user-and-group: .FORCE +install-user-and-group: .FORCE @if /usr/bin/dscl . -read "/Groups/${RCYNIC_GROUP}" >/dev/null 2>&1; \ then \ echo "You already have a group \"${RCYNIC_GROUP}\", so I will use it."; \ diff --git a/rcynic/rules.freebsd.mk b/rcynic/rules.freebsd.mk index e99a2118..dd9e0a01 100644 --- a/rcynic/rules.freebsd.mk +++ b/rcynic/rules.freebsd.mk @@ -1,6 +1,6 @@ # $Id$ -create-rcynic-user-and-group: .FORCE +install-user-and-group: .FORCE if /usr/sbin/pw groupshow "${RCYNIC_GROUP}" 2>/dev/null; \ then \ echo "You already have a group \"${RCYNIC_GROUP}\", so I will use it."; \ diff --git a/rcynic/rules.linux.mk b/rcynic/rules.linux.mk index 750ee429..82461990 100644 --- a/rcynic/rules.linux.mk +++ b/rcynic/rules.linux.mk @@ -1,6 +1,6 @@ # $Id$ -create-rcynic-user-and-group: .FORCE +install-user-and-group: .FORCE if ${AWK} -F: 'BEGIN {status = 1} $$1 == ${RCYNIC_GROUP} {status = 0} END {exit status}' /etc/group; \ then \ echo "You already have a group \"${RCYNIC_GROUP}\", so I will use it."; \ diff --git a/rcynic/rules.unknown.mk b/rcynic/rules.unknown.mk index 1ee63a63..6ce3ea18 100644 --- a/rcynic/rules.unknown.mk +++ b/rcynic/rules.unknown.mk @@ -1,4 +1,4 @@ # $Id$ -create-rcynic-user-and-group install-shared-libraries: .FORCE +install-user-and-group install-shared-libraries install-rc-scripts: .FORCE @echo "Don't know how to make $@ on this platform"; exit 1 |