summaryrefslogtreecommitdiffstats
path: root/debian/_base/dependencies/tqt3/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/_base/dependencies/tqt3/debian/rules')
-rwxr-xr-xdebian/_base/dependencies/tqt3/debian/rules56
1 files changed, 52 insertions, 4 deletions
diff --git a/debian/_base/dependencies/tqt3/debian/rules b/debian/_base/dependencies/tqt3/debian/rules
index b83a3da10..36a8cc408 100755
--- a/debian/_base/dependencies/tqt3/debian/rules
+++ b/debian/_base/dependencies/tqt3/debian/rules
@@ -11,13 +11,27 @@ export LD_LIBRARY_PATH=$(QTDIR)/lib:$(OLD_LD_LIBRARY_PATH)
OLD_PATH := $(PATH)
export PATH=$(QTDIR)/bin:$(OLD_PATH)
+# The default gzip compressor has been changed in dpkg >= 1.17.0.
+deb_default_compress = $(shell LANG=C dpkg-deb --version | head -n1 | \
+ sed -e "s|.*version ||" -e "s| .*||" | \
+ xargs -r dpkg --compare-versions 1.17.0 lt \
+ && echo xz || echo gzip)
+ifeq ($(deb_default_compress),gzip)
DEB_DH_BUILDDEB_ARGS += -- -Z$(shell dpkg-deb --help | grep -q ":.* xz[,.]" \
&& echo xz || echo bzip2)
+endif
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DEB_TIME64_API = $(shell echo | cc $(dpkg-buildflags --get CPPFLAGS) -dM -E -x c++ - | grep -q "_TIME_BITS 64" && echo true || false)
+ifeq ($(DEB_TIME64_API),true)
+DEB_TIME64_SUFFIX = -t64
+else
+DEB_TIME64_SUFFIX =
+endif
+
# Honour "parallel=N" option of DEB_BUILD_OPTIONS. Comment out to
# never build in parallel, regardless of DEB_BUILD_OPTIONS.
DEB_BUILD_PARALLEL ?= true
@@ -37,12 +51,14 @@ endif #hurd
# build variables (directorys)
DEBIAN = $(shell pwd)/debian
-P_LIBS = $(DEBIAN)/libtqt3-mt
+P_LIBS = $(DEBIAN)/libtqt3-mt$(DEB_TIME64_SUFFIX)
P_DOC = $(DEBIAN)/tqt3-doc
P_APPSDEV = $(DEBIAN)/tqt3-apps-dev
P_HEADERS = $(DEBIAN)/libtqt3-headers
P_QTMTDEV = $(DEBIAN)/libtqt3-mt-dev
+RPC_INCLUDES = $(if $(wildcard /usr/include/tirpc),-I/usr/include/tirpc,)
+
TMP_INSTALL = $(DEBIAN)/tmp-install
CONFIGURE_OPTS = \
@@ -102,6 +118,8 @@ CONFIGURE_OPTS = \
-I/usr/include/freetype2 \
-I`pg_config --includedir` \
-I`pg_config --includedir-server` \
+ $(RPC_INCLUDES) \
+ \
-L/usr/lib/$(DEB_HOST_MULTIARCH)\
\
-lfontconfig \
@@ -128,6 +146,22 @@ endif
post-patches::
dh_testdir
+ifeq ($(DEB_TIME64_API),true)
+ # update library package name for TIME64 ABI
+ ls -d debian/* | \
+ grep -E "/libtqt3-mt\." | \
+ grep -v "\.t64$$" | \
+ while read a; do \
+ [ -d $$a ] || [ -f $$a.t64 ] || \
+ (cp -a $$a debian/libtqt3-mt$(DEB_TIME64_SUFFIX).$${a##*.} && mv $$a $$a.t64); \
+ done
+ [ -f debian/control.t64 ] || \
+ sed -i.t64 \
+ -e "s/^\\(Package: libtqt3-mt\\)$$/\\1$(DEB_TIME64_SUFFIX)/" \
+ -e "s/^\\(Replaces\\|Breaks\\): \\(libtqt3-mt\\)\\( \|$$\)/\\1: \\2, \\2$(DEB_TIME64_SUFFIX)\\3/" \
+ -e "s/\\(libtqt3-mt\\) (=/\\1$(DEB_TIME64_SUFFIX) (=/" \
+ debian/control
+endif
build build-arch: libqt-thread-stamp
build-indep:
@@ -151,7 +185,6 @@ libqt-thread-stamp: post-patches
# archives get accidentally stripped by make install. Copy over unstripped ones for now.
-cp lib/lib*.a $(TMP_INSTALL)/usr/lib/
- cp bin/tqtrename140 $(TMP_INSTALL)/usr/bin/
cp bin/tqtfindtr $(TMP_INSTALL)/usr/bin/
# build tqtconv2ui
@@ -214,6 +247,20 @@ clean::
dh_clean
+ifeq ($(DEB_TIME64_API),true)
+ # revert library package name for TIME64 ABI
+ ls -d debian/* | \
+ grep -E "\.t64$$" | \
+ while read a; do \
+ mv $$a $${a%.t64}; \
+ done
+ ls -d debian/* | \
+ grep -E "/libtqt3-mt$(DEB_TIME64_SUFFIX)\." | \
+ xargs -r rm
+ [ ! -f debian/control.t64 ] || \
+ mv debian/control.t64 debian/control
+endif
+
install: build
dh_testdir
@@ -321,6 +368,7 @@ binary-indep: build install
cd `pwd`/debian/doc/ && \
find tqt3-examples/ -type f -print0 | LC_ALL=C sort -z | \
tar cvv --no-recursion --null -T - \
+ --mode=u+rw,go=rX,a-s \
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime | \
gzip -n > tqt3-examples.tar.gz
install -D `pwd`/debian/doc/tqt3-examples.tar.gz `pwd`/debian/tqt3-examples/usr/share/doc/tqt3-examples/tqt3-examples.tar.gz
@@ -412,7 +460,7 @@ binary-arch: build install
dh_link -ptqt3-dev-tools usr/share/tqt3/doc/html usr/share/doc/tqt3-dev-tools/html
# copy README.Debian
- for a in libtqt3-mt-dev libtqt3-mt tqt3-doc; do install -D `pwd`/debian/README.Debian `pwd`/debian/"$$a"/usr/share/doc/"$$a"/README.Debian; done
+ for a in libtqt3-mt-dev libtqt3-mt$(DEB_TIME64_SUFFIX) tqt3-doc; do install -D `pwd`/debian/README.Debian `pwd`/debian/"$$a"/usr/share/doc/"$$a"/README.Debian; done
# install the qmake binary
rm -rf `pwd`/debian/tqt3-dev-tools/usr/bin/tqmake
@@ -449,7 +497,7 @@ binary-arch: build install
dh_makeshlibs -a $(IBASE) -V
dh_installdeb -a $(IBASE)
dh_perl -a $(IBASE)
- dh_shlibdeps -a $(IBASE) -l`pwd`/debian/libtqt3-mt/usr/lib
+ dh_shlibdeps -a $(IBASE) -l`pwd`/debian/libtqt3-mt$(DEB_TIME64_SUFFIX)/usr/lib
# fix shlibdeps madness
for a in `find debian/ -name '*.substvars'`; do cat "$$a" | sed 's/, xlibs (>> 4.1.0)//g' > "$$a".new && mv "$$a.new" "$$a"; done