| 1 |
|
| 2 |
|
| 3 |
v = 8.6 |
| 4 |
DIR = $(shell pwd)/debian/tmp |
| 5 |
|
| 6 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 7 |
include /usr/share/dpkg/buildflags.mk |
| 8 |
include /usr/share/dpkg/architecture.mk |
| 9 |
|
| 10 |
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) |
| 11 |
export LDFLAGS |
| 12 |
|
| 13 |
ifeq ($(origin CC),default) |
| 14 |
CC = $(DEB_HOST_GNU_TYPE)-gcc |
| 15 |
endif |
| 16 |
|
| 17 |
ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 18 |
|
| 19 |
ifeq ($(DEB_HOST_ARCH), hppa) |
| 20 |
|
| 21 |
CFLAGS += -fno-unit-at-a-time -DTCL_NO_STACK_CHECK=1 |
| 22 |
else |
| 23 |
CFLAGS += -fno-unit-at-a-time |
| 24 |
endif |
| 25 |
endif |
| 26 |
|
| 27 |
%: |
| 28 |
dh $@ |
| 29 |
|
| 30 |
override_dh_auto_clean: |
| 31 |
[ ! -f unix/Makefile ] || $(MAKE) -C unix distclean |
| 32 |
|
| 33 |
override_dh_autoreconf: |
| 34 |
dh_autoreconf autoreconf -- -f -i unix |
| 35 |
|
| 36 |
override_dh_auto_configure: |
| 37 |
|
| 38 |
touch generic/tclStubInit.c |
| 39 |
TCL_LIBRARY="/usr/share/tcltk/tcl$(v)" \ |
| 40 |
TCL_PACKAGE_PATH="/usr/local/lib/tcltk:/usr/local/share/tcltk:/usr/lib/tcltk/$(DEB_HOST_MULTIARCH):/usr/lib/tcltk:/usr/share/tcltk:/usr/lib/tcltk/tcl$(v):/usr/lib" \ |
| 41 |
CC="$(CC)" \ |
| 42 |
CFLAGS="$(CFLAGS)" \ |
| 43 |
CPPFLAGS="$(CPPFLAGS)" \ |
| 44 |
TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\$${TCL_LIB_FILE}" \ |
| 45 |
dh_auto_configure -Dunix -- \ |
| 46 |
--includedir=/usr/include/tcl$(v) \ |
| 47 |
--enable-shared \ |
| 48 |
--enable-threads \ |
| 49 |
--enable-dll-unloading \ |
| 50 |
--disable-rpath \ |
| 51 |
--without-tzdata \ |
| 52 |
--enable-man-symlinks |
| 53 |
|
| 54 |
override_dh_auto_build: |
| 55 |
touch generic/tclStubInit.c && \ |
| 56 |
$(MAKE) -C unix |
| 57 |
|
| 58 |
cd unix && \ |
| 59 |
LC_ALL=C \ |
| 60 |
ar cr libtcl$(v).a *.o && \ |
| 61 |
ar d libtcl$(v).a tclAppInit.o && \ |
| 62 |
ranlib libtcl$(v).a |
| 63 |
|
| 64 |
override_dh_auto_install: |
| 65 |
$(MAKE) -C unix INSTALL_ROOT=$(DIR) \ |
| 66 |
MAN_INSTALL_DIR=$(DIR)/usr/share/man \ |
| 67 |
MANN_INSTALL_DIR=$(DIR)/usr/share/man/man3 \ |
| 68 |
TCL_MODULE_PATH="/usr/lib/tcltk /usr/share/tcltk" \ |
| 69 |
install |
| 70 |
|
| 71 |
sed -i -e's:variable paths {}:variable paths {/usr/share/tcltk/tcl$(v)/tcl8}:' \ |
| 72 |
$(DIR)/usr/share/tcltk/tcl$(v)/tm.tcl |
| 73 |
install -d -m 755 $(DIR)/usr/share/tcltk/tcl$(v)/tcl8 |
| 74 |
mv $(DIR)/usr/share/tcltk/tcl8/*/* $(DIR)/usr/share/tcltk/tcl$(v)/tcl8 |
| 75 |
|
| 76 |
cp unix/libtcl$(v).a $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH) |
| 77 |
install -d -m 755 $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(v) |
| 78 |
mv $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/*.sh $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(v) |
| 79 |
mv $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/tcl.pc $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/tcl$(v).pc |
| 80 |
install -d -m 755 $(DIR)/usr/share/aclocal |
| 81 |
cp unix/tcl.m4 $(DIR)/usr/share/aclocal/tcl$(v).m4 |
| 82 |
rm -f $(DIR)/usr/share/tcltk/tcl$(v)/ldAix |
| 83 |
|
| 84 |
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/generic |
| 85 |
cp generic/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/generic |
| 86 |
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/unix |
| 87 |
cp unix/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/unix |
| 88 |
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/compat |
| 89 |
cp compat/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/compat |
| 90 |
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/libtommath |
| 91 |
cp libtommath/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/libtommath |
| 92 |
|
| 93 |
|
| 94 |
ln -sf libtcl$(v).so $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/libtcl$(v).so.0 |
| 95 |
|
| 96 |
|
| 97 |
cd $(DIR)/usr/share/man/man1 && \ |
| 98 |
cat tclsh.1 | sed -e 's/(n)/(3tcl)/g' > tclsh$(v).1 && \ |
| 99 |
rm tclsh.1 |
| 100 |
cd $(DIR)/usr/share/man/man3 && \ |
| 101 |
for f in *.[3n] ; do \ |
| 102 |
f2=$$(echo $$f | sed -e 's/\.[3n]/.3tcl/') ; \ |
| 103 |
if [ -L $$f ]; then \ |
| 104 |
l=$$(readlink -n $$f | sed -e 's/\.[3n]/.3tcl/') ; \ |
| 105 |
rm $$f ; \ |
| 106 |
ln -sf $$l $$f2 ; \ |
| 107 |
else \ |
| 108 |
cat $$f | sed -e 's/^\.TH \([^ ]\+\|"[^"]\+"\) [3n]/.TH \1 3tcl/' \ |
| 109 |
-e 's/\(Tk_[0-9A-Za-z]*\)(3)/\1(3tk)/g' \ |
| 110 |
-e 's/\([A-Z][0-9A-Za-z_]*\)(3)/\1(3tcl)/g' \ |
| 111 |
-e 's/send(n)/send(3tk)/g' \ |
| 112 |
-e 's/text(n)/text(3tk)/g' \ |
| 113 |
-e 's/tk(n)/tk(3tk)/g' \ |
| 114 |
-e 's/winfo(n)/winfo(3tk)/g' \ |
| 115 |
-e 's/(n)/(3tcl)/g' \ |
| 116 |
-e "s/\\N'244'/\\[^o]/g" \ |
| 117 |
>$$f2 ; \ |
| 118 |
rm $$f ; \ |
| 119 |
fi ; \ |
| 120 |
done |
| 121 |
|
| 122 |
override_dh_makeshlibs: |
| 123 |
dh_makeshlibs -a -Xtcltest |
| 124 |
|
| 125 |
override_dh_shlibdeps: |
| 126 |
dh_shlibdeps -a -ldebian/libtcl$(v)/usr/lib/$(DEB_HOST_MULTIARCH) |
| 127 |
|
| 128 |
get-orig-source: |
| 129 |
CURDIR=`pwd` && \ |
| 130 |
TMPDIR=`mktemp -d /tmp/tcl$(v).XXXXXX` && \ |
| 131 |
cd $$TMPDIR && \ |
| 132 |
wget -O - \ |
| 133 |
http://prdownloads.sourceforge.net/tcl/tcl-core$(v).18-src.tar.gz | tar -zx && \ |
| 134 |
for f in `find . -name *.chm` ; do \ |
| 135 |
echo "REMOVING NON-FREE FILE $$f" ; rm -f $$f ; \ |
| 136 |
done && \ |
| 137 |
tar -zcf $$CURDIR/tcl$(v)_$(v).18+dfsg.orig.tar.gz tcl$(v).18 && \ |
| 138 |
rm -rf $$TMPDIR |
| 139 |
|
| 140 |
.PHONY: override_dh_auto_clean override_dh_auto_configure override_dh_auto_install \ |
| 141 |
override_dh_makeshlibs override_dh_shlibdeps get-orig-source override_dh_autoreconf |