summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules58
1 files changed, 58 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..3eb3abf
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,58 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/architecture.mk
+
+export LDFLAGS := -Wl,--as-needed
+
+# list of arch for which build 32-bit library
+lib32 := illumos-amd64 kopensolaris-amd64
+
+# list of arch for which build 64-bit library
+lib64 :=
+
+variants := default
+
+ifneq (,$(filter $(DEB_HOST_ARCH), $(lib32)))
+variants += 32
+endif
+ifneq (,$(filter $(DEB_HOST_ARCH), $(lib64)))
+variants += 64
+endif
+
+configure-common := --datadir=/usr/share/xml/schema/libpool
+
+configure.32 := --libdir=\$${prefix}/lib32 CFLAGS="-m32"
+configure.64 := --libdir=\$${prefix}/lib64 CFLAGS="-m64"
+
+%:
+ dh $@
+
+override_dh_auto_configure : $(variants:%=configure-%-stamp)
+override_dh_auto_build : $(variants:%=build-%-stamp)
+override_dh_auto_install : $(variants:%=install-%-stamp)
+override_dh_auto_clean:
+ rm -rf debian/build
+
+override_dh_install:
+ dh_install --fail-missing -Xlibpool.la
+
+override_dh_strip:
+ dh_strip -plibpool2 --dbg-package=libpool2-dbg
+
+override_dh_makeshlibs:
+ dh_makeshlibs -- -c4
+
+configure-%-stamp:
+ dh_auto_configure -B debian/build/$* -- \
+ $(configure-common) $(configure.$*)
+ touch $@
+
+build-%-stamp: configure-%-stamp
+ dh_auto_build -B debian/build/$*
+ touch $@
+
+install-%-stamp: build-%-stamp
+ dh_auto_install -B debian/build/$*
+ touch $@
+
+