diff options
author | Rob Austein <sra@hactrn.net> | 2011-01-28 16:15:09 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-01-28 16:15:09 +0000 |
commit | 56f544af4013fab6d6b279289d61a29ae1e9f6f6 (patch) | |
tree | a90da686a7cc8c6d9a5fc4954fc4d23753cb7b51 | |
parent | 32c247ef4a2de3b4fd53dba7b3515fca98c946b7 (diff) |
Autoconf installation script for rcynic on Linux, because at least one
required program (awk) lives in different places in different distros.
rcynic installation parameters probably ought to be configurable via
autoconf too, but don't worry about that for now.
svn path=/configure; revision=3671
-rwxr-xr-x | configure | 23 | ||||
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | rcynic/Makefile.in | 2 | ||||
-rw-r--r-- | rcynic/installation-scripts/linux/install.sh.in (renamed from rcynic/installation-scripts/linux/install.sh) | 10 |
4 files changed, 25 insertions, 31 deletions
@@ -3803,11 +3803,6 @@ $as_echo "$ac_cv_path_GREP" >&6; } -if test "x$GREP" = x -then - as_fn_error $? "Tests requires grep, sorry" "$LINENO" 5 -fi - if test "x$XSLTPROC" != "x" && test "x$AWK" != "x" then ac_config_files="$ac_config_files rcynic/show.sh" @@ -4136,15 +4131,16 @@ test $build_django = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS portal-gui" ac_config_files="$ac_config_files Makefile rcynic/Makefile rcynic/static-rsync/Makefile utils/Makefile utils/find_roa/Makefile utils/hashdir/Makefile utils/print_manifest/Makefile utils/print_roa/Makefile utils/uri/Makefile" +case $host_os in +linux*) + ac_config_files="$ac_config_files rcynic/installation-scripts/linux/install.sh" + + ;; +esac + # OpenSSL has its own build system that bears no relationship to -# anything but itself. On at least one platform, OpenSSL's opinion on -# the right thing to do is so completely at odds with everything else -# that the resulting libraries require special compilation options for -# any program that wants to use them. Feh. -# -# The -rpath insanity will need to change once we install this stuff. -# -# Don't bother with any of this unless we're building OpenSSL. +# anything but itself, and our use of it is a bit weird, so this is a +# BFMI (Brute Force and Massive Ignorance) job. if test $build_openssl = yes then @@ -5013,6 +5009,7 @@ do "utils/print_manifest/Makefile") CONFIG_FILES="$CONFIG_FILES utils/print_manifest/Makefile" ;; "utils/print_roa/Makefile") CONFIG_FILES="$CONFIG_FILES utils/print_roa/Makefile" ;; "utils/uri/Makefile") CONFIG_FILES="$CONFIG_FILES utils/uri/Makefile" ;; + "rcynic/installation-scripts/linux/install.sh") CONFIG_FILES="$CONFIG_FILES rcynic/installation-scripts/linux/install.sh" ;; "openssl/Makefile") CONFIG_FILES="$CONFIG_FILES openssl/Makefile" ;; "openssl/tests/Makefile") CONFIG_FILES="$CONFIG_FILES openssl/tests/Makefile" ;; "pywrap/Makefile") CONFIG_FILES="$CONFIG_FILES pywrap/Makefile" ;; diff --git a/configure.ac b/configure.ac index 01837c16..d27a3814 100644 --- a/configure.ac +++ b/configure.ac @@ -62,11 +62,6 @@ AC_PATH_PROG([XSLTPROC], [xsltproc]) AC_PATH_PROG([AWK], [awk]) AC_PROG_GREP -if test "x$GREP" = x -then - AC_MSG_ERROR([Tests requires grep, sorry]) -fi - if test "x$XSLTPROC" != "x" && test "x$AWK" != "x" then AC_CONFIG_FILES([rcynic/show.sh], @@ -246,15 +241,15 @@ AC_CONFIG_FILES([Makefile utils/print_roa/Makefile utils/uri/Makefile]) +case $host_os in +linux*) + AC_CONFIG_FILES([rcynic/installation-scripts/linux/install.sh]) + ;; +esac + # OpenSSL has its own build system that bears no relationship to -# anything but itself. On at least one platform, OpenSSL's opinion on -# the right thing to do is so completely at odds with everything else -# that the resulting libraries require special compilation options for -# any program that wants to use them. Feh. -# -# The -rpath insanity will need to change once we install this stuff. -# -# Don't bother with any of this unless we're building OpenSSL. +# anything but itself, and our use of it is a bit weird, so this is a +# BFMI (Brute Force and Massive Ignorance) job. if test $build_openssl = yes then diff --git a/rcynic/Makefile.in b/rcynic/Makefile.in index 42607dde..31662e3c 100644 --- a/rcynic/Makefile.in +++ b/rcynic/Makefile.in @@ -41,4 +41,4 @@ doc:: distclean: clean cd static-rsync; ${MAKE} $@ - rm -f show.sh Makefile + rm -f show.sh installation-scripts/linux/install.sh Makefile diff --git a/rcynic/installation-scripts/linux/install.sh b/rcynic/installation-scripts/linux/install.sh.in index 38ce9a9d..da1838c5 100644 --- a/rcynic/installation-scripts/linux/install.sh +++ b/rcynic/installation-scripts/linux/install.sh.in @@ -10,9 +10,11 @@ : ${jailgroup="rcynic"} : ${setupcron="YES"} +AWK='@AWK@' + echo "Setting up \"${jaildir}\" as a chroot jail for rcynic." -if /bin/awk -F: -v jailgroup="${jailgroup}" 'BEGIN {status = 1} $1 == jailgroup {status = 0} END {exit status}' /etc/group +if ${AWK} -F: -v jailgroup="${jailgroup}" 'BEGIN {status = 1} $1 == jailgroup {status = 0} END {exit status}' /etc/group then echo "You already have a group \"${jailgroup}\", so I will use it." elif /usr/sbin/groupadd ${jailgroup} @@ -24,7 +26,7 @@ else exit 1 fi -if /bin/awk -F: -v jailuser="${jailuser}" 'BEGIN {status = 1} $1 == jailuser {status = 0} END {exit status}' /etc/passwd +if ${AWK} -F: -v jailuser="${jailuser}" 'BEGIN {status = 1} $1 == jailuser {status = 0} END {exit status}' /etc/passwd then echo "You already have a user \"${jailuser}\", so I will use it." elif /usr/sbin/useradd -g ${jailgroup} -M -N -d "${jaildir}" -s /sbin/nologin -c "RPKI validation system" ${jailuser} @@ -123,7 +125,7 @@ shared_libraries="${jaildir}/bin/rcynic ${jaildir}/bin/rsync" while true do closure="$(/usr/bin/ldd ${shared_libraries} | - /bin/awk -v "rcynic=${jaildir}/bin/rcynic" -v "rsync=${jaildir}/bin/rsync" \ + ${AWK} -v "rcynic=${jaildir}/bin/rcynic" -v "rsync=${jaildir}/bin/rsync" \ '{sub(/:$/, "")} $0 == rcynic || $0 == rsync {next} {for (i = 1; i <= NF; i++) if ($i ~ /^\//) print $i}' | /bin/sort -u)" if test "x$shared_libraries" = "x$closure" @@ -160,7 +162,7 @@ echo "Setting up root's crontab to run jailed rcynic" case "$setupcron" in YES|yes) /usr/bin/crontab -l -u root 2>/dev/null | - /bin/awk -v "jailuser=$jailuser" -v "jailgroup=$jailgroup" -v "jaildir=$jaildir" ' + ${AWK} -v "jailuser=$jailuser" -v "jailgroup=$jailgroup" -v "jaildir=$jaildir" ' BEGIN { cmd = "exec /usr/sbin/chroot --userspec=" jailuser ":" jailgroup " " jaildir; cmd = cmd " /bin/rcynic -c /etc/rcynic.conf"; |