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
|
#!/usr/bin/make -f
# debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
v = $(shell grep 'variable VERSION' tkcon.tcl | grep -o '[0-9.]\+')
destdir = `pwd`/debian/tkcon
build-arch:
# Nothing here
build-indep: build-stamp
build-stamp:
touch build-stamp
build: build-indep
clean:
dh_testdir
dh_testroot
dh_clean build-stamp \
debian/*.1 \
debian/*.3tk \
debian/*.5
install: build-stamp
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Install the package into debian/tkcon
install -m 755 -d $(destdir)/usr/share/tcltk/tkcon$(v)
install -m 755 tkcon.tcl $(destdir)/usr/share/tcltk/tkcon$(v)/tkcon.tcl
install -m 644 pkgIndex.tcl $(destdir)/usr/share/tcltk/tkcon$(v)/pkgIndex.tcl
sed -i -e's/tkcon [0-9.]\+/tkcon $(v)/' $(destdir)/usr/share/tcltk/tkcon$(v)/pkgIndex.tcl
# Create symlinks (not using dh_link because of $(v))
ln -s ../share/tcltk/tkcon$(v)/tkcon.tcl $(destdir)/usr/bin/tkcon
# Install manpages
for f in docs/*.man ; do \
mpexpand nroff $$f - | \
sed -e 's/^\.TH \(.\+\) n /.TH \1 3tk /' \
-e 's/(n)/(3tk)/g' >debian/`basename $$f .man` || exit 1 ; \
done
for f in debian/*.n ; do \
mv $$f debian/`basename $$f .n`.3tk ; \
done
binary-arch:
# Nothing to do
# Build architecture-independent files here
binary-indep: install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
# Moving old changelog from docs directory
mv $(destdir)/usr/share/doc/tkcon/docs/changes.txt \
$(destdir)/usr/share/doc/tkcon/changelog.1999
# Remove extra license file (it is referenced in HTML docs,
# so, we'll link it to debian/copyright by dh_link)
rm -f $(destdir)/usr/share/doc/tkcon/docs/license.terms
# Remove manual pages from docs directory
rm -f $(destdir)/usr/share/doc/tkcon/docs/*.man
# Remove links to an external sourceforge logo
for f in $(destdir)/usr/share/doc/tkcon/index.html \
$(destdir)/usr/share/doc/tkcon/docs/*.html ; do \
sed -i -e '/<IMG src="http:/{N;s/<[^>]*>/<B>TkCon Homepage<\/B>/}' $$f || exit 1 ; \
done
# Comment out the external Tcl plugin invocation (it doesn't work anyway)
sed -i -e 's/<OBJECT/<!-- <OBJECT/' -e 's/<\/OBJECT>/<\/OBJECT> -->/' \
$(destdir)/usr/share/doc/tkcon/docs/plugin.html
dh_installmenu
dh_installman
dh_install
dh_link
dh_compress
dh_fixperms
dh_installdeb
tcltk-depends
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep
get-orig-source:
wget -O tkcon_$(v).orig.tar.gz https://github.com/wjoye/tkcon/archive/v$(v).tar.gz
.PHONY: build clean binary-indep binary-arch binary install get-orig-source
|