# vim: noexpandtab tabstop=8 shiftwidth=8 syntax=make
#
# WARNING: This may or may not work on your system. This Makefile is
# an example, rather than a ready-made universal solution.
#
# This Makefile builds and installs Subversion, and many of its
# dependencies, on UNIX-like systems, in the current working directory.
# Indirect dependencies are not covered, e.g. you need OpenSSL installed
# to get SSL support in neon and serf.
#
# The Makefile can also run Subversion's regression test suite via all
# repository backends and RA methods. It generates the necessary configuration
# files and starts svnserve and httpd daemons automatically on non-privileged
# ports.
#
# Some version of Subversion is required to be in $PATH and will be used
# to check out working copies.
#
# The default is to compile trunk.
# Pass the branch you want to build in BRANCH, e.g.
# $ make BRANCH="1.5.x"
# You can also pass a tag to build:
# $ make TAG="1.6.6"
# And you can specify a working copy to use, in case you need more
# than one working copy of the same branch:
# $ make BRANCH="1.6.x" WC="1.6.x-test2"
#
# After the build, point your PATH to the Subversion build you want to use.
# Note that this Makefile requires GNU make.
PWD = $(shell pwd)
TAG ?= none
ifeq ($(TAG),none)
BRANCH ?= trunk
else
BRANCH = $(TAG)
endif
WC ?= $(BRANCH)
BRANCH_MAJOR = $(shell echo $(BRANCH) | \
sed -e 's/\([0-9]\)\.\([0-9]\)\.[x0-9].*$$/\1.\2/')
SVN_REL_WC = svn-$(WC)
SVN_WC = $(PWD)/$(SVN_REL_WC)
PREFIX = $(PWD)/prefix
SVN_PREFIX = $(PREFIX)/svn-$(WC)
DISTDIR = $(PWD)/distfiles
SRCDIR = $(PWD)/src
OBJDIR = $(PWD)/objdir
BDB_MAJOR_VER = 4.7
BDB_VER = $(BDB_MAJOR_VER).25
APR_VER = 1.3.8
APR_ICONV_VER = 1.2.1
APR_UTIL_VER = 1.3.9
HTTPD_VER = 2.2.13
NEON_VER = 0.28.4
SERF_VER = 0.3.0
SQLITE_VER = 3.6.18
BDB_DIST = db-$(BDB_VER).tar.gz
APR_ICONV_DIST = apr-iconv-$(APR_ICONV_VER).tar.gz
NEON_DIST = neon-$(NEON_VER).tar.gz
SQLITE_DIST = sqlite-$(SQLITE_VER).tar.gz
HTTPD_DIST = httpd-$(HTTPD_VER).tar.bz2
DISTFILES = $(DISTDIR)/$(NEON_DIST) \
$(DISTDIR)/$(SERF_DIST) \
$(DISTDIR)/$(SQLITE_DIST) \
$(DISTDIR)/$(HTTPD_DIST) \
$(DISTDIR)/$(APR_ICONV_DIST)
FETCH_CMD = wget -c
BDB_URL = http://download.oracle.com/berkeley-db/$(BDB_DIST)
APR_URL = http://svn.apache.org/repos/asf/apr/apr
APR_ICONV_URL = ftp://ftp.fu-berlin.de/unix/www/apache/apr/$(APR_ICONV_DIST)
APR_UTIL_URL = http://svn.apache.org/repos/asf/apr/apr-util
HTTPD_URL = ftp://ftp.fu-berlin.de/unix/www/apache/httpd/$(HTTPD_DIST)
NEON_URL = http://webdav.org/neon/$(NEON_DIST)
SQLITE_URL = http://www.sqlite.org/$(SQLITE_DIST)
BDB_SRCDIR = $(SRCDIR)/db-$(BDB_VER)
APR_SRCDIR = $(SRCDIR)/apr-$(APR_VER)
APR_ICONV_SRCDIR = $(SRCDIR)/apr-iconv-$(APR_ICONV_VER)
APR_UTIL_SRCDIR = $(SRCDIR)/apr-util-$(APR_UTIL_VER)
HTTPD_SRCDIR = $(SRCDIR)/httpd-$(HTTPD_VER)
NEON_SRCDIR = $(SRCDIR)/neon-$(NEON_VER)
SERF_SRCDIR = $(SRCDIR)/serf-$(SERF_VER)
SERF_SRCDIR = $(SRCDIR)/serf-$(SERF_VER)
SQLITE_SRCDIR = $(SRCDIR)/sqlite-$(SQLITE_VER)
SVN_SRCDIR = $(SVN_WC)
BDB_OBJDIR = $(OBJDIR)/db-$(BDB_VER)
APR_OBJDIR = $(OBJDIR)/apr-$(APR_VER)
APR_ICONV_OBJDIR = $(OBJDIR)/apr-iconv-$(APR_ICONV_VER)
APR_UTIL_OBJDIR = $(OBJDIR)/apr-util-$(APR_UTIL_VER)
HTTPD_OBJDIR = $(OBJDIR)/httpd-$(HTTPD_VER)
NEON_OBJDIR = $(OBJDIR)/neon-$(NEON_VER)
SERF_OBJDIR = $(OBJDIR)/serf-$(SERF_VER)
SQLITE_OBJDIR = $(OBJDIR)/sqlite-$(SQLITE_VER)
SVN_OBJDIR = $(OBJDIR)/$(SVN_REL_WC)
# Tweak this for out-of-tree builds. Note that running individual
# tests in the test suite won't work conveniently with out-of-tree
# builds!
svn_builddir ?=$(SVN_WC)
#######################################################################
# Main targets.
#######################################################################
.PHONY: all reset clean nuke
all: dirs-create bdb-install apr-install apr-iconv-install apr-util-install \
httpd-install neon-install serf-install sqlite-install svn-install \
svn-bindings-install
# Use these to start a build from the beginning.
reset: dirs-reset bdb-reset apr-reset apr-iconv-reset apr-util-reset \
httpd-reset neon-reset serf-reset sqlite-reset svn-reset
# Use to save disc space.
clean: bdb-clean apr-clean apr-iconv-clean apr-util-clean httpd-clean \
neon-clean serf-clean svn-clean
# Nukes everything (including installed binaries!)
# Use this to start ALL OVER AGAIN! Use with caution!
nuke:
@echo
@echo "I will now remove the following directories PERMANENTLY:"
@echo
@echo " $(SRCDIR)"
@echo " $(OBJDIR)"
@echo " $(PREFIX)"
@echo
@echo -n 'Do you want me to continue? ([no]/yes): '
@read ANSWER ; \
case $$ANSWER in \
yes) echo "You said $$ANSWER. I will continue."; \
echo rm -rf $(SRCDIR) $(OBJDIR) $(PREFIX); \
rm -rf $(SRCDIR) $(OBJDIR) $(PREFIX); \
echo "Remember to reset the build!"; \
;; \
"") echo "You said no."; \
;; \
*) echo "You said $$ANSWER."; \
;; \
esac
#######################################################################
# directories
#######################################################################
dirs-create: $(PWD)/.dirs-created
dirs-reset:
rm -f $(PWD)/.dirs-created
$(PWD)/.dirs-created:
$(foreach d, $(PREFIX) $(DISTDIR) $(SRCDIR) $(OBJDIR), \
[ -d $(d) ] || mkdir -p $(d);)
touch $@
#######################################################################
# bdb
#######################################################################
bdb-retrieve: $(BDB_OBJDIR)/.retrieved
bdb-configure: $(BDB_OBJDIR)/.configured
bdb-compile: $(BDB_OBJDIR)/.compiled
bdb-install: $(BDB_OBJDIR)/.installed
bdb-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(BDB_OBJDIR)/$(f);)
bdb-clean:
-(cd $(BDB_SRCDIR)/build_unix/ && make clean)
# fetch distfile for bdb
$(DISTDIR)/$(BDB_DIST):
cd $(DISTDIR) && $(FETCH_CMD) $(BDB_URL)
# retrieve bdb
$(BDB_OBJDIR)/.retrieved: $(DISTDIR)/$(BDB_DIST)
[ -d $(BDB_OBJDIR) ] || mkdir -p $(BDB_OBJDIR)
tar -C $(SRCDIR) -zxf $(DISTDIR)/$(BDB_DIST)
touch $@
# configure bdb
$(BDB_OBJDIR)/.configured: $(BDB_OBJDIR)/.retrieved
cd $(BDB_SRCDIR)/build_unix \
&& env CFLAGS="-g" ../dist/configure \
--prefix=$(PREFIX)/bdb \
--enable-debug
touch $@
# compile bdb
$(BDB_OBJDIR)/.compiled: $(BDB_OBJDIR)/.configured
(cd $(BDB_SRCDIR)/build_unix && make)
touch $@
# install bdb
$(BDB_OBJDIR)/.installed: $(BDB_OBJDIR)/.compiled
(cd $(BDB_SRCDIR)/build_unix && make install)
touch $@
#######################################################################
# apr
#######################################################################
apr-retrieve: $(APR_OBJDIR)/.retrieved
apr-configure: $(APR_OBJDIR)/.configured
apr-compile: $(APR_OBJDIR)/.compiled
apr-install: $(APR_OBJDIR)/.installed
apr-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(APR_OBJDIR)/$(f);)
apr-clean:
-(cd $(APR_OBJDIR) && make clean)
# retrieve apr if not present yet
$(APR_OBJDIR)/.retrieved:
[ -d $(APR_OBJDIR) ] || mkdir -p $(APR_OBJDIR)
if [ ! -d $(APR_SRCDIR) ]; then \
svn export $(APR_URL)/tags/$(APR_VER)/ $(APR_SRCDIR); \
fi
touch $@
# configure apr
$(APR_OBJDIR)/.configured: $(APR_OBJDIR)/.retrieved
cp $(APR_SRCDIR)/build/apr_hints.m4 \
$(APR_SRCDIR)/build/apr_hints.m4.orig
cat $(APR_SRCDIR)/build/apr_hints.m4.orig \
| sed -e '/^.*APR_ADDTO(CPPFLAGS, \[-D_POSIX_THREADS\]).*$$/d' \
> $(APR_SRCDIR)/build/apr_hints.m4
cd $(APR_SRCDIR) && ./buildconf
cd $(APR_OBJDIR) \
&& $(APR_SRCDIR)/configure \
--prefix=$(PREFIX)/apr \
--enable-maintainer-mode \
--disable-threads
touch $@
# compile apr
$(APR_OBJDIR)/.compiled: $(APR_OBJDIR)/.configured
(cd $(APR_OBJDIR) && make)
touch $@
# install apr
$(APR_OBJDIR)/.installed: $(APR_OBJDIR)/.compiled
(cd $(APR_OBJDIR) && make install)
touch $@
#######################################################################
# apr-iconv
#######################################################################
apr-iconv-retrieve: $(APR_ICONV_OBJDIR)/.retrieved
apr-iconv-configure: $(APR_ICONV_OBJDIR)/.configured
apr-iconv-compile: $(APR_ICONV_OBJDIR)/.compiled
apr-iconv-install: $(APR_ICONV_OBJDIR)/.installed
apr-iconv-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(APR_ICONV_OBJDIR)/$(f);)
apr-iconv-clean:
-(cd $(APR_ICONV_OBJDIR) && make clean)
# fetch distfile for apr-iconv
$(DISTDIR)/$(APR_ICONV_DIST):
cd $(DISTDIR) && $(FETCH_CMD) $(APR_ICONV_URL)
# retrieve apr-iconv
$(APR_ICONV_OBJDIR)/.retrieved: $(DISTDIR)/$(APR_ICONV_DIST)
[ -d $(APR_ICONV_OBJDIR) ] || mkdir -p $(APR_ICONV_OBJDIR)
tar -C $(SRCDIR) -zxf $(DISTDIR)/$(APR_ICONV_DIST)
touch $@
# configure apr-iconv
$(APR_ICONV_OBJDIR)/.configured: $(APR_ICONV_OBJDIR)/.retrieved
cd $(APR_ICONV_OBJDIR) \
&& env CFLAGS="-g" $(APR_ICONV_SRCDIR)/configure \
--prefix=$(PREFIX)/apr \
--with-apr=$(PREFIX)/apr
touch $@
# compile apr-iconv
$(APR_ICONV_OBJDIR)/.compiled: $(APR_ICONV_OBJDIR)/.configured
(cd $(APR_ICONV_OBJDIR) \
&& make CPPFLAGS="-D_OSD_POSIX" CFLAGS="-g -O0")
touch $@
# install apr-iconv
$(APR_ICONV_OBJDIR)/.installed: $(APR_ICONV_OBJDIR)/.compiled
(cd $(APR_ICONV_OBJDIR) && make install)
touch $@
#######################################################################
# apr-util
#######################################################################
apr-util-retrieve: $(APR_UTIL_OBJDIR)/.retrieved
apr-util-configure: $(APR_UTIL_OBJDIR)/.configured
apr-util-compile: $(APR_UTIL_OBJDIR)/.compiled
apr-util-install: $(APR_UTIL_OBJDIR)/.installed
apr-util-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(APR_UTIL_OBJDIR)/$(f);)
apr-util-clean:
-(cd $(APR_UTIL_OBJDIR) && make clean)
# retrieve apr if not present yet
$(APR_UTIL_OBJDIR)/.retrieved:
[ -d $(APR_UTIL_OBJDIR) ] || mkdir -p $(APR_UTIL_OBJDIR)
if [ ! -d $(APR_UTIL_SRCDIR) ]; then \
svn export $(APR_UTIL_URL)/tags/$(APR_UTIL_VER)/ \
$(APR_UTIL_SRCDIR); \
fi
touch $@
# configure apr-util
$(APR_UTIL_OBJDIR)/.configured: $(APR_UTIL_OBJDIR)/.retrieved
cd $(APR_UTIL_SRCDIR) && ./buildconf --with-apr=$(APR_SRCDIR)
cd $(APR_UTIL_OBJDIR) \
&& env LD_LIBRARY_PATH=$(PREFIX)/bdb/lib \
$(APR_UTIL_SRCDIR)/configure \
--prefix=$(PREFIX)/apr \
--enable-maintainer-mode \
--with-apr=$(PREFIX)/apr \
--with-berkeley-db=$(PREFIX)/bdb \
--with-iconv=$(PREFIX)/apr
touch $@
# compile apr-util
$(APR_UTIL_OBJDIR)/.compiled: $(APR_UTIL_OBJDIR)/.configured
(cd $(APR_UTIL_OBJDIR) && make)
touch $@
# install apr-util
$(APR_UTIL_OBJDIR)/.installed: $(APR_UTIL_OBJDIR)/.compiled
(cd $(APR_UTIL_OBJDIR) && make install)
touch $@
#######################################################################
# httpd
#######################################################################
HTTPD_CONF= $(PREFIX)/httpd/conf/httpd-$(SVN_REL_WC).conf
httpd-retrieve: $(HTTPD_OBJDIR)/.retrieved
httpd-configure: $(HTTPD_OBJDIR)/.configured
httpd-compile: $(HTTPD_OBJDIR)/.compiled
httpd-install: $(HTTPD_OBJDIR)/.installed $(HTTPD_CONF)
httpd-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(HTTPD_OBJDIR)/$(f);)
rm -f
httpd-clean:
-(cd $(HTTPD_OBJDIR) && make clean)
# fetch distfile for httpd
$(DISTDIR)/$(HTTPD_DIST):
cd $(DISTDIR) && $(FETCH_CMD) $(HTTPD_URL)
# retrieve httpd
$(HTTPD_OBJDIR)/.retrieved: $(DISTDIR)/$(HTTPD_DIST)
[ -d $(HTTPD_OBJDIR) ] || mkdir -p $(HTTPD_OBJDIR)
tar -C $(SRCDIR) -jxf $(DISTDIR)/$(HTTPD_DIST)
touch $@
# configure httpd
$(HTTPD_OBJDIR)/.configured: $(HTTPD_OBJDIR)/.retrieved
cd $(HTTPD_OBJDIR) \
&& $(HTTPD_SRCDIR)/configure \
--prefix=$(PREFIX)/httpd \
--enable-maintainer-mode \
--enable-ssl \
--enable-dav \
--with-mpm=prefork \
--with-apr="$(PREFIX)/apr" \
--with-apr-util="$(PREFIX)/apr"
touch $@
# compile httpd
$(HTTPD_OBJDIR)/.compiled: $(HTTPD_OBJDIR)/.configured
(cd $(HTTPD_OBJDIR) && make)
touch $@
# install httpd
$(HTTPD_OBJDIR)/.installed: $(HTTPD_OBJDIR)/.compiled
(cd $(HTTPD_OBJDIR) && make install)
touch $@
# create a httpd.conf for mod_dav_svn
$(PREFIX)/httpd/conf/httpd-$(SVN_REL_WC).conf: $(HTTPD_OBJDIR)/.installed
echo "# httpd config for use with mod_dav_svn" > $@
echo "ServerRoot \"$(PREFIX)/httpd\"" >> $@
echo "Listen localhost:8080" >> $@
echo "LoadModule dav_svn_module modules/svn-$(WC)/mod_dav_svn.so" >> $@
echo "LoadModule authz_svn_module modules/svn-$(WC)/mod_authz_svn.so" >> $@
echo "DocumentRoot "$(PREFIX)/httpd/htdocs"" >> $@
echo "" >> $@
echo " Options FollowSymLinks" >> $@
echo " AllowOverride None" >> $@
echo " Order deny,allow" >> $@
echo " Deny from all" >> $@
echo "" >> $@
echo "" >> $@
echo " DAV svn" >> $@
echo " SVNPath /tmp/svn-sandbox/repos" >> $@
echo " Allow from localhost" >> $@
echo "" >> $@
#######################################################################
# neon
#######################################################################
neon-retrieve: $(NEON_OBJDIR)/.retrieved
neon-configure: $(NEON_OBJDIR)/.configured
neon-compile: $(NEON_OBJDIR)/.compiled
neon-install: $(NEON_OBJDIR)/.installed
neon-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(NEON_OBJDIR)/$(f);)
neon-clean:
-(cd $(NEON_OBJDIR) && make clean)
# fetch distfile for neon
$(DISTDIR)/$(NEON_DIST):
cd $(DISTDIR) && $(FETCH_CMD) $(NEON_URL)
# retrieve neon
$(NEON_OBJDIR)/.retrieved: $(DISTDIR)/$(NEON_DIST)
[ -d $(NEON_OBJDIR) ] || mkdir -p $(NEON_OBJDIR)
tar -C $(SRCDIR) -zxf $(DISTDIR)/$(NEON_DIST)
touch $@
# configure neon
$(NEON_OBJDIR)/.configured: $(NEON_OBJDIR)/.retrieved
cd $(NEON_SRCDIR) && ./autogen.sh
cd $(NEON_OBJDIR) \
&& env CFLAGS="-g" $(NEON_SRCDIR)/configure \
--prefix=$(PREFIX)/neon \
--with-ssl \
--enable-shared
touch $@
# compile neon
$(NEON_OBJDIR)/.compiled: $(NEON_OBJDIR)/.configured
(cd $(NEON_OBJDIR) && make)
touch $@
# install neon
$(NEON_OBJDIR)/.installed: $(NEON_OBJDIR)/.compiled
(cd $(NEON_OBJDIR) && make install)
touch $@
#######################################################################
# serf
#######################################################################
serf-retrieve: $(SERF_OBJDIR)/.retrieved
serf-configure: $(SERF_OBJDIR)/.configured
serf-compile: $(SERF_OBJDIR)/.compiled
serf-install: $(SERF_OBJDIR)/.installed
serf-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(SERF_OBJDIR)/$(f);)
serf-clean:
-(cd $(SERF_SRCDIR) && ./serfmake clean)
# retrieve serf if not present yet
# r1221 fixes apr/apr-util detection in serfmake
$(SERF_OBJDIR)/.retrieved:
[ -d $(SERF_OBJDIR) ] || mkdir -p $(SERF_OBJDIR)
if [ ! -d $(SERF_SRCDIR) ]; then \
svn export http://serf.googlecode.com/svn/tags/$(SERF_VER)/ \
$(SERF_SRCDIR) && \
(cd $(SERF_SRCDIR) && \
svn diff -c1221 http://serf.googlecode.com/svn/trunk \
| patch -p0); \
fi
touch $@
# compile serf (serf won't compile outside its source tree)
$(SERF_OBJDIR)/.compiled: $(SERF_OBJDIR)/.retrieved
cd $(SERF_SRCDIR) && \
svn up || true && \
./serfmake --with-apr=$(PREFIX)/apr \
--with-apr-util=$(PREFIX)/apr \
--prefix=$(PREFIX)/serf \
build
touch $@
# install serf
$(SERF_OBJDIR)/.installed: $(SERF_OBJDIR)/.compiled
cd $(SERF_SRCDIR) && \
./serfmake --with-apr=$(PREFIX)/apr \
--with-apr-util=$(PREFIX)/apr \
--prefix=$(PREFIX)/serf \
install
touch $@
#######################################################################
# sqlite
#######################################################################
sqlite-retrieve: $(SQLITE_OBJDIR)/.retrieved
sqlite-configure: $(SQLITE_OBJDIR)/.configured
sqlite-compile: $(SQLITE_OBJDIR)/.compiled
sqlite-install: $(SQLITE_OBJDIR)/.installed
sqlite-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(SQLITE_OBJDIR)/$(f);)
# fetch distfile for sqlite
$(DISTDIR)/$(SQLITE_DIST):
cd $(DISTDIR) && $(FETCH_CMD) $(SQLITE_URL)
# retrieve sqlite
$(SQLITE_OBJDIR)/.retrieved: $(DISTDIR)/$(SQLITE_DIST)
[ -d $(SQLITE_OBJDIR) ] || mkdir -p $(SQLITE_OBJDIR)
tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SQLITE_DIST)
touch $@
# configure sqlite
$(SQLITE_OBJDIR)/.configured: $(SQLITE_OBJDIR)/.retrieved
cd $(SQLITE_OBJDIR) \
&& env CFLAGS="-g" $(SQLITE_SRCDIR)/configure \
--prefix=$(PREFIX)/sqlite \
--disable-tcl \
--disable-threadsafe
touch $@
# compile sqlite
$(SQLITE_OBJDIR)/.compiled: $(SQLITE_OBJDIR)/.configured
(cd $(SQLITE_OBJDIR) && make)
touch $@
# install sqlite
$(SQLITE_OBJDIR)/.installed: $(SQLITE_OBJDIR)/.compiled
(cd $(SQLITE_OBJDIR) && make install)
touch $@
#######################################################################
# svn
#######################################################################
.PHONY: svn-configure svn-compile svn-install svn-bindings-compile \
svn-bindings-install svn-clean
svn-install-all: svn-install svn-bindings-install
svn-configure: $(SVN_OBJDIR)/.configured
svn-compile: $(SVN_OBJDIR)/.compiled
svn-bindings-compile: $(SVN_OBJDIR)/.bindings-compiled
svn-install: $(SVN_OBJDIR)/.installed
svn-bindings-install: $(SVN_OBJDIR)/.bindings-installed
svn-reset:
$(foreach f, .retrieved .configured .compiled .installed \
.bindings-compiled .bindings-installed, \
rm -f $(SVN_OBJDIR)/$(f);)
svn-clean:
-(cd $(svn_builddir) && make distclean)
# retrieve svn if not present yet
$(SVN_OBJDIR)/.retrieved:
[ -d $(SVN_OBJDIR) ] || mkdir -p $(SVN_OBJDIR)
if [ "$(TAG)" != "none" ]; then \
branchdir="tags/$(TAG)"; \
co="export"; \
elif [ $(BRANCH) != trunk ]; then \
branchdir="branches/$(BRANCH)"; \
co="co"; \
else \
branchdir="$(BRANCH)"; \
co="co"; \
fi; \
if [ ! -d $(SVN_WC) ]; then \
svn $${co} https://svn.collab.net/repos/svn/$${branchdir} \
$(SVN_WC); \
fi
touch $@
ifeq ($(BRANCH),trunk)
BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER)
else ifeq ($(BRANCH_MAJOR),1.6)
BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER)
else
BDB_FLAG=$(PREFIX)/bdb
endif
# configure svn
$(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)/.retrieved
cd $(SVN_SRCDIR) && ./autogen.sh
cd $(svn_builddir) && \
env LDFLAGS="-L$(PREFIX)/neon/lib -L$(PREFIX)/apr/lib" \
LD_LIBRARY_PATH="$(PREFIX)/bdb/lib:$$LD_LIBRARY_PATH" \
$(SVN_SRCDIR)/configure \
--enable-maintainer-mode \
--with-ssl \
--prefix="$(SVN_PREFIX)" \
--with-apr="$(PREFIX)/apr" \
--with-apr-util="$(PREFIX)/apr" \
--with-apxs="$(PREFIX)/httpd/bin/apxs" \
--with-apache-libexecdir=$(PREFIX)/httpd/modules/svn-$(WC) \
--with-neon="$(PREFIX)/neon" \
--with-serf="$(PREFIX)/serf" \
--with-sqlite="$(PREFIX)/sqlite" \
--with-berkeley-db="$(BDB_FLAG)" \
--with-sasl="no" \
--with-ruby-sitedir="$(SVN_PREFIX)/lib/ruby/site_ruby" \
--disable-mod-activation
touch $@
# compile svn
$(SVN_OBJDIR)/.compiled: $(SVN_OBJDIR)/.configured
cd $(svn_builddir) \
&& make
touch $@
# install svn
$(SVN_OBJDIR)/.installed: $(SVN_OBJDIR)/.compiled
cd $(svn_builddir) \
&& make install
touch $@
$(SVN_OBJDIR)/.bindings-compiled: $(SVN_OBJDIR)/.installed
cd $(svn_builddir) \
&& make swig-py \
&& make swig-rb \
&& make swig-pl
touch $@
$(SVN_OBJDIR)/.bindings-installed: $(SVN_OBJDIR)/.bindings-compiled
cd $(svn_builddir) \
&& make install-swig-py \
&& make install-swig-rb \
&& make install-swig-pl-lib
cd $(svn_builddir)/subversion/bindings/swig/perl/native \
&& perl Makefile.PL PREFIX="$(SVN_PREFIX)" \
&& make install
touch $@
# run svn regression tests
HTTPD_CHECK_CONF=$(PREFIX)/httpd/conf/httpd-svn-check-$(WC).conf
HTTPD_CHECK_USERS=$(PREFIX)/httpd/conf/httpd-svn-check-users
HTTPD_CHECK_PORT=8081
httpd-conf:
echo "jrandom:xCGl35kV9oWCY" > $(HTTPD_CHECK_USERS)
echo "jconstant:xCGl35kV9oWCY" >> $(HTTPD_CHECK_USERS)
echo "# httpd config for make check" > $(HTTPD_CHECK_CONF)
echo "ServerRoot \"$(PREFIX)/httpd\"" >> $(HTTPD_CHECK_CONF)
echo "Listen localhost:$(HTTPD_CHECK_PORT)" >> $(HTTPD_CHECK_CONF)
echo "LoadModule dav_svn_module modules/svn-$(WC)/mod_dav_svn.so" >> $(HTTPD_CHECK_CONF)
echo "LoadModule authz_svn_module modules/svn-$(WC)/mod_authz_svn.so" >> $(HTTPD_CHECK_CONF)
echo "DocumentRoot "$(PREFIX)/httpd/htdocs"" >> $(HTTPD_CHECK_CONF)
echo "" >> $(HTTPD_CHECK_CONF)
echo " Options FollowSymLinks" >> $(HTTPD_CHECK_CONF)
echo " AllowOverride None" >> $(HTTPD_CHECK_CONF)
echo " Order deny,allow" >> $(HTTPD_CHECK_CONF)
echo " Allow from all" >> $(HTTPD_CHECK_CONF)
echo "" >> $(HTTPD_CHECK_CONF)
echo "" >> $(HTTPD_CHECK_CONF)
echo " DAV svn" >> $(HTTPD_CHECK_CONF)
echo " SVNParentPath $(SVN_WC)/subversion/tests/cmdline/svn-test-work/repositories" >> $(HTTPD_CHECK_CONF)
echo " AuthzSVNAccessFile $(SVN_WC)/subversion/tests/cmdline/svn-test-work/authz" >> $(HTTPD_CHECK_CONF)
echo " AuthType Basic" >> $(HTTPD_CHECK_CONF)
echo " AuthName \"Subversion Repository\"" >> $(HTTPD_CHECK_CONF)
echo " AuthUserFile $(HTTPD_CHECK_USERS)" >> $(HTTPD_CHECK_CONF)
echo " Require valid-user" >> $(HTTPD_CHECK_CONF)
echo "" >> $(HTTPD_CHECK_CONF)
echo "" >> $(HTTPD_CHECK_CONF)
echo " DAV svn" >> $(HTTPD_CHECK_CONF)
echo " SVNPath $(SVN_WC)/subversion/tests/cmdline/svn-test-work/local_tmp/repos" >> $(HTTPD_CHECK_CONF)
echo " AuthzSVNAccessFile $(SVN_WC)/subversion/tests/cmdline/svn-test-work/authz" >> $(HTTPD_CHECK_CONF)
echo " AuthType Basic" >> $(HTTPD_CHECK_CONF)
echo " AuthName \"Subversion Repository\"" >> $(HTTPD_CHECK_CONF)
echo " AuthUserFile $(HTTPD_CHECK_USERS)" >> $(HTTPD_CHECK_CONF)
echo " Require valid-user" >> $(HTTPD_CHECK_CONF)
echo "" >> $(HTTPD_CHECK_CONF)
# We need this to make sure some targets below pick up the right libraries
LD_LIBRARY_PATH=$(PREFIX)/apr/lib:$(PREFIX)/bdb/lib:$(PREFIX)/neon/lib:$(PREFIX)/serf/lib:$(PREFIX)/sqlite/lib:$(PREFIX)/svn-$(WC)/lib
svn-check-neon: httpd-conf $(SVN_OBJDIR)/.compiled $(SVN_OBJDIR)/.bindings-compiled
env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(PREFIX)/httpd/bin/apachectl \
-f conf/httpd-svn-check-$(WC).conf -k start
cd $(svn_builddir) && make check FS_TYPE=fsfs \
BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=neon
cd $(svn_builddir) && make check FS_TYPE=bdb \
BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=neon
$(PREFIX)/httpd/bin/apachectl -f conf/httpd-svn-check-$(WC).conf \
-k stop
svn-check-serf: httpd-conf $(SVN_OBJDIR)/.compiled $(SVN_OBJDIR)/.bindings-compiled
env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(PREFIX)/httpd/bin/apachectl \
-f conf/httpd-svn-check-$(WC).conf -k start
cd $(svn_builddir) && make check FS_TYPE=fsfs \
BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=serf
cd $(svn_builddir) && make check FS_TYPE=bdb \
BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=serf
$(PREFIX)/httpd/bin/apachectl -f conf/httpd-svn-check-$(WC).conf \
-k stop
svn-check-local:
cd $(svn_builddir) && make check FS_TYPE=fsfs
cd $(svn_builddir) && make check FS_TYPE=bdb
svn-check-svn:
$(svn_builddir)/subversion/svnserve/svnserve --listen-host 127.0.0.1 \
--pid-file $(PWD)/svnserve-$(WC).pid \
-d -r $(svn_builddir)/subversion/tests/cmdline
cd $(svn_builddir) && make check FS_TYPE=fsfs BASE_URL=svn://127.0.0.1
cd $(svn_builddir) && make check FS_TYPE=bdb BASE_URL=svn://127.0.0.1
kill `cat $(PWD)/svnserve-$(WC).pid`
.PHONY: svn-check-swig-pl svn-check-swig-py svn-check-swig-rb
svn-check-swig: svn-check-swig-pl svn-check-swig-py svn-check-swig-rb
RUBYLIB=$(SVN_PREFIX)/lib/ruby/site_ruby$(shell grep \
^svn_cv_ruby_sitedir_archsuffix $(svn_builddir)/config.log | \
cut -d'=' -f2):$(SVN_PREFIX)/lib/ruby/site_ruby$(shell \
grep ^svn_cv_ruby_sitedir_libsuffix $(svn_builddir)/config.log | \
cut -d'=' -f2)
svn-check-swig-pl:
cd $(svn_builddir) && make check-swig-pl
svn-check-swig-py:
cd $(svn_builddir) && make check-swig-py
svn-check-swig-rb:
cd $(svn_builddir)/subversion/bindings/swig/ruby/test && \
env RUBYLIB=$(RUBYLIB) \
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
ruby run-test.rb --verbose=verbose
svn-check: svn-check-local svn-check-svn svn-check-neon svn-check-serf svn-check-swig