| 1 |
|
| 2 |
|
| 3 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 4 |
include /usr/share/dpkg/buildflags.mk |
| 5 |
include /usr/share/dpkg/architecture.mk |
| 6 |
|
| 7 |
v = 2.5 |
| 8 |
tclv = 8.6 |
| 9 |
lib_so = libBLT.$(v).so.$(tclv) |
| 10 |
tcl_only_lib_so = libBLTlite.$(v).so.$(tclv) |
| 11 |
dtmp = $(shell pwd)/debian/tmp |
| 12 |
|
| 13 |
CFLAGS += -Wno-old-style-definition |
| 14 |
|
| 15 |
%: |
| 16 |
dh $@ |
| 17 |
|
| 18 |
override_dh_clean: |
| 19 |
dh_clean |
| 20 |
[ ! -f cf/install-sh.backup ] || mv cf/install-sh.backup cf/install-sh |
| 21 |
[ ! -f configure.backup ] || mv configure.backup configure |
| 22 |
[ ! -f generic/bltConfig.h.in.backup ] || mv generic/bltConfig.h.in.backup generic/bltConfig.h.in |
| 23 |
[ ! -f generic/Makefile.backup ] || mv generic/Makefile.backup generic/Makefile |
| 24 |
rm -f generic/shared/libBLT.$(v).so.$(tclv) |
| 25 |
rm -f generic/shared/libBLTlite.$(v).so.$(tclv) |
| 26 |
|
| 27 |
override_dh_autoreconf: |
| 28 |
[ -f cf/install-sh.backup ] || cp cf/install-sh cf/install-sh.backup |
| 29 |
[ -f configure.backup ] || cp configure configure.backup |
| 30 |
[ -f generic/bltConfig.h.in.backup ] || cp generic/bltConfig.h.in generic/bltConfig.h.in.backup |
| 31 |
[ -f generic/Makefile.backup ] || cp generic/Makefile generic/Makefile.backup |
| 32 |
dh_autoreconf |
| 33 |
|
| 34 |
override_dh_auto_configure: |
| 35 |
dh_auto_configure -- \ |
| 36 |
--host=$(DEB_HOST_GNU_TYPE) \ |
| 37 |
--with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(tclv) \ |
| 38 |
--with-tk=/usr/lib/$(DEB_HOST_MULTIARCH)/tk$(tclv) |
| 39 |
|
| 40 |
override_dh_auto_build: |
| 41 |
$(MAKE) lib_so=$(lib_so) \ |
| 42 |
tcl_only_lib_so=$(tcl_only_lib_so) |
| 43 |
|
| 44 |
override_dh_auto_install: |
| 45 |
$(MAKE) lib_so=$(lib_so) \ |
| 46 |
tcl_only_lib_so=$(tcl_only_lib_so) \ |
| 47 |
INSTALL_ROOT=$(dtmp) install |
| 48 |
|
| 49 |
|
| 50 |
mv $(dtmp)/usr/share/man/mann/BLT.n \ |
| 51 |
$(dtmp)/usr/share/man/mann/intro.n |
| 52 |
(cd $(dtmp)/usr/share/man/mann ; for i in *.n ; do \ |
| 53 |
sed -e's/^\.TH \+\([^ ]*\) \+n/.TH blt::\1 3tcl/' $$i >../man3/blt::`basename $$i .n`.3tcl ; \ |
| 54 |
done) |
| 55 |
rm -r $(dtmp)/usr/share/man/mann |
| 56 |
|
| 57 |
|
| 58 |
(cd $(dtmp)/usr/lib/blt$(v) ; rm README PROBLEMS NEWS) |
| 59 |
|
| 60 |
|
| 61 |
mkdir -p $(dtmp)/usr/share/blt$(v) |
| 62 |
mv $(dtmp)/usr/lib/blt$(v)/demos $(dtmp)/usr/share/blt$(v) |
| 63 |
chmod a-x $(dtmp)/usr/share/blt$(v)/demos/*.txt |
| 64 |
|
| 65 |
mkdir -p $(dtmp)/usr/share/blt$(v)/examples |
| 66 |
cp examples/* $(dtmp)/usr/share/blt$(v)/examples |
| 67 |
|
| 68 |
|
| 69 |
(cd $(dtmp)/usr/share/blt$(v) ; \ |
| 70 |
for i in demos/*.tcl examples/*.tcl ; do \ |
| 71 |
sed -e '1c#!/usr/bin/wish$(tclv)' $$i >$$i.new ; \ |
| 72 |
mv $$i.new $$i ; \ |
| 73 |
chmod 755 $$i; \ |
| 74 |
done) |
| 75 |
|
| 76 |
chmod 644 $(dtmp)/usr/share/blt$(v)/demos/images/* |
| 77 |
chmod 644 $(dtmp)/usr/share/blt$(v)/demos/scripts/*.tcl |
| 78 |
chmod 755 $(dtmp)/usr/share/blt$(v)/demos/scripts/page.tcl |
| 79 |
|
| 80 |
override_dh_installdocs: |
| 81 |
dh_installdocs |
| 82 |
rm -f debian/blt-dev/usr/share/doc/blt-dev/html/*.vc |
| 83 |
|
| 84 |
override_dh_makeshlibs: |
| 85 |
dh_makeshlibs -V 'tk8.6-blt2.5 (>= 2.5.3)' |
| 86 |
|
| 87 |
get-orig-source: |
| 88 |
CURDIR=`pwd` && TMPDIR=`mktemp -d /tmp/blt.XXXXXX` && \ |
| 89 |
cd $$TMPDIR && \ |
| 90 |
wget -O tmp.zip \ |
| 91 |
https://prdownloads.sourceforge.net/wize/blt-src-$(v).3.zip && \ |
| 92 |
unzip tmp.zip && \ |
| 93 |
rm -rv blt$(v)/library/dd_protocols && \ |
| 94 |
(cd blt$(v) && patch -p1 <$$CURDIR/debian/patches/source.patch) && \ |
| 95 |
sed -i -e 's/\$$(ddFiles)//' blt$(v)/library/Makefile.in && \ |
| 96 |
tar -Jcf $$CURDIR/blt_$(v).3+dfsg.orig.tar.xz blt$(v) && \ |
| 97 |
rm -rf $$TMPDIR |
| 98 |
|
| 99 |
.PHONY: override_dh_auto_configure override_dh_auto_build \ |
| 100 |
override_dh_auto_install override_dh_makeshlibs override_dh_installdocs \ |
| 101 |
get-orig-source |