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
|
#!/usr/bin/make -f
v = 5.45
tclv = 8.6
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
%:
dh ${@}
CFLAGS += -Wall -g -D_BSD_SOURCE -ansi -D_SVID_SOURCE -D_POSIX_SOURCE
LINKS = debian/expect.links debian/tcl-expect.links debian/tcl-expect-dev.links
debian/%.links: debian/%.links.in
sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
override_dh_auto_clean:
dh_auto_clean
rm -f debian/*.links
rm -f *.a *.o
rm -rf shared
rm -f expect_cf.h tcldbgcf.h
[ ! -f tclconfig/config.guess~ ] || mv -f tclconfig/config.guess~ tclconfig/config.guess
[ ! -f tclconfig/config.sub~ ] || mv -f tclconfig/config.sub~ tclconfig/config.sub
[ ! -f configure~ ] || mv -f configure~ configure
[ ! -f testsuite/Makefile ] || $(MAKE) -C testsuite distclean
override_dh_auto_configure:
cp -f configure configure~
cp -fb /usr/share/misc/config.guess tclconfig/config.guess
cp -fb /usr/share/misc/config.sub tclconfig/config.sub
autoconf
dh_auto_configure -- --includedir=/usr/include/tcl$(tclv) \
--with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(tclv) \
--with-tk=/usr/lib/$(DEB_HOST_MULTIARCH)/tk$(tclv) \
--with-tclinclude=/usr/include/tcl$(tclv) \
--with-tkinclude=/usr/include/tcl$(tclv) \
--enable-shared \
--enable-threads \
--disable-rpath \
CFLAGS="$(CFLAGS)"
override_dh_auto_build:
$(MAKE) SONAME=libexpect.so.$(v)
override_dh_auto_install:
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
# Rename expect scripts
for SCRIPT in debian/tmp/usr/bin/*; do \
if [ "`basename $$SCRIPT`" != "expect" ] ; then \
sed -e 's/^exec tclsh /exec tclsh$(tclv) /' $$SCRIPT >`dirname $$SCRIPT`/expect_`basename $$SCRIPT`; \
rm $$SCRIPT ; \
fi; \
done
# Fix manpages
for MANPAGE in debian/tmp/usr/share/man/man1/*; do \
if [ "`basename $$MANPAGE`" != "expect.1" ] ; then \
mv $$MANPAGE `dirname $$MANPAGE`/expect_`basename $$MANPAGE`; \
fi; \
done
cp debian/tmp/usr/share/man/man1/expect.1 debian/tmp/usr/share/man/man3/Expect.3tcl
sed -i -e's:\.TH EXPECT 1:.TH EXPECT 3tcl:' debian/tmp/usr/share/man/man3/Expect.3tcl
# Fix library name
mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/expect$(v)/libexpect$(v).so debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libexpect.so.$(v)
mkdir -p -m 755 debian/tmp/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)
mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/expect$(v) debian/tmp/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)
# Fix pkgIndex.tcl
sed -i -e's:usr lib:usr lib $(DEB_HOST_MULTIARCH):' debian/tmp/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/expect$(v)/pkgIndex.tcl
# Fix permissions
chmod 0644 debian/tmp/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/expect$(v)/pkgIndex.tcl
override_dh_link: $(LINKS)
dh_link
override_dh_install:
dh_install --fail-missing
get-orig-source:
wget -O expect_$(v).orig.tar.gz \
http://prdownloads.sourceforge.net/expect/expect$(v).tar.gz
.PHONY: override_dh_auto_clean override_dh_auto_configure override_dh_auto_build \
override_dh_auto_install override_dh_install get-orig-source
|