summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
authorAron Xu <aron@debian.org>2012-04-18 15:58:48 +0800
committerAron Xu <aron@debian.org>2012-04-23 00:25:41 +0800
commit4281fb7adc1b49f8038085cd294327a4338b7082 (patch)
tree23d0bb5616d39b6e757f5ecaabf58cfb61b156fd /debian/rules
parent6205aa529c62396b509525bc4283e765ae0ebee8 (diff)
downloadlibxml2-4281fb7adc1b49f8038085cd294327a4338b7082.tar.gz
Port existing patch to quilt.
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules58
1 files changed, 31 insertions, 27 deletions
diff --git a/debian/rules b/debian/rules
index 832457c..1b4999d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,7 +12,7 @@ LDFLAGS = `dpkg-buildflags --get LDFLAGS` -Wl,--as-needed
CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -fno-strict-aliasing
+ CFLAGS += -fno-strict-aliasing
endif
TARGETS := main $(PYVERS) $(PYVERS:%=%-dbg)
@@ -29,38 +29,40 @@ endif
CONFIGURE_FLAGS := --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/build/config.cache"
-override_dh_auto_configure: $(TARGETS:%=configure-%)
+override_dh_auto_configure: $(TARGETS:%=doconfigure-%)
-configure-%:
+doconfigure-%:
dh_auto_configure --builddirectory=build/$* -- $(CONFIGURE_FLAGS)
-configure-main: CONFIGURE_FLAGS += --without-python --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
-configure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$*
-configure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output
+doconfigure-main: CONFIGURE_FLAGS += --without-python --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
+doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$*
+doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output
-override_dh_auto_build: $(TARGETS:%=build-%)
+override_dh_auto_build: $(TARGETS:%=dobuild-%)
-build-%: BUILD_DIR=build/$*
-build-%:
+dobuild-%: BUILD_DIR=build/$*
+dobuild-%: doconfigure-%
$(if $(filter $(BUILD_DIR),build/$*),,[ -d $(BUILD_DIR) ] || mv build/$*/python $(BUILD_DIR))
dh_auto_build --builddirectory=$(BUILD_DIR) -- $(BUILD_FLAGS)
+ $(if $(filter build/main,$(BUILD_DIR)),make -C $(BUILD_DIR)/doc/examples rebuild)
+ #$(if $(filter build/main/python%,$(BUILD_DIR)),make -C $(BUILD_DIR)/tests tests)
-build-python%: BUILD_DIR=build/main/$*
-build-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)'
-build-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) \
+dobuild-python%: BUILD_DIR=build/main/$*
+dobuild-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)'
+dobuild-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) \
LDFLAGS="-L$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)" CFLAGS="-Wall -g -O0"
+build-arch: $(TARGETS:%=dobuild-%)
+build-indep:
+build: build-arch build-indep
override_dh_auto_clean:
- rm -rf build debian/tmp-dbg
+ rm -rf build debian/tmp-dbg debian/tmp-udeb
+ dh_auto_clean
- -test -r /usr/share/misc/config.sub && \
- cp -f /usr/share/misc/config.sub config.sub
- -test -r /usr/share/misc/config.guess && \
- cp -f /usr/share/misc/config.guess config.guess
-
-override_dh_auto_install: $(TARGETS:%=install-%)
+override_dh_auto_install: $(TARGETS:%=doinstall-%)
+ find debian/ -name *.la -delete
-install-main:
+doinstall-main:
dh_auto_install --builddirectory=build/main
mv debian/tmp/usr/share/aclocal/libxml.m4 debian/tmp/usr/share/aclocal/libxml2.m4
@@ -74,20 +76,20 @@ install-main:
install -m 644 \
doc/examples/*.c \
doc/examples/*.res \
- doc/examples/index.html \
+ build/main/doc/examples/index.html \
doc/examples/[tw]*.xml debian/tmp/usr/share/doc/libxml2-doc/examples
cp -a \
doc/html \
doc/tutorial debian/tmp/usr/share/doc/libxml2-doc
-install-python%-dbg:
+doinstall-python%-dbg:
$(MAKE) -C build/main/python$*-dbg DESTDIR=$(CURDIR)/debian/tmp-dbg install-pythonLTLIBRARIES
prename 's/(?<!_d)\.so$$/_d.so/' debian/tmp-dbg/usr/lib/python$*/*-packages/*.so
-install-python%:
+doinstall-python%:
dh_auto_install --builddirectory=build/main/python$*
-install-udeb:
+doinstall-udeb:
dh_auto_install --builddirectory=build/udeb --destdir=debian/tmp-udeb
override_dh_installdocs:
@@ -105,11 +107,10 @@ override_dh_install:
dh_install -Npython-libxml2-dbg -Nlibxml2-udeb
dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg
dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb
- #sed "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/libxml2.la > debian/libxml2-dev/usr/lib/libxml2.la
- find debian/ -name *.la -delete
override_dh_strip:
- dh_strip -a --dbg-package=libxml2-dbg -Npython-libxml2 -Npython-libxml2-dbg
+ dh_strip -a --dbg-package=libxml2-dbg -Nlibxml2-udeb -Nlibxml2-utils -Nlibxml2-utils-dbg -Npython-libxml2 -Npython-libxml2-dbg
+ dh_strip -plibxml2-utils --dbg-package=libxml2-utils-dbg
dh_strip -ppython-libxml2 --dbg-package=python-libxml2-dbg
$(foreach python, $(filter-out $(PYVER), $(PYVERS)),\
cd $(CURDIR)/debian/python-libxml2/usr/lib/pyshared; \
@@ -117,9 +118,12 @@ override_dh_strip:
rm -f $(python)/libxml2mod.so; \
ln -s ../$(PYVER)/libxml2mod.so $(python)/libxml2mod.so; \
fi;)
+ dh_strip
override_dh_makeshlibs:
dh_makeshlibs -a $(if $(WITH_UDEB),--add-udeb=libxml2-udeb )-V 'libxml2 (>= 2.7.4)' -- -c4
%:
dh $@ --with autoreconf --with python2
+
+