1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
#! /usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE = 1
PYVERS = $(shell pyversions -r debian/control)
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
export BASECFLAGS := $(CFLAGS) $(CPPFLAGS)
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: $(PYVERS:%=build-ext-%-stamp)
touch $@
build-ext-python%-stamp:
dh_testdir
python$* setup.py build
# Add _normal suffix to build dir:
d=$$(echo build/temp.*-$*_ucs4); mv $$d $${d}_normal
rm -rf build/lib.* build/build-*
python$*-dbg setup.py build -g
# Add _debug suffix to build dir:
d=$$(echo build/temp.*-$*_ucs4); mv $$d $${d}_debug
rm -rf build/lib.* build/build-*
sh -e debian/installtemplates.sh $*
touch $@
clean: clean1
clean1:
dh_testdir
dh_testroot
rm -f build*stamp
rm -f debian/*.doc-base
# Can't run setup.py clean because it removes *.pyd, which makes
# "unrepresentable changes to source files".
find -name "*~" -o -name "*.pyc" | xargs -r rm -f
rm -rf build debian/python*-tmp
dh_clean
install: build install-prereq $(PYVERS:%=install-ext-%)
# Replace all "#!" calls to python with /usr/bin/python and make the
# programs executable:
find debian -mindepth 2 -type f | while read i; do \
sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
$$i > $$i.temp; \
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
mv -f $$i.temp $$i; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
fi; \
done
install-prereq:
dh_testdir
dh_testroot
dh_prep
dh_installdirs
install-ext-python%:
dh_installdirs \
-ppython-egenix-mx-base-dev \
usr/include/python$*/mx
# Remove the _normal suffix:
d=$$(echo build/temp.*-$**_normal); mv $$d $${d%*_normal}
python$* setup.py install --root=debian/python$*-tmp --install-layout=deb
# ...and restore it.
d=$$(echo build/temp.*-$*_ucs4); mv $$d $${d}_normal
# Remove debug versions of extension modules.
find debian/python$*-tmp -name '*_d.so' | xargs rm -f
# Collect files.
dh_install -ppython-egenix-mxbeebase \
-ppython-egenix-mxbeebase-doc \
-ppython-egenix-mxdatetime \
-ppython-egenix-mxdatetime-doc \
-ppython-egenix-mxproxy \
-ppython-egenix-mxproxy-doc \
-ppython-egenix-mxqueue \
-ppython-egenix-mxqueue-doc \
-ppython-egenix-mxstack \
-ppython-egenix-mxstack-doc \
-ppython-egenix-mxtexttools \
-ppython-egenix-mxtexttools-doc \
-ppython-egenix-mxtools \
-ppython-egenix-mxtools-doc \
-ppython-egenix-mxuid \
-ppython-egenix-mxuid-doc \
-ppython-egenix-mxurl \
-ppython-egenix-mxurl-doc \
--sourcedir=debian/python$*-tmp
# Move C header files and other stuff to the right location.
sh -e debian/movefiles.sh $*
# Install the debug build.
# Remove the _debug suffix.
d=$$(echo build/temp.*-$**_debug); mv $$d $${d%*_debug}
python$*-dbg setup.py install --root=debian/python-egenix-mx-base-dbg --install-layout=deb
# ...and restore it.
d=$$(echo build/temp.*-$*_ucs4); mv $$d $${d}_debug
find debian/python-egenix-mx-base-dbg \
-type f ! -name '*_d.so' | xargs rm -f
find debian/python-egenix-mx-base-dbg -depth -empty -exec rmdir {} \;
mkdir -p debian/python-egenix-mx-base-dbg/usr/include/python$*_d
ln -s ../python$*/mx \
debian/python-egenix-mx-base-dbg/usr/include/python$*_d/mx
# Architecture-independent files are built here.
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installdocs -i -A debian/README.Debian
dh_installchangelogs -i
dh_link -i
dh_lintian -i
dh_compress -i
dh_fixperms -i
dh_python2 -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Architecture-dependent files are built here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installdocs -a -A debian/README.Debian
dh_installexamples -a
dh_installchangelogs -a
dh_strip -a -Npython-egenix-mx-base-dbg --dbg-package=python-egenix-mx-base-dbg
rm -rf debian/python-egenix-mx-base-dbg/usr/share/doc/python-egenix-mx-base-dbg
ln -s python-egenix-mxtools \
debian/python-egenix-mx-base-dbg/usr/share/doc/python-egenix-mx-base-dbg
dh_link -a
dh_lintian -a
dh_compress -a
dh_fixperms -a
dh_python2 -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build build-arch build-indep
.PHONY: clean
.PHONY: install install-prereq
.PHONY: binary-indep binary-arch binary
|