aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-09-19 22:17:09 +0000
committerRob Austein <sra@hactrn.net>2013-09-19 22:17:09 +0000
commite6a2556ddea975a3f03db517a30d02d9d6620aca (patch)
tree281caa7a1ef43c7333c6530db89e968e3a9d17c0
parent4849858a5217693302793925f48ed12dfe3137a2 (diff)
Apache-version-agnosticism, part 1: fix autoconf, FreeBSD port
skeleton, rcynic-cron. rpkigui-apache-confgen still needs work to support 2.4 syntax, but we should be tracking the Apache version number correctly for the version-dependent pathnames on FreeBSD. See #616. svn path=/trunk/; revision=5501
-rw-r--r--buildtools/build-freebsd-ports.py2
-rw-r--r--buildtools/freebsd-skeleton/rpki-ca/Makefile2
-rw-r--r--buildtools/freebsd-skeleton/rpki-rp/Makefile7
-rw-r--r--buildtools/freebsd-skeleton/rpki-rp/files/pkg-install.in (renamed from buildtools/freebsd-skeleton/rpki-rp/pkg-install)2
-rwxr-xr-xconfigure41
-rw-r--r--configure.ac34
6 files changed, 82 insertions, 6 deletions
diff --git a/buildtools/build-freebsd-ports.py b/buildtools/build-freebsd-ports.py
index c3ca0eef..b560498c 100644
--- a/buildtools/build-freebsd-ports.py
+++ b/buildtools/build-freebsd-ports.py
@@ -114,7 +114,7 @@ etc/rcynic.conf.sample
f.write('''\
@dirrm etc/rpki/trust-anchors
@dirrmtry etc/rpki
-@dirrm www/apache22/data/rcynic
+@dirrm www/apache%%APACHE_VERSION%%/data/rcynic
@cwd /
@dirrm var/rcynic/data
@dirrm var/rcynic/rpki-rtr/sockets
diff --git a/buildtools/freebsd-skeleton/rpki-ca/Makefile b/buildtools/freebsd-skeleton/rpki-ca/Makefile
index c953e037..350b3fb1 100644
--- a/buildtools/freebsd-skeleton/rpki-ca/Makefile
+++ b/buildtools/freebsd-skeleton/rpki-ca/Makefile
@@ -42,7 +42,7 @@ RUN_DEPENDS+= ${APACHE_PKGNAMEPREFIX}mod_wsgi>3:${PORTSDIR}/www/mod_wsgi3
# Try to use system OpenSSL if we can.
CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
-CONFIGURE_ARGS= --disable-target-installation --disable-rp-tools
+CONFIGURE_ARGS= --disable-target-installation --disable-rp-tools APACHE_VERSION=${APACHE_VERSION}
pre-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
diff --git a/buildtools/freebsd-skeleton/rpki-rp/Makefile b/buildtools/freebsd-skeleton/rpki-rp/Makefile
index 5511ba09..06531351 100644
--- a/buildtools/freebsd-skeleton/rpki-rp/Makefile
+++ b/buildtools/freebsd-skeleton/rpki-rp/Makefile
@@ -11,6 +11,11 @@ WWW= http://rpki.net/
GNU_CONFIGURE= yes
USE_PYTHON= 2.7+
USE_GNOME= libxml2 libxslt
+USE_APACHE_RUN= 22+
+
+SUB_FILES= pkg-install
+SUB_LIST= APACHE_VERSION=${APACHE_VERSION}
+PLIST_SUB= APACHE_VERSION=${APACHE_VERSION}
# For OpenSSL, not needed otherwise
USE_PERL5_BUILD=yes
@@ -28,7 +33,7 @@ RUN_DEPENDS+= rrdtool>0:${PORTSDIR}/databases/rrdtool
# Just want relying party tools, try to use system OpenSSL if we can.
-CONFIGURE_ARGS= --disable-ca-tools
+CONFIGURE_ARGS= --disable-ca-tools APACHE_VERSION=${APACHE_VERSION}
CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
MAKE_JOBS_UNSAFE= yes
diff --git a/buildtools/freebsd-skeleton/rpki-rp/pkg-install b/buildtools/freebsd-skeleton/rpki-rp/files/pkg-install.in
index 8c552016..730a85b9 100644
--- a/buildtools/freebsd-skeleton/rpki-rp/pkg-install
+++ b/buildtools/freebsd-skeleton/rpki-rp/files/pkg-install.in
@@ -72,7 +72,7 @@ POST-INSTALL)
then
/bin/cp -p /usr/local/etc/rcynic.conf.sample /usr/local/etc/rcynic.conf
fi
- htmldir=/usr/local/www/apache22/data/rcynic
+ htmldir=/usr/local/www/apache%%APACHE_VERSION%%/data/rcynic
if ! test -d $htmldir
then
echo "Creating $htmldir"
diff --git a/configure b/configure
index 151b4ed2..b23133ff 100755
--- a/configure
+++ b/configure
@@ -662,6 +662,7 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
+APACHE_VERSION
RCYNIC_DIR
host_os
host_vendor
@@ -730,6 +731,7 @@ enable_rpki_rtr
host_alias
target_alias
RCYNIC_DIR
+APACHE_VERSION
CC
CFLAGS
LDFLAGS
@@ -1371,6 +1373,9 @@ Optional Packages:
Some influential environment variables:
RCYNIC_DIR Where to put output files from rcynic and rtr-origin; also
controls jail location for --enable-rcynic-jail
+ APACHE_VERSION
+ Version of Apache httpd, mostly used on FreeBSD where it
+ determines some of the directory names
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
@@ -2460,6 +2465,7 @@ fi
+
# Obsolete options. If you know of a better way to handle this, tell me.
# Check whether --enable-python was given.
@@ -4412,6 +4418,39 @@ fi
RCYNIC_DIR='${DESTDIR}'"${rcynic_base_dir}"
+# APACHE_VERSION is another "precious" argument to this script. It
+# mostly matters on FreeBSD, where most things involving Apache encode
+# the Apache version number into their filenames.
+#
+# If we can't figure out the version number, we assume 2.2 and hope
+# for the best; at some point we may need to do better than this.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Apache version" >&5
+$as_echo_n "checking Apache version... " >&6; }
+
+if test "X$APACHE_VERSION" = "X"
+then
+ for apachectl in /usr/local/sbin/apachectl /usr/sbin/apachectl
+ do
+ if test -x $apachectl
+ then
+ APACHE_VERSION=`$apachectl -v | sed -n 's=^Server version: Apache/\([0-9]*\)\.\([0-9]*\)\..*$=\1\2=p'`
+ break
+ fi
+ done
+fi
+
+if test "X$APACHE_VERSION" = "X"
+then
+ APACHE_VERSION="22"
+ msg='not found, defaulting to 2.2'
+else
+ msg=`echo $APACHE_VERSION | sed 's=.=&.=`
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $msg" >&5
+$as_echo "$msg" >&6; }
+
# Figure out whether to run rcynic in a chroot jail, which determines
# a bunch of other settings.
@@ -4530,7 +4569,7 @@ esac
case $host_os in
freebsd*)
- RCYNIC_HTML_DIR='/usr/local/www/apache22/data/rcynic'
+ RCYNIC_HTML_DIR="/usr/local/www/apache${APACHE_VERSION}/data/rcynic"
;;
linux*)
if test -d /var/www/html
diff --git a/configure.ac b/configure.ac
index 14c275d9..1c6bb435 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,7 @@ AC_ARG_ENABLE([wsgi_daemon_mode], [AS_HELP_STRING([--enable-wsgi-daemon-mode=use
AC_ARG_ENABLE([python_install_layout], [AS_HELP_STRING([--enable-python-install-layout=layout], [Specify Python --install-layout])], [], [enable_python_install_layout=auto])
AC_ARG_VAR([RCYNIC_DIR], [Where to put output files from rcynic and rtr-origin; also controls jail location for --enable-rcynic-jail])
+AC_ARG_VAR([APACHE_VERSION], [Version of Apache httpd, mostly used on FreeBSD where it determines some of the directory names])
# Obsolete options. If you know of a better way to handle this, tell me.
@@ -255,6 +256,37 @@ fi
RCYNIC_DIR='${DESTDIR}'"${rcynic_base_dir}"
+# APACHE_VERSION is another "precious" argument to this script. It
+# mostly matters on FreeBSD, where most things involving Apache encode
+# the Apache version number into their filenames.
+#
+# If we can't figure out the version number, we assume 2.2 and hope
+# for the best; at some point we may need to do better than this.
+
+AC_MSG_CHECKING([Apache version])
+
+if test "X$APACHE_VERSION" = "X"
+then
+ for apachectl in /usr/local/sbin/apachectl /usr/sbin/apachectl
+ do
+ if test -x $apachectl
+ then
+ APACHE_VERSION=`$apachectl -v | sed -n 's=^Server version: Apache/\([[0-9]]*\)\.\([[0-9]]*\)\..*$=\1\2=p'`
+ break
+ fi
+ done
+fi
+
+if test "X$APACHE_VERSION" = "X"
+then
+ APACHE_VERSION="22"
+ msg='not found, defaulting to 2.2'
+else
+ msg=`echo $APACHE_VERSION | sed 's=.=&.=`
+fi
+
+AC_MSG_RESULT([$msg])
+
# Figure out whether to run rcynic in a chroot jail, which determines
# a bunch of other settings.
@@ -369,7 +401,7 @@ AC_SUBST_FILE(RPKID_MAKE_RULES)
case $host_os in
freebsd*)
- RCYNIC_HTML_DIR='/usr/local/www/apache22/data/rcynic'
+ RCYNIC_HTML_DIR="/usr/local/www/apache${APACHE_VERSION}/data/rcynic"
;;
linux*)
if test -d /var/www/html