| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/architecture.mk |
| 4 |
include /usr/share/dpkg/pkg-info.mk |
| 5 |
|
| 6 |
BUILD_DATE = $(shell date --utc --date="@$(SOURCE_DATE_EPOCH)" +%Y-%m-%d) |
| 7 |
|
| 8 |
export CRITCL_VER := $(shell sed -n "/package provide critcl/s/.*critcl //gp" lib/critcl/critcl.tcl) |
| 9 |
|
| 10 |
%: |
| 11 |
dh $@ |
| 12 |
|
| 13 |
override_dh_auto_clean: |
| 14 |
dh_auto_clean |
| 15 |
rm -rf debian/.cache |
| 16 |
|
| 17 |
override_dh_auto_install: |
| 18 |
HOME=debian/.cache ./build.tcl install --dest-dir debian/tmp |
| 19 |
ls -lR debian/tmp |
| 20 |
mkdir -p debian/critcl/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) |
| 21 |
mkdir -p debian/critcl/usr/share/tcltk |
| 22 |
for d in debian/tmp/usr/lib/*; \ |
| 23 |
do \ |
| 24 |
for f in $$d/*/*.so; \ |
| 25 |
do \ |
| 26 |
if [ -f "$$f" ]; \ |
| 27 |
then \ |
| 28 |
mv $$d debian/critcl/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) && break; \ |
| 29 |
fi; \ |
| 30 |
done; \ |
| 31 |
done |
| 32 |
for d in debian/tmp/usr/lib/*; \ |
| 33 |
do \ |
| 34 |
mv $$d debian/critcl/usr/share/tcltk; \ |
| 35 |
done |
| 36 |
#mv debian/tmp/usr/lib debian/critcl/usr/share/ |
| 37 |
mv debian/tmp/usr/include debian/critcl/usr/ |
| 38 |
mv debian/tmp/usr/bin debian/critcl/usr/ |
| 39 |
sed -i -e 's,/usr/bin/tclsh[0-9].[0-9],/usr/bin/tclsh,g' debian/critcl/usr/bin/* |
| 40 |
rm -f debian/critcl/usr/share/tcltk/*/license.terms debian/critcl/usr/lib/tcltk/*/*/license.terms |
| 41 |
for d in 8.5 8.6 8.7 9.0 ; \ |
| 42 |
do \ |
| 43 |
rm -rf debian/critcl/usr/share/tcltk/critcl-$(CRITCL_VER)/critcl_c/tcl$$d; \ |
| 44 |
ln -s /usr/include/tcl$$d debian/critcl/usr/share/tcltk/critcl-$(CRITCL_VER)/critcl_c/tcl$$d; \ |
| 45 |
done |
| 46 |
find debian/critcl/usr -name teapot.txt -print0 | \ |
| 47 |
xargs -0r sed -i -e 's,^\(Meta build::date\).*,\1 $(BUILD_DATE),' \ |
| 48 |
-e 's,^\(Meta generated::by {critcl .*}\).*,\1,' |
| 49 |
|
| 50 |
override_dh_installman: |
| 51 |
mkdir -p debian/tmp/man |
| 52 |
cd doc && \ |
| 53 |
dtplite -ext 3tcl -o ../debian/tmp/man nroff . && \ |
| 54 |
mv ../debian/tmp/man/files/critcl.3tcl \ |
| 55 |
../debian/tmp/man/files/critcl.1 |
| 56 |
dh_installman |
| 57 |
|
| 58 |
override_dh_installexamples: |
| 59 |
dh_installexamples -Xzlibwrap/zlib/ |
| 60 |
|
| 61 |
override_dh_compress: |
| 62 |
dh_compress -Xexamples |
| 63 |
|
| 64 |
override_dh_gencontrol: |
| 65 |
tcltk-depends |
| 66 |
dh_gencontrol |
| 67 |
|
| 68 |
.PHONY: override_dh_auto_install override_dh_gencontrol override_dh_installman override_dh_compress override_dh_installexamples |