You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
216 lines
7.5 KiB
216 lines
7.5 KiB
13 years ago
|
#!/usr/bin/make -f
|
||
|
|
||
|
# Uncomment this to turn on verbose mode.
|
||
|
#export DH_VERBOSE=1
|
||
|
|
||
4 years ago
|
# 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)
|
||
12 years ago
|
DEB_DH_BUILDDEB_ARGS += -- -Z$(shell dpkg-deb --help | grep -q ":.* xz[,.]" \
|
||
|
&& echo xz || echo bzip2)
|
||
4 years ago
|
endif
|
||
12 years ago
|
|
||
13 years ago
|
export DH_OPTIONS
|
||
|
|
||
|
-include /usr/share/python/python.mk
|
||
|
ifeq (,$(py_sitename))
|
||
|
py_sitename = site-packages
|
||
|
py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
|
||
|
py_sitename_sh = $(py_sitename)
|
||
|
py_libdir_sh = $(py_libdir)
|
||
|
endif
|
||
|
|
||
|
|
||
2 years ago
|
DOC=$(CURDIR)/debian/pytqt-doc/usr/share/doc/pytqt-doc
|
||
13 years ago
|
INSTDIR=$(CURDIR)/debian
|
||
|
|
||
6 years ago
|
export TQTDIR=/usr/share/tqt3
|
||
|
export QMAKESPEC=$(TQTDIR)/mkspecs/linux-g++
|
||
13 years ago
|
|
||
|
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||
|
CXXFLAGS += -O0
|
||
|
else
|
||
|
CXXFLAGS += -O1
|
||
|
endif
|
||
13 years ago
|
CXXFLAGS += "-I/usr/include/tqt"
|
||
13 years ago
|
|
||
2 years ago
|
PYTHONS := $(shell pyversions -vr debian/control) $(shell py3versions -vd)
|
||
13 years ago
|
|
||
11 years ago
|
DEB_PYTHON_SYSTEM = $(if $(wildcard /usr/bin/dh_python2),,pysupport)
|
||
|
DH_PYTHON2 = $(if $(wildcard /usr/bin/dh_python2),dh_python2,dh_pysupport)
|
||
|
|
||
2 years ago
|
DEB_PARALLEL_JOBS ?= 40
|
||
13 years ago
|
|
||
|
.PRECIOUS: build-%/configure-stamp dbg-build-%/configure-stamp
|
||
|
|
||
|
configure: $(PYTHONS:%=build-%/configure-stamp) $(PYTHONS:%=dbg-build-%/configure-stamp)
|
||
2 years ago
|
|
||
13 years ago
|
build-%/configure-stamp:
|
||
|
dh_testdir
|
||
|
mkdir -p build-$*
|
||
|
cd build-$* && echo yes \
|
||
|
| python$* ../configure.py \
|
||
3 years ago
|
-c -n /usr/include/tqt3 \
|
||
2 years ago
|
-o /usr/lib/$(DEB_HOST_MULTIARCH) -u -j $(DEB_PARALLEL_JOBS) \
|
||
2 years ago
|
-d /usr/lib/python$*/$(call py_sitename,$*)/PyTQt \
|
||
13 years ago
|
-l /usr/include/python$* \
|
||
3 years ago
|
-v /usr/share/sip-tqt/tqt \
|
||
13 years ago
|
-m /usr/lib/python$*/config \
|
||
2 years ago
|
-z \
|
||
13 years ago
|
CXXFLAGS_RELEASE="" CXXFLAGS="${CXXFLAGS}" STRIP=""
|
||
|
touch $@
|
||
|
|
||
|
dbg-build-%/configure-stamp:
|
||
|
dh_testdir
|
||
|
mkdir -p dbg-build-$*
|
||
|
cd dbg-build-$* && echo yes \
|
||
|
| python$*-dbg ../configure.py \
|
||
3 years ago
|
-c -n /usr/include/tqt3 \
|
||
2 years ago
|
-o /usr/lib/$(DEB_HOST_MULTIARCH) -u -j $(DEB_PARALLEL_JOBS) \
|
||
2 years ago
|
-d /usr/lib/python$*/$(call py_sitename,$*)/PyTQt \
|
||
13 years ago
|
-l /usr/include/python$*_d \
|
||
3 years ago
|
-v /usr/share/sip-tqt/tqt \
|
||
13 years ago
|
-m /usr/lib/python$*/config_d \
|
||
2 years ago
|
-z \
|
||
13 years ago
|
CXXFLAGS_RELEASE="" CXXFLAGS="-O0 -g -I/usr/include/tqt" STRIP=""
|
||
13 years ago
|
touch $@
|
||
|
|
||
8 years ago
|
build build-arch: $(PYTHONS:%=build-%/build-stamp) $(PYTHONS:%=dbg-build-%/build-stamp)
|
||
|
build-indep:
|
||
13 years ago
|
|
||
|
build-%/build-stamp: build-%/configure-stamp
|
||
|
dh_testdir
|
||
|
$(MAKE) -C build-$*
|
||
|
touch $@
|
||
|
|
||
|
dbg-build-%/build-stamp: dbg-build-%/configure-stamp
|
||
|
dh_testdir
|
||
|
$(MAKE) -C dbg-build-$*
|
||
|
touch $@
|
||
|
|
||
|
install-indep: configure
|
||
|
dh_testdir
|
||
|
dh_testroot
|
||
|
dh_clean -k -i
|
||
|
dh_installdirs -i
|
||
|
for version in ${PYTHONS}; do\
|
||
2 years ago
|
pylib=$$(python$$version -c 'from distutils import sysconfig; print (sysconfig.get_python_lib())')/PyTQt;\
|
||
2 years ago
|
mkdir -p debian/pytqt-dev/$$pylib;\
|
||
|
install -m 644 -o root -g root build-$$version/pyqtconfig.py debian/pytqt-dev/$$pylib;\
|
||
13 years ago
|
done
|
||
|
dh_install -i
|
||
|
|
||
|
install-arch: build
|
||
|
dh_testdir
|
||
|
dh_testroot
|
||
|
dh_clean -k -a
|
||
|
dh_installdirs -a
|
||
2 years ago
|
|
||
|
for p in $(PYTHONS) ; do \
|
||
|
$(MAKE) -f debian/rules install-arch-$$p;\
|
||
13 years ago
|
done
|
||
|
|
||
|
dh_install -a --sourcedir=$(CURDIR)/debian/tmp
|
||
|
|
||
|
for i in $$(find debian/python-*-dbg -name '*.so'); do \
|
||
|
b=$$(basename $$i .so); \
|
||
|
mv $$i $$(dirname $$i)/$${b}_d.so; \
|
||
|
done
|
||
|
find debian/python-*-dbg ! -type d \
|
||
|
! \( -name '*.so' -o -name '*config_d.py' \) | xargs rm -f
|
||
|
find debian/python-*-dbg -depth -type d -empty -exec rmdir {} \;
|
||
|
|
||
2 years ago
|
for i in $$(find debian/python3-*-dbg -name '*.so'); do \
|
||
|
b=$$(basename $$i .so); \
|
||
|
mv $$i $$(dirname $$i)/$${b}_d.so; \
|
||
|
done
|
||
|
find debian/python3-*-dbg ! -type d \
|
||
|
! \( -name '*.so' -o -name '*config_d.py' \) | xargs rm -f
|
||
|
find debian/python3-*-dbg -depth -type d -empty -exec rmdir {} \;
|
||
|
|
||
|
install-arch-3.%:
|
||
|
$(MAKE) -C build-3.$* install DESTDIR=$(CURDIR)/debian/tmp
|
||
2 years ago
|
$(MAKE) -C dbg-build-3.* install DESTDIR=$(CURDIR)/debian/python3-pytqt-dbg
|
||
|
mkdir -p debian/python3-pytqt/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt
|
||
2 years ago
|
cp -a debian/tmp/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt/__init__.py \
|
||
2 years ago
|
debian/python3-pytqt/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt/__init__.py
|
||
|
mkdir -p debian/python3-pytqt-gl-dbg/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt
|
||
|
mv debian/python3-pytqt-dbg/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt/qtgl.so \
|
||
|
debian/python3-pytqt-gl-dbg/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt/
|
||
|
mkdir -p debian/python3-pytqtext-dbg/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt
|
||
|
mv debian/python3-pytqt-dbg/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt/qtext.so \
|
||
|
debian/python3-pytqtext-dbg/usr/lib/python3.$*/$(call py_sitename,$$version)/PyTQt/
|
||
2 years ago
|
|
||
|
install-arch-%:
|
||
|
$(MAKE) -C build-$* install DESTDIR=$(CURDIR)/debian/tmp
|
||
2 years ago
|
$(MAKE) -C dbg-build-$* install DESTDIR=$(CURDIR)/debian/python-pytqt-dbg
|
||
|
mkdir -p debian/python-pytqt/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt
|
||
2 years ago
|
cp -a debian/tmp/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt/__init__.py \
|
||
2 years ago
|
debian/python-pytqt/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt/__init__.py
|
||
|
mkdir -p debian/python-pytqt-gl-dbg/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt
|
||
|
mv debian/python-pytqt-dbg/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt/qtgl.so \
|
||
|
debian/python-pytqt-gl-dbg/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt/
|
||
|
mkdir -p debian/python-pytqtext-dbg/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt
|
||
|
mv debian/python-pytqt-dbg/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt/qtext.so \
|
||
|
debian/python-pytqtext-dbg/usr/lib/python$*/$(call py_sitename,$$version)/PyTQt/
|
||
2 years ago
|
|
||
13 years ago
|
clean:
|
||
|
dh_testdir
|
||
|
dh_testroot
|
||
|
rm -rf $(PYTHONS:%=build-%) $(PYTHONS:%=dbg-build-%)
|
||
|
rm -f *-stamp
|
||
|
dh_clean
|
||
|
|
||
|
# Must not depend on anything. This is to be called by
|
||
|
# binary-arch/binary-indep
|
||
|
# in another 'make' thread.
|
||
|
binary-common:
|
||
|
dh_testdir
|
||
|
dh_testroot
|
||
|
dh_installman
|
||
|
dh_installchangelogs ChangeLog
|
||
|
dh_installdocs -A NEWS THANKS
|
||
|
dh_installexamples
|
||
|
dh_link
|
||
|
ifeq (,$(findstring -i, $(DH_OPTIONS)))
|
||
|
DH_OPTIONS= dh_strip -ppytqt-tools
|
||
|
set -e; \
|
||
2 years ago
|
for p in python-pytqt python-pytqt-gl python-pytqtext \
|
||
|
python3-pytqt python3-pytqt-gl python3-pytqtext; do \
|
||
13 years ago
|
DH_OPTIONS= dh_strip -p$$p --dbg-package=$$p-dbg; \
|
||
|
rm -rf debian/$$p-dbg/usr/share/doc/$$p-dbg; \
|
||
|
ln -s $$p debian/$$p-dbg/usr/share/doc/$$p-dbg; \
|
||
|
done
|
||
|
endif
|
||
|
# dh_strip
|
||
|
dh_compress -X.py -X.bmp -X.ui -X.sql
|
||
|
dh_fixperms
|
||
2 years ago
|
ifneq (dh_pysupport,${DH_PYTHON2})
|
||
|
${DH_PYTHON2} --no-dbg-cleaning
|
||
|
else
|
||
11 years ago
|
${DH_PYTHON2}
|
||
2 years ago
|
endif
|
||
|
dh_python3 --no-dbg-cleaning
|
||
11 years ago
|
dh_sip_tqt
|
||
2 years ago
|
dh_sip3_tqt
|
||
13 years ago
|
dh_lintian
|
||
|
dh_installdeb
|
||
|
dh_shlibdeps
|
||
|
dh_gencontrol
|
||
|
dh_md5sums
|
||
12 years ago
|
dh_builddeb $(DEB_DH_BUILDDEB_ARGS)
|
||
13 years ago
|
|
||
|
# Build architecture independant packages using the common target.
|
||
|
binary-indep: install-indep
|
||
|
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
||
|
|
||
|
# Build architecture dependant packages using the common target.
|
||
|
binary-arch: install-arch
|
||
|
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
||
|
|
||
|
binary: binary-arch binary-indep
|
||
8 years ago
|
.PHONY: build build-arch clean binary-indep binary-arch binary configure
|