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
|
#!/usr/bin/make -f
v = 9.0
DIR = $(shell pwd)/debian/tmp
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
export LDFLAGS
ifeq ($(origin CC),default)
CC = $(DEB_HOST_GNU_TYPE)-gcc
endif
ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
# See bug #446335 for -fno-unit-at-a-time
ifeq ($(DEB_HOST_ARCH), hppa)
# Disable stack checking for hppa (it doesn't work properly yet)
CFLAGS += -fno-unit-at-a-time -DTCL_NO_STACK_CHECK=1
else
CFLAGS += -fno-unit-at-a-time
endif
endif
%:
dh $@
override_dh_auto_clean:
[ ! -f unix/Makefile ] || $(MAKE) -C unix distclean
override_dh_auto_configure:
# So so ugly but it works...
touch generic/tclStubInit.c
TCL_LIBRARY="/usr/lib/tcl$(v)" \
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" \
CC="$(CC)" \
CFLAGS="$(CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\$${TCL_LIB_FILE}" \
dh_auto_configure -Dunix -- \
--includedir=/usr/include/tcl$(v) \
--enable-shared \
--enable-threads \
--enable-dll-unloading \
--disable-rpath \
--disable-zipfs \
--without-tzdata \
--with-system-libtommath \
--enable-man-symlinks
override_dh_auto_build:
touch generic/tclStubInit.c && \
$(MAKE) -C unix
# Build the static library
cd unix && \
LC_ALL=C \
ar cr libtcl$(v).a *.o && \
ar d libtcl$(v).a tclAppInit.o && \
ranlib libtcl$(v).a
override_dh_auto_install:
$(MAKE) -C unix INSTALL_ROOT=$(DIR) \
MAN_INSTALL_DIR=$(DIR)/usr/share/man \
MANN_INSTALL_DIR=$(DIR)/usr/share/man/man3 \
TCL_MODULE_PATH="/usr/lib/tcltk /usr/share/tcltk" \
install
# Fix up the modules
sed -i -e's:variable paths {}:variable paths {/usr/lib/tcl$(v)/tcl9}:' \
$(DIR)/usr/lib/tcl$(v)/tm.tcl
install -d -m 755 $(DIR)/usr/lib/tcl$(v)/tcl9
mv $(DIR)/usr/lib/tcl9/*/* $(DIR)/usr/lib/tcl$(v)/tcl9
rm -r $(DIR)/usr/lib/tcl9
# Fix up the libraries
cp unix/libtcl$(v).a $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)
install -d -m 755 $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(v)
mv $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/*.sh $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(v)
mv $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/tcl.pc $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/tcl$(v).pc
install -d -m 755 $(DIR)/usr/share/aclocal
cp unix/tcl.m4 $(DIR)/usr/share/aclocal/tcl$(v).m4
rm -f $(DIR)/usr/lib/tcl$(v)/ldAix
# Fix up the include files
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/generic
cp generic/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/generic
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/unix
cp unix/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/unix
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/compat
cp compat/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/compat
install -d $(DIR)/usr/include/tcl$(v)/tcl-private/libtommath
cp libtommath/*.h $(DIR)/usr/include/tcl$(v)/tcl-private/libtommath
#
# Fix up the manpages.
cd $(DIR)/usr/share/man/man1 && \
cat tclsh.1 | sed -e 's/(n)/(3tcl)/g' > tclsh$(v).1 && \
rm tclsh.1
cd $(DIR)/usr/share/man/man3 && \
for f in *.[3n] ; do \
f2=$$(echo $$f | sed -e 's/\.[3n]/.3tcl/') ; \
if [ -L $$f ]; then \
l=$$(readlink -n $$f | sed -e 's/\.[3n]/.3tcl/') ; \
rm $$f ; \
ln -sf $$l $$f2 ; \
else \
cat $$f | sed -e 's/^\.TH \([^ ]\+\|"[^"]\+"\) [3n]/.TH \1 3tcl/' \
-e 's/\(Tk_[0-9A-Za-z]*\)(3)/\1(3tk)/g' \
-e 's/\([A-Z][0-9A-Za-z_]*\)(3)/\1(3tcl)/g' \
-e 's/send(n)/send(3tk)/g' \
-e 's/text(n)/text(3tk)/g' \
-e 's/tk(n)/tk(3tk)/g' \
-e 's/winfo(n)/winfo(3tk)/g' \
-e 's/(n)/(3tcl)/g' \
-e "s/\\N'244'/\\[^o]/g" \
>$$f2 ; \
rm $$f ; \
fi ; \
done
override_dh_makeshlibs:
dh_makeshlibs -a -Xtcltest
override_dh_shlibdeps:
dh_shlibdeps -a -ldebian/libtcl$(v)/usr/lib/$(DEB_HOST_MULTIARCH)
get-orig-source:
CURDIR=`pwd` && \
TMPDIR=`mktemp -d /tmp/tcl$(v).XXXXXX` && \
cd $$TMPDIR && \
wget -O - \
https://prdownloads.sourceforge.net/tcl/tcl-core$(v).1-src.tar.gz | tar -zx && \
for f in `find . -name *.chm` ; do \
echo "REMOVING NON-FREE FILE $$f" ; rm -f $$f ; \
done && \
tar -zcf $$CURDIR/tcl$(v)_$(v).1+dfsg.orig.tar.gz tcl$(v).1 && \
rm -rf $$TMPDIR
.PHONY: override_dh_auto_clean override_dh_auto_configure override_dh_auto_install \
override_dh_makeshlibs override_dh_shlibdeps get-orig-source
|