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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
#!/usr/bin/make -f
# debian/rules that uses debhelper.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export QUILT_PATCHES := debian/patches
destdir=debian/tcllib
mandir=/usr/share/man
docdir=/usr/share/doc/tcllib
exampledir=$(docdir)/examples
unpatch:
dh_testdir
quilt pop -a || test $$? = 2
rm -rf patch-stamp .pc
patch: patch-stamp
patch-stamp:
dh_testdir
quilt push -a || test $$? = 2
touch patch-stamp
# build mostly covers docs and such
build: build-stamp
build-stamp: patch-stamp
dh_testdir
./configure --prefix=/usr --mandir=$(mandir)
$(MAKE) html-doc
#
touch build-stamp
clean: clean-patched unpatch
dh_testdir
dh_testroot
dh_clean
clean-patched: patch-stamp
dh_testdir
#
[ ! -f Makefile ] || $(MAKE) distclean
#
rm -f build-stamp install-stamp
rm -f config.cache config.status
install: build install-stamp
install-stamp:
dh_testdir
dh_testroot
dh_installdirs
#
$(MAKE) DESTDIR=$(destdir) install
#
# install the mpexpand script, which doesn't otherwise get installed.
install -p -m 755 modules/doctools/mpexpand $(destdir)/usr/bin
#
# now set the permissions properly, since the Makefile doesn't bother
cd $(destdir)/usr/lib && \
find . -type f -print | xargs chmod 644
#
# move scripts to /usr/share
mv $(destdir)/usr/lib/* $(destdir)/usr/share/tcltk
rmdir $(destdir)/usr/lib
#
# rename the man pages into section 3
mv $(destdir)$(mandir)/mann $(destdir)$(mandir)/man3
#
# move the man pages for mpexpand, dtplite, page and mpexpand to section 1
mkdir $(destdir)$(mandir)/man1
mv $(destdir)$(mandir)/man3/mpexpand.n $(destdir)$(mandir)/man1
mv $(destdir)$(mandir)/man3/dtplite.n $(destdir)$(mandir)/man1
mv $(destdir)$(mandir)/man3/page.n $(destdir)$(mandir)/man1
mv $(destdir)$(mandir)/man3/tcldocstrip.n $(destdir)$(mandir)/man1
#
# cleanup manpages
cd $(destdir)$(mandir)/man1 && \
for f in *.n ; do \
sed -e'/\.so man.macros/ d' \
-e's/^\.TH \([^ ]\+\) n/.TH \1 1/' \
-e's/(n)/(3tcl)/g' \
-e's/^\.dtx/\\\&.dtx/' \
-e's/^\.\.\(.\)/\\\&..\1/' \
$$f > `basename $$f .n`.1; \
rm $$f; \
done
#
cd $(destdir)$(mandir)/man3 && \
for f in *.n ; do \
sed -e'/\.so man.macros/ d' \
-e's/^\.TH "math::roman" 1\.0/.TH "math::roman" 3tcl 1.0/' \
-e's/^\.TH \("simulation::random"\) n /.TH \1 3tcllib /' \
-e's/^\.TH \(.\+\) n /.TH \1 3tcl /' \
-e's/send(n)/send(3tk)/g' \
-e's/(n)/(3tcl)/g' \
-e's/^\.RE\([^ ]\)/.RE\n\1/' \
-e's/^\.dtx/\\\&.dtx/' \
-e's/^\.sppp/.sp/' \
-e's/^\.plot/\\\&.plot/' \
-e's/^\.sp /.sp\n/' \
-e's/\xf6/\\[:o]/g' \
-e"s/\xe9/\\['e]/g" \
-e's/^\.\.\(.\)/\\\&..\1/' \
-e's/^\.ddt/\\\&.ddt/' \
-e's/^\. It/\\\&. It/' \
-e's/^\.text/\\\&.text/' \
-e's/^\.mycombo/\\\&.mycombo/' \
$$f > `basename $$f .n`.3tcl; \
rm $$f; \
done
# prevent conflict with tcl8.X-doc package
mv $(destdir)$(mandir)/man3/msgcat.3tcl \
$(destdir)$(mandir)/man3/doctools_msgcat.3tcl
# prevent conflict with memchan package
# TODO: find a better solution
mv $(destdir)$(mandir)/man3/random.3tcl \
$(destdir)$(mandir)/man3/random.3tcllib
#
touch install-stamp
#
# cleanup docs
cd doc/html && \
for f in *.html ; do \
sed -i -e's/\(^\|[^:]\+\)send(n)/\1send(3tk)/g' \
-e's/math::roman()/math::roman(3tcl)/' \
-e's/(n)/(3tcl)/g' $$f; \
done
#
# generate documentation index
tclsh debian/gen_index.tcl doc/html >$(destdir)$(docdir)/index.html
binary-indep: build install
dh_testdir
dh_testroot
dh_installdocs doc/html
dh_installexamples
# fix some broken permissions
chmod 644 $(destdir)$(exampledir)/csv/bench_join
chmod 644 $(destdir)$(exampledir)/math/bigfloat.demo.tcl
chmod 644 $(destdir)$(exampledir)/logger/snit-logger.tcl
chmod 644 $(destdir)$(exampledir)/logger/xotcl-logger.tcl
chmod 644 $(destdir)$(exampledir)/mapproj/*
dh_installchangelogs ChangeLog
dh_link
dh_compress -Xusr/share/doc/tcllib/examples/ \
-Xusr/share/doc/tcllib/html/
dh_fixperms
dh_installdeb
tcltk-depends
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch: build install
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
VER=1.12
get-orig-source:
CURDIR=`pwd` && \
TMPDIR=`mktemp -d /tmp/tcllib.XXXXXX` && \
cd $$TMPDIR && \
wget -O - http://heanet.dl.sourceforge.net/sourceforge/tcllib/tcllib-$(VER).tar.gz | tar -zx && \
for f in `grep -rl '^Network Working Group' *` ; do \
echo "REMOVING NON-FREE RFC $$f" ; rm -f $$f ; \
done && \
tar -zcf $$CURDIR/tcllib_$(VER)-dfsg.orig.tar.gz tcllib-$(VER) && \
rm -rf $$TMPDIR
.PHONY: patch unpatch clean-patched build clean binary-indep binary-arch binary install get-orig-source
|