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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
|
#!/usr/bin/make -f
# -*- mode: makefile -*-
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
export DH_COMPAT=2
SHELL = /bin/bash
PWD = $(shell pwd)
PLATFORM= $(shell python -c \
'import distutils.util; print distutils.util.get_platform()')
PYVER = 2.3
changes_file = Doc/release_notes/ANNOUNCE-1.1
PYLIB22 = usr/lib/python2.2/config
PYSITE22= usr/lib/python2.2/site-packages
PYLIB23 = usr/lib/python2.3/config
PYSITE23= usr/lib/python2.3/site-packages
PYLIB24 = usr/lib/python2.4/config
PYSITE24= usr/lib/python2.4/site-packages
p_num22 = python2.2-numarray
p_ext22 = python2.2-numarray-ext
p_num23 = python2.3-numarray
p_ext23 = python2.3-numarray-ext
p_num24 = python2.4-numarray
p_ext24 = python2.4-numarray-ext
p_num = python-numarray
p_ext = python-numarray-ext
p_doc = python-numarray-doc
d_num22 = debian/$(p_num22)
d_ext22 = debian/$(p_ext22)
d_num23 = debian/$(p_num23)
d_ext23 = debian/$(p_ext23)
d_num24 = debian/$(p_num24)
d_ext24 = debian/$(p_ext24)
d_num = debian/$(p_num)
d_ext = debian/$(p_ext)
d_doc = debian/$(p_doc)
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),arm))
export USE_LAPACK=yes
endif
build: stamp-build
stamp-build: stamp-build22 stamp-build23 stamp-build24
touch $@
stamp-build22:
dh_testdir
/usr/bin/python2.2 ./setup.py build --gencode
/usr/bin/python2.2 ./setup.py install \
--prefix=$(PWD)/$(d_num22)/usr
rm -f $(d_num22)/usr/lib/python2.2/site-packages/numarray/LICENSE.txt
rm -rf $(d_num22)/usr/lib/python2.2/site-packages/numarray/examples
-find $(d_num22) -name '*.py[co]' | xargs rm -f
touch $@
stamp-build22-ext:
dh_testdir
cd Packages; \
PYTHONPATH=$(PWD)/build/lib.$(PLATFORM)-2.2 \
/usr/bin/python2.2 ./setup.py build
touch $@
stamp-build22-exam:
dh_testdir
cd Examples && \
PYTHONPATH=$(PWD)/build/lib.$(PLATFORM)-2.2 \
/usr/bin/python2.2 ./setup.py build
touch $@
stamp-build23:
dh_testdir
/usr/bin/python2.3 ./setup.py build --gencode
/usr/bin/python2.3 ./setup.py install \
--prefix=$(PWD)/$(d_num23)/usr
rm -f $(d_num23)/usr/lib/python2.3/site-packages/numarray/LICENSE.txt
rm -rf $(d_num23)/usr/lib/python2.3/site-packages/numarray/examples
-find $(d_num23) -name '*.py[co]' | xargs rm -f
touch $@
stamp-build23-ext:
dh_testdir
cd Packages; \
PYTHONPATH=$(PWD)/build/lib.$(PLATFORM)-2.3 \
/usr/bin/python2.3 ./setup.py build
touch $@
stamp-build24:
dh_testdir
/usr/bin/python2.4 ./setup.py build --gencode
/usr/bin/python2.4 ./setup.py install \
--prefix=$(PWD)/$(d_num24)/usr
rm -f $(d_num24)/usr/lib/python2.4/site-packages/numarray/LICENSE.txt
rm -rf $(d_num24)/usr/lib/python2.4/site-packages/numarray/examples
-find $(d_num24) -name '*.py[co]' | xargs rm -f
touch $@
stamp-build24-ext:
dh_testdir
cd Packages; \
PYTHONPATH=$(PWD)/build/lib.$(PLATFORM)-2.4 \
/usr/bin/python2.4 ./setup.py build
touch $@
stamp-build-doc:
touch $@
# this requires as additional build dependencies: latex2html, netpbm
PDOC = /usr/lib/python2.3/doc
PDOC = /home/packages/python/2.3/python2.3-2.3.4/Doc
my-build-doc:
ln -sf $(PDOC)/html/icons Doc/manual/.
ln -sf $(PDOC)/tools/mkhowto Doc/manual/.
ln -sf $(PDOC)/tools/mkinfo Doc/manual/.
rm -rf Doc/manual/numarray
mkdir -p Doc/manual/numarray
cp -pr /usr/share/doc/python2.3-doc/html/icons Doc/manual/numarray/.
# $(MAKE) -C Doc/manual \
# MKHOWTO="python2.3 ./mkhowto -i" numarray.html
$(MAKE) -C Doc/manual \
MKHOWTO="python2.3 $(PDOC)/tools/mkhowto -i" numarray.html
rm -f Doc/manual/numarray/images.*
rm -rf Doc/manual/html
mv Doc/manual/numarray Doc/manual/html
for i in Doc/manual/html/*.html; do \
sed 's,src="../icons/,src="icons/,g' $$i > $$i.new; \
mv -f $$i.new $$i; \
done
cd Doc/manual && GZIP=-9v tar cfj html.tbz html
mv Doc/manual/html.tbz .
clean:
dh_testdir
dh_testroot
rm -f stamp-*
-rm -rf `find -name build -type d`
# this does not work ...
# python2.2 ./setup.py clean
# python2.3 ./setup.py clean
-find -name '*.py[co]' | xargs rm -f
rm -f Src/_{conv,sort,bytes,ufunc[A-Z]*}module.c
rm -f Src/libnumarraymodule.c
rm -rf Doc/manual/{html,icons,mkhowto,mkinfo,numarray}
dh_clean
install: build
dh_testdir
dh_testroot
# dh_clean -k
# dh_installdirs
: # python-numarray provides a one step install only
: # install the extensions
# cd Packages; \
# PYTHONPATH=$(PWD)/build/lib.$(PLATFORM)-2.2 \
# python2.2 ./setup.py install --prefix=$(PWD)/$(d_ext22)/usr
# cd Packages; \
# PYTHONPATH=$(PWD)/build/lib.$(PLATFORM)-2.3 \
# python2.3 ./setup.py install --prefix=$(PWD)/$(d_ext23)/usr
dh_movefiles -p$(p_ext22) --sourcedir=$(d_num22) \
usr/lib/python2.2/site-packages/numarray/convolve \
usr/lib/python2.2/site-packages/numarray/fft \
usr/lib/python2.2/site-packages/numarray/image \
usr/lib/python2.2/site-packages/numarray/linear_algebra \
usr/lib/python2.2/site-packages/numarray/ma \
usr/lib/python2.2/site-packages/numarray/nd_image \
usr/lib/python2.2/site-packages/numarray/random_array
dh_movefiles -p$(p_ext23) --sourcedir=$(d_num23) \
usr/lib/python2.3/site-packages/numarray/convolve \
usr/lib/python2.3/site-packages/numarray/fft \
usr/lib/python2.3/site-packages/numarray/image \
usr/lib/python2.3/site-packages/numarray/linear_algebra \
usr/lib/python2.3/site-packages/numarray/ma \
usr/lib/python2.3/site-packages/numarray/nd_image \
usr/lib/python2.3/site-packages/numarray/random_array
dh_movefiles -p$(p_ext24) --sourcedir=$(d_num24) \
usr/lib/python2.4/site-packages/numarray/convolve \
usr/lib/python2.4/site-packages/numarray/fft \
usr/lib/python2.4/site-packages/numarray/image \
usr/lib/python2.4/site-packages/numarray/linear_algebra \
usr/lib/python2.4/site-packages/numarray/ma \
usr/lib/python2.4/site-packages/numarray/nd_image \
usr/lib/python2.4/site-packages/numarray/random_array
-find $(d_num22) $(d_num23) $(d_num24) $(d_ext22) $(d_ext23) $(d_ext24) \
-name '*.py[co]' | xargs rm -f
for d in `find $(d_num22) $(d_num23) $(d_num24) $(d_ext22) $(d_ext23) $(d_ext24) -depth -type d -empty 2> /dev/null`; do \
while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \
done
binary-indep: build stamp-build-doc install
dh_testdir
dh_testroot
dh_installdocs -p$(p_doc)
mkdir -p $(d_doc)/usr/share/doc/$(p_doc)
cd $(d_doc)/usr/share/doc/$(p_doc) && tar xfj $(PWD)/html.tbz
dh_installchangelogs -p$(p_doc) $(changes_file)
dh_installexamples -p$(p_doc) Examples/*
: # Replace all '#!' calls to python with python
: # and make them executable
for i in `find $(d_doc) -type f`; 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
dh_compress -i -X.py -X.pik -X.pdf -X.css -X.c
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs -p$(p_num22) -p$(p_num23) -p$(p_num24) \
README.txt Doc/{Announce,Design,Repackaging,UsersGuide}.txt
dh_installchangelogs -p$(p_num22) -p$(p_num23) -p$(p_num24) $(changes_file)
mkdir -p $(d_num)/usr/share/doc
ln -sf $(p_num23) $(d_num)/usr/share/doc/$(p_num)
: # change this with the default python version!
mkdir -p $(d_ext)/usr/share/doc
ln -sf $(p_num) $(d_ext)/usr/share/doc/$(p_ext)
mkdir -p $(d_ext22)/usr/share/doc
ln -sf $(p_num22) $(d_ext22)/usr/share/doc/$(p_ext22)
mkdir -p $(d_ext23)/usr/share/doc
ln -sf $(p_num23) $(d_ext23)/usr/share/doc/$(p_ext23)
mkdir -p $(d_ext24)/usr/share/doc
ln -sf $(p_num24) $(d_ext24)/usr/share/doc/$(p_ext24)
dh_python -p$(p_num22) -p$(p_ext22) -p$(p_num23) -p$(p_ext23) -p$(p_num24) -p$(p_ext24)
dh_strip -a
dh_compress -a -X.py
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: binary binary-arch binary-indep clean
|