[Pkg-php-commits] [php/debian-experimental] Detect the path to ltmain.sh at build time and set conflicts appropriately
Raphael Geissert
atomo64 at gmail.com
Wed Jun 24 22:39:22 UTC 2009
Since version 2.2 libtool ships ltmain.sh under /usr/share/libtool/config,
which lead to broken symlinks. debian/rules will now try to find the right
path at build time and add a conflict on pre 2.2 versions of libtool if
the path is usr/share/libtool/config, or a conflict on version 2.2 or higher
if the path is usr/share/libtool, to avoid issues when backporting.
Thanks to Martin Meredith for the report, closes: #524163
---
debian/control | 1 +
debian/rules | 16 ++++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/debian/control b/debian/control
index 1c1f6c5..f39d46d 100644
--- a/debian/control
+++ b/debian/control
@@ -116,6 +116,7 @@ Description: command-line interpreter for the php5 scripting language
Package: php5-dev
Depends: autoconf, automake1.4, libssl-dev, libtool, shtool, php5-common (>= ${binary:Version})
+Conflicts: ${libtool:Conflicts}
Architecture: any
Description: Files for PHP5 module development
This package provides the files from the PHP5 source needed for compiling
diff --git a/debian/rules b/debian/rules
index 20a5857..58d4add 100755
--- a/debian/rules
+++ b/debian/rules
@@ -59,6 +59,15 @@ ifeq ($(wildcard /usr/share/file/magic.mime), /usr/share/file/magic.mime)
MAGIC_MIME = /usr/share/file/magic.mime
endif
+LTMAIN_DIR=$(shell dpkg -L libtool | sed -n 's,/ltmain\.sh$$,,g;T;s,^/usr/,,;p')
+ifeq ($(LTMAIN_DIR), share/libtool)
+LIBTOOL_CONFLICTS:=libtool (>= 2.2)
+else ifeq ($(LTMAIN_DIR), share/libtool/config)
+LIBTOOL_CONFLICTS:=libtool (<< 2.2)
+else
+LIBTOOL_CONFLICTS:=
+endif
+
# only enable interbase support for i386/amd64/powerpc/sparc
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386 powerpc sparc))
IBFLAGS=--with-interbase=shared,/usr \
@@ -438,15 +447,16 @@ install: build
for i in Makefile.global acinclude.m4 mkdep.awk phpize.m4 scan_makefile_in.awk; do \
chmod 644 debian/php5-dev/usr/lib/php5/build/$$i; \
done
+ [ "$(LTMAIN_DIR)" ] || { echo "Could not determine the path to ltmain.sh" >&2 ; exit ; }
# shipping duplicate files from other packages is hell for security audits
rm debian/php5-dev/usr/lib/php5/build/config.guess && \
ln -s ../../../share/misc/config.guess debian/php5-dev/usr/lib/php5/build/config.guess
rm debian/php5-dev/usr/lib/php5/build/config.sub && \
ln -s ../../../share/misc/config.sub debian/php5-dev/usr/lib/php5/build/config.sub
rm debian/php5-dev/usr/lib/php5/build/libtool.m4 && \
- ln -s ../../../share/libtool/libtool.m4 debian/php5-dev/usr/lib/php5/build/libtool.m4
+ ln -s ../../../share/aclocal/libtool.m4 debian/php5-dev/usr/lib/php5/build/libtool.m4
rm debian/php5-dev/usr/lib/php5/build/ltmain.sh && \
- ln -s ../../../share/libtool/ltmain.sh debian/php5-dev/usr/lib/php5/build/ltmain.sh
+ ln -s ../../../$(LTMAIN_DIR)/ltmain.sh debian/php5-dev/usr/lib/php5/build/ltmain.sh
rm debian/php5-dev/usr/lib/php5/build/shtool && \
ln -s ../../../bin/shtool debian/php5-dev/usr/lib/php5/build/shtool
# make php-dev stuff versioned
@@ -582,6 +592,8 @@ binary-arch: build install
echo "apache2:Depends=apache2-mpm-prefork (>> 2.0.52) | apache2-mpm-itk, apache2.2-common" >>debian/libapache2-mod-php5.substvars
echo "apache2:Depends=apache2-mpm-prefork (>> 2.0.52) | apache2-mpm-itk, apache2.2-common" >>debian/libapache2-mod-php5filter.substvars
+
+ echo "libtool:Conflicts=$(LIBTOOL_CONFLICTS)" >>debian/php5-dev.substvars
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
--
1.5.6.5
More information about the Pkg-php-commits
mailing list