summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules306
1 files changed, 97 insertions, 209 deletions
diff --git a/debian/rules b/debian/rules
index 3642d1a..c59af6b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,7 @@
# with-javahl, no-javahl |
# with-apache, no-apache | enable/disable certain packages
# with-ruby, no-ruby |
+# with-python, no-python |
include /usr/share/dpkg/architecture.mk
@@ -31,28 +32,25 @@ ifneq (,$(filter $(DEB_HOST_ARCH), $(DISABLE_JAVAHL_ARCHS)))
ENABLE_JAVAHL =
endif
-ifeq (,$(filter libsvn-java,$(shell dh_listpackages)))
- ENABLE_JAVAHL =
-endif
-
-# We may need to disable libapache2-mod-svn and/or libsvn-ruby*.
ENABLE_APACHE = yes
ENABLE_RUBY = yes
-# Disable packaging python2 bindings if swig4 is installed
-ifeq (,$(filter 4%,$(shell dpkg-query -W -f '$${Version}' swig 2>/dev/null)))
- ENABLE_PYTHON = yes
-else
- ENABLE_PYTHON = no
-endif
+ENABLE_PYTHON = yes
DEB_BUILDDIR = $(CURDIR)/BUILD
-MAKE_B = $(MAKE) -C $(DEB_BUILDDIR)
AUTH_LIB_DIRS = $(DEB_BUILDDIR)/subversion/libsvn_auth_gnome_keyring/.libs:$(DEB_BUILDDIR)/subversion/libsvn_auth_kwallet/.libs
BASH_COMPL_DIR = $(shell pkg-config --variable=completionsdir bash-completion)
export LANG = C
export HOME = $(DEB_BUILDDIR)/dummy_home
+ifeq (,$(filter libsvn-java,$(shell dh_listpackages)))
+ ENABLE_JAVAHL =
+endif
+
+ifeq (,$(filter ruby-svn,$(shell dh_listpackages)))
+ ENABLE_RUBY =
+endif
+
# ENABLE_FOO -> DEB_OPT_WITH_FOO=1
# DEB_BUILD_OPTIONS='foo bar' -> DEB_OPT_FOO=1, DEB_OPT_BAR=1
# DEB_BUILD_OPTIONS='no-foo' -> DEB_OPT_WITH_FOO=""
@@ -65,27 +63,30 @@ $(foreach o, $(filter NO_%,$(d_b_o)), $(eval DEB_OPT_$(subst NO_,WITH_,$o) :=))
$(if $(DEB_OPT_PARALLEL),$(eval MAKEFLAGS += -j$(DEB_OPT_PARALLEL)))
ifndef DEB_OPT_TERSE
- MAKE_B += LTFLAGS="--tag=CC" LTCXXFLAGS="--tag=CXX"
+ export LTFLAGS = --tag=CC
+ export LTCXXFLAGS = --tag=CXX
endif
+export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+
# How to fix "#!/usr/bin/env " lines: $(call fix_shebangs_in, /your/dir)
fix_shebangs_in = \
find $1 -type f | xargs -r egrep -m1 -c '^\#! ?/' | sed -n 's/:1//p' |\
xargs -r sed -i -e 's:^\#! */usr/bin/env perl.*:\#!/usr/bin/perl -w:' \
- -e 's:^\#! */usr/bin/env pyth.*:\#!/usr/bin/python:' \
+ -e 's:^\#! */usr/bin/env pyth.*:\#!/usr/bin/python3:' \
-e 's:^\#! */usr/bin/env ruby.*:\#!/usr/bin/$(RUBY):'
PERL_DIR = $(DEB_BUILDDIR)/subversion/bindings/swig/perl/native
PY_DIR = $(DEB_BUILDDIR)/subversion/bindings/swig/python
-PYVERSIONS = $(shell pyversions -vs)
-PYDEFAULT =$(shell pyversions -vd)
+PYVERSIONS = $(shell py3versions -vs)
+PYDEFAULT =$(shell py3versions -vd)
allpy = \
set -e; for v in $(PYVERSIONS); do \
$(RM) $(PY_DIR); \
ln -sfT python$$v $(PY_DIR); \
pyinc=$$(python$$v-config --includes); \
- pylib=$$(python$$v -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \
+ pylib=$$(python$$v -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())'); \
$1; \
ln -sfT python$(PYDEFAULT) $(PY_DIR); \
done
@@ -95,9 +96,6 @@ libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
MIN_SQLITE_VER = 3.8.7
confflags = \
- --prefix=/usr \
- --libdir=$(libdir) \
- --mandir=\$${prefix}/share/man \
--with-apr=/usr \
--with-apr-util=/usr \
--with-serf=/usr \
@@ -105,14 +103,9 @@ confflags = \
--with-berkeley-db=:::db \
--with-sasl=/usr \
--with-editor=/usr/bin/editor \
- --with-ruby-sitedir=/usr/lib/ruby \
--with-swig=/usr/bin/swig \
--with-lz4 \
--with-utf8proc \
- CFLAGS="$(CFLAGS)" \
- CXXFLAGS="$(CXXFLAGS)" \
- CPPFLAGS="$(CPPFLAGS)" \
- LDFLAGS="$(LDFLAGS)" \
--with-gnome-keyring
ifdef DEB_OPT_DEBUG
@@ -146,16 +139,17 @@ ifdef DEB_OPT_WITH_RUBY
RUBY_ARCH_DIR = $(shell $(RUBY) -rrbconfig -e "print RbConfig::CONFIG['vendorarchdir']")
rb_defs = SWIG_RB_SITE_LIB_DIR=$(shell $(RUBY) -rrbconfig -e "print RbConfig::CONFIG['vendordir']")
rb_defs += SWIG_RB_SITE_ARCH_DIR=$(RUBY_ARCH_DIR)
+ confflags += --with-ruby-sitedir=/usr/lib/ruby
else
DH_OPTIONS += -Nruby-svn
RUBY = fooby
endif
ifdef DEB_OPT_WITH_PYTHON
- PYTHON = python
+ PYTHON = python3
else
- DH_OPTIONS += -Npython-subversion
- PYTHON = foothon
+ DH_OPTIONS += -Npython3-subversion
+ PYTHON = foothon3
endif
# Set autoconf cross-compile mode correctly.
@@ -183,27 +177,22 @@ define DONT_BE_ROOT
fi
endef
-debian/stamp-autogen:
+%:
+ dh $@ --with python3 --with apache2 --builddirectory=BUILD
+
+override_dh_update_autotools_config:
$(DONT_BE_ROOT)
dh_update_autotools_config
./autogen.sh
- touch $@
-
-debian/stamp-configure: debian/stamp-autogen
- dh_testdir
-
- mkdir -p $(DEB_BUILDDIR) $(HOME)
- cd $(DEB_BUILDDIR) && \
- PYTHON=/usr/bin/$(PYTHON) \
- RUBY=/usr/bin/$(RUBY) \
- $(CURDIR)/configure $(confflags) || (cat $(DEB_BUILDDIR)/config.log; false)
-
- # Subversion upstream ships with Swig 1.3.25 pregenerated
- # files, which may interact badly with the build if Debian swig
- # is not version 1.3.25 - particularly with swig 1.3.24.
- # Thus we unconditionally delete the pregenerated files.
- +$(MAKE_B) mkdir-init
- +$(MAKE_B) extraclean-bindings
+
+override_dh_auto_configure:
+ mkdir -p $(HOME)
+ env PYTHON=/usr/bin/$(PYTHON) RUBY=/usr/bin/$(RUBY) dh_auto_configure --builddirectory=BUILD -- $(confflags)
+
+ # Ensure we're able to regenerate the swig bindings, in case we need to
+ # patch them.
+ $(MAKE) -C $(DEB_BUILDDIR) mkdir-init
+ $(MAKE) -C $(DEB_BUILDDIR) extraclean-bindings
ifdef DEB_OPT_WITH_PYTHON
for v in $(PYVERSIONS); do \
cp -la $(PY_DIR) $(PY_DIR)$$v; \
@@ -214,143 +203,93 @@ ifdef DEB_OPT_WITH_PYTHON
ln -sfT python$(PYDEFAULT) $(PY_DIR)
endif
- touch $@
-
-build: debian/stamp-build-arch debian/stamp-build-indep
-
check_defs = CLEANUP=1 LC_ALL=C
check_swig = $(if $(DEB_OPT_WITH_PYTHON),check-swig-py) check-swig-pl $(if $(DEB_OPT_WITH_RUBY),check-swig-rb)
check_all = $(check_swig) $(if $(DEB_OPT_WITH_JAVAHL),check-javahl) check
check-help:
@echo "$(MAKE) $(check_all)"
-check check-swig-rb check-javahl: debian/stamp-build-arch
- +$(MAKE_B) $@ $(check_defs)
+override_dh_auto_test-indep:
+
+override_dh_auto_test-arch:
+ifndef DEB_OPT_NOCHECK
+ $(MAKE) -f debian/rules $(check_all)
+endif
-check-swig-pl: debian/stamp-build-arch
- +$(MAKE_B) $@ MAN3EXT=3perl $(check_defs)
+check:
+ # 'cat tests.log' is for obtaining diagnostics from buildd logs.
+ @if ! $(MAKE) -C $(DEB_BUILDDIR) $@ $(check_defs) PARALLEL=$(DEB_OPT_PARALLEL); then \
+ echo "###################################################"; \
+ echo "Testsuite failed, 'tests.log' follows:"; echo; \
+ cat $(DEB_BUILDDIR)/tests.log; \
+ exit 1; \
+ fi
+
+check-swig-rb check-javahl:
+ $(MAKE) -C $(DEB_BUILDDIR) $@ $(check_defs) PARALLEL=$(DEB_OPT_PARALLEL)
+
+check-swig-pl:
+ $(MAKE) -C $(DEB_BUILDDIR) $@ MAN3EXT=3perl $(check_defs)
$(MAKE) -C $(PERL_DIR) test MAN3EXT=3perl LC_ALL=C
-check-swig-py: debian/stamp-build-arch
+check-swig-py:
$(call allpy, \
- $(MAKE_B) $@ PYTHON=python$$v PYVER=$$v $(check_defs))
+ $(MAKE) -C $(DEB_BUILDDIR) $@ PYTHON=python$$v PYVER=$$v $(check_defs))
-build-arch: debian/stamp-build-arch
-debian/stamp-build-arch: debian/stamp-configure
- dh_testdir
+override_dh_auto_build-arch:
$(DONT_BE_ROOT)
-
# note: autogen-swig does not support -jN
ifdef DEB_OPT_WITH_PYTHON
- $(call allpy, $(MAKE_B) -j1 autogen-swig)
+ $(call allpy, $(MAKE) -C $(DEB_BUILDDIR) -j1 autogen-swig)
endif
- +$(MAKE_B) all tools
+ $(MAKE) -C $(DEB_BUILDDIR) all tools
# Run svn once, to make sure it populates $(HOME)/.subversion/*
env LD_LIBRARY_PATH="$(AUTH_LIB_DIRS):$(LD_LIBRARY_PATH)" $(DEB_BUILDDIR)/subversion/svn/svn --version > /dev/null
ifdef DEB_OPT_WITH_PYTHON
$(call allpy, \
- $(MAKE_B) swig-py PYTHON=python$$v PYVER=$$v \
+ $(MAKE) -C $(DEB_BUILDDIR) swig-py PYTHON=python$$v PYVER=$$v \
PYTHON_INCLUDES="$$pyinc" \
swig_pydir=$$pylib/libsvn swig_pydir_extra=$$pylib/svn)
endif
# note: swig-pl seems to have trouble with -jN
- +$(MAKE_B) -j1 swig-pl MAN3EXT=3perl
+ $(MAKE) -C $(DEB_BUILDDIR) -j1 swig-pl MAN3EXT=3perl
$(MAKE) -C $(PERL_DIR) all \
MAN3EXT=3perl OPTIMIZE="-g -Wall $(CFLAGS)"
ifdef DEB_OPT_WITH_RUBY
- +$(MAKE_B) swig-rb $(rb_defs)
+ $(MAKE) -C $(DEB_BUILDDIR) swig-rb $(rb_defs)
endif
ifdef DEB_OPT_WITH_JAVAHL
- +$(MAKE_B) -j1 javahl
+ $(MAKE) -C $(DEB_BUILDDIR) -j1 javahl
endif
- # Need to touch the stamp file here so the check-* targets
- # don't try to build this target again
- touch $@
-
-ifndef DEB_OPT_NOCHECK
- @echo "###################################################"
- @echo "Running testsuite - may take a while. To disable,"
- @echo "use DEB_BUILD_OPTIONS=nocheck or edit debian/rules."
- @echo
- $(MAKE) -f debian/rules $(check_swig)
-
- ifdef DEB_OPT_WITH_JAVAHL
- # This fails on current free JVMs, according to Blair Zajac.
- # Thus the "-" prefix, to ignore failure, for now.
- -$(MAKE) -f debian/rules check-javahl
- endif
-
- # Run 'check' last, as it takes longest. 'cat tests.log' is for
- # obtaining diagnostics from buildd logs.
- @if ! $(MAKE) -f debian/rules check; then \
- echo "###################################################"; \
- echo "Testsuite failed, 'tests.log' follows:"; echo; \
- cat $(DEB_BUILDDIR)/tests.log; \
- exit 1; \
- fi
-endif
- touch $@
-
-build-indep: debian/stamp-build-indep
-debian/stamp-build-indep: debian/stamp-configure
+override_dh_auto_build-indep:
mkdir -p $(DEB_BUILDDIR)/doc/doxygen
- +$(MAKE_B) doc-api
- +$(MAKE_B) locale-gnu-pot
- touch $@
-
-clean:
- dh_testdir
- dh_clean
- ! [ -f $(DEB_BUILDDIR)/Makefile ] || $(MAKE_B) extraclean-bindings distclean
- $(RM) -r $(DEB_BUILDDIR)
+ dh_auto_build --builddirectory=BUILD -- doc-api locale-gnu-pot
+
+override_dh_auto_clean:
+ ! [ -f $(DEB_BUILDDIR)/Makefile ] || $(MAKE) -C $(DEB_BUILDDIR) extraclean
+ dh_auto_clean --builddirectory=BUILD
$(RM) -r subversion/bindings/swig/ruby/test/.test-result
- $(RM) build-outputs.mk gen-make.opts subversion/svn_private_config.h.in
- $(RM) build/transform_libtool_scripts.sh
- $(RM) subversion/libsvn_fs_fs/rep-cache-db.h subversion/libsvn_fs_x/rep-cache-db.h
- $(RM) subversion/libsvn_client/libsvn_client.pc.in subversion/libsvn_ra/libsvn_ra.pc.in
- $(RM) subversion/libsvn_subr/internal_statements.h subversion/libsvn_subr/errorcode.inc subversion/libsvn_subr/config_keys.inc
- $(RM) subversion/libsvn_wc/wc-queries.h subversion/tests/libsvn_wc/wc-test-queries.h
find -name \*.pyc -exec $(RM) {} +
# these are (re)generated by autogen.sh
- $(RM) subversion/bindings/swig/proxy/*.swg
- $(RM) configure build/ltmain.sh build/libtool.m4 build/lt*.m4
$(RM) subversion/po/subversion.pot
- $(RM) debian/stamp-*
-
-debian/stamp-install-indep: debian/stamp-build-indep
- dh_prep -i
- dh_installdirs -i
-
- dh_install -i
- dh_installdocs -i NOTICE
-
- $(RM) debian/libsvn-doc/usr/share/doc/libsvn1/html/jquery.js
- dh_installexamples -i
- $(call fix_shebangs_in, debian/*/usr/share/doc/*/examples)
- dh_installman -i
- dh_installchangelogs -i CHANGES
- dh_lintian -i
- dh_compress -i
- dh_fixperms -i
- dh_perl -i
- dh_link -i
- dh_missing -i --list-missing
+override_dh_installchangelogs:
+ dh_installchangelogs CHANGES
- touch $@
+override_dh_installdocs-indep override_dh_installdocs-arch:
+ dh_installdocs NOTICE
-debian/stamp-install-arch: debian/stamp-build-arch
- dh_prep -a
- dh_installdirs -a
+override_dh_auto_install-indep:
- $(MAKE_B) -j1 local-install install-tools \
+PRIVATE_LIBS = auth_gnome_keyring auth_kwallet fs_base fs_fs fs_util fs_x ra_local ra_serf swig_perl $(foreach v, $(PYVERSIONS), swig_py$(v)) swig_ruby
+override_dh_auto_install-arch:
+ $(MAKE) -C $(DEB_BUILDDIR) -j1 local-install install-tools \
DESTDIR=$(CURDIR)/debian/tmp toolsdir=/usr/bin pkgconfig_dir=$(libdir)/pkgconfig
- sed -i 's:/usr/lib/\([^/]*/\)?lib\([^ ]*\).la:-l\1:g' debian/tmp/usr/lib/*/*.la
ifdef DEB_OPT_WITH_PYTHON
$(call allpy, \
- $(MAKE_B) install-swig-py DESTDIR=$(CURDIR)/debian/tmp \
+ $(MAKE) -C $(DEB_BUILDDIR) install-swig-py DESTDIR=$(CURDIR)/debian/tmp \
PYTHON=python$$v PYVER=$$v \
swig_pydir=$$pylib/libsvn swig_pydir_extra=$$pylib/svn)
$(RM) debian/tmp/usr/lib/python*/*-packages/libsvn/*.la
@@ -358,43 +297,35 @@ ifdef DEB_OPT_WITH_PYTHON
endif
ifdef DEB_OPT_WITH_JAVAHL
- $(MAKE_B) install-javahl install-javahl-java \
+ $(MAKE) -C $(DEB_BUILDDIR) install-javahl install-javahl-java \
DESTDIR=$(CURDIR)/debian/tmp \
javahl_javadir=/usr/share/java \
javahl_javahdir=/usr/include/svn-javahl
endif
- $(MAKE_B) install-swig-pl-lib \
+ $(MAKE) -C $(DEB_BUILDDIR) install-swig-pl-lib \
DESTDIR=$(CURDIR)/debian/tmp
$(MAKE) -C $(PERL_DIR) install \
MAN3EXT=3perl DESTDIR=$(CURDIR)/debian/tmp INSTALLDIRS=vendor
ifdef DEB_OPT_WITH_RUBY
- $(MAKE_B) install-swig-rb $(rb_defs) \
+ $(MAKE) -C $(DEB_BUILDDIR) install-swig-rb $(rb_defs) \
DESTDIR=$(CURDIR)/debian/tmp
- find debian/tmp$(RUBY_ARCH_DIR) \( -name \*.a -o -name \*.la \) -exec $(RM) {} +
- dh_install --autodest -pruby-svn debian/tmp$(RUBY_ARCH_DIR)
endif
- rm -f debian/tmp/usr/lib/apache2/modules/mod_dontdothat*
+ rm -f $(foreach lib, $(PRIVATE_LIBS), debian/tmp/$(libdir)/libsvn_$(lib)-1.so)
rm -f debian/tmp/usr/bin/diff*
- cd debian/tmp/$(libdir); for lib in fs auth swig; do \
- $(RM) libsvn_$${lib}_*.so libsvn_$${lib}_*.la; \
- done
- # libsvn_ra_svn is public, although deprecated, so we can't blindly
- # remove all libsvn_ra_*
- cd debian/tmp/$(libdir); \
- $(RM) libsvn_ra_serf-*.so libsvn_ra_serf-*.la \
- libsvn_ra_local-*.so libsvn_ra_local-*.la
- cd debian/tmp/$(libdir); $(RM) libsvn_swig*.a libsvnjavahl-1.a libsvnjavahl-1.la
- # Intermediate hack, until we can remove the rest of the .la files.
- sed -i "/dependency_libs/s/=.*/=''/" debian/tmp/$(libdir)/*.la
-
# There are some non-ELF files in /usr/bin, so ignore errors
chrpath --keepgoing --delete "$(CURDIR)/debian/tmp/usr/bin/"* || true
find "$(CURDIR)/debian/tmp$(libdir)" -type f -name '*.so' -exec chmod u+w '{}' + -exec chrpath --delete '{}' +
- dh_install -a
+
+override_dh_install-arch:
+ dh_install -Nruby-svn -X .in -X mailer/tests -X dontdothat -X .a -X .la
+
+ifdef DEB_OPT_WITH_RUBY
+ dh_install --autodest -pruby-svn -X .la -X .a debian/tmp$(RUBY_ARCH_DIR)
+endif
# Install files for 'subversion-tools' package.
install $(DEB_BUILDDIR)/tools/backup/hot-backup.py \
@@ -402,12 +333,6 @@ endif
install -t debian/subversion-tools/usr/share/subversion/hook-scripts \
$(DEB_BUILDDIR)/tools/hook-scripts/commit-access-control.pl
- rm debian/subversion-tools/usr/share/subversion/hook-scripts/*.in
- rm -r debian/subversion-tools/usr/share/subversion/hook-scripts/mailer/tests
-ifndef DEB_OPT_WITH_RUBY
- rm debian/subversion-tools/usr/share/subversion/hook-scripts/*.rb
-endif
-
# Fix some scripts not to use #!/usr/bin/env.
$(call fix_shebangs_in, debian/*/usr/bin \
debian/subversion-tools/usr/share/subversion/hook-scripts)
@@ -436,66 +361,29 @@ endif
&& ln -s svn svnlook \
&& ln -s svn svnversion
- dh_apache2 -a
ifdef DEB_OPT_WITH_APACHE
install subversion/mod_authz_svn/INSTALL \
debian/libapache2-mod-svn/usr/share/doc/libapache2-mod-svn/INSTALL.authz
endif
-ifdef DEB_OPT_WITH_PYTHON
- cp tools/examples/svnshell.py debian/python-subversion/usr/bin/svnshell
- $(call fix_shebangs_in, debian/python-subversion/usr/bin/svnshell)
-endif
-
- dh_installdocs -a NOTICE
- dh_installexamples -a
- $(call fix_shebangs_in, debian/*/usr/share/doc/*/examples)
- dh_installman -a
- dh_installchangelogs -a CHANGES
- dh_perl -a
-ifdef DEB_OPT_WITH_PYTHON
- dh_python2 -a
-endif
- dh_link -a
- dh_lintian -a
- dh_fixperms -a
- dh_missing -a --list-missing
-
- touch $@
-
-binary-indep: debian/stamp-install-indep
- dh_testdir
- dh_testroot
- dh_installdeb -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
-
-binary-arch: debian/stamp-install-arch
- dh_testdir
- dh_testroot
- dh_strip -a
- dh_compress -a
-
+override_dh_makeshlibs-arch:
# dh_makeshlibs (1) creates shlibs/symbols files and (2) generates
# calls to 'ldconfig' in postinst/postrm. We want (1) only for
# libsvn1, but (2) for the swig packages too.
dh_makeshlibs -a -Xjava -X_auth_ -X_ra_serf -X_ra_local -X_fs_
- $(RM) debian/libsvn-*/DEBIAN/shlibs debian/python-subversion/DEBIAN/shlibs
- $(RM) debian/libsvn-*/DEBIAN/symbols debian/python-subversion/DEBIAN/symbols
- dh_installdeb -a
+ $(RM) debian/libsvn-*/DEBIAN/shlibs debian/python3-subversion/DEBIAN/shlibs
+ $(RM) debian/libsvn-*/DEBIAN/symbols debian/python3-subversion/DEBIAN/symbols
+
+override_dh_shlibdeps-arch:
dh_shlibdeps -a -X_auth_
sed -i 's:libsvn-private\(, *\)\?::' debian/*.substvars
+
+override_dh_gencontrol-arch:
ifeq ($(DEB_VENDOR),Ubuntu)
dh_gencontrol -a -- -V"subversion-tools:Suggests=svn2cl"
else
dh_gencontrol -a -- -V"subversion-tools:Recommends=svn2cl"
endif
- dh_md5sums -a
- dh_builddeb -a
-
-binary: binary-indep binary-arch
.NOTPARALLEL:
-.PHONY: build build-arch build-indep binary binary-arch binary-indep
.PHONY: clean check-help $(check_all)