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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
dpkg_buildflags = DEB_LDFLAGS_MAINT_APPEND="-Wl,-z,defs" \
DEB_BUILD_MAINT_OPTIONS="hardening=+all" dpkg-buildflags
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
PKGNAME = $(shell head -1 debian/changelog | sed 's/ .*//')
VERSION = $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//')
PKGFILES = $(PKGNAME)_$(VERSION)_$(shell dpkg --print-architecture).deb \
$(PKGNAME)-dev_$(VERSION)_$(shell dpkg --print-architecture).deb \
$(PKGNAME)-doc_$(VERSION)_all.deb
CHANGES = $(PKGNAME)_$(VERSION)_$(shell dpkg --print-architecture).changes
TCLX_VERSION = $(shell head -1 debian/changelog | sed 's/ .*//;s/tclx//')
TCL_THREADS = $(shell . /usr/lib/tclConfig.sh && echo $$TCL_THREADS)
ENABLE_THREADS = $(shell test "$(TCL_THREADS)" = 1 && echo --enable-threads)
DESTDIR = $(CURDIR)/debian/tmp
configure: tclconfig/tcl.m4
# Rebuild configure with new tcl.m4
dh_autoreconf
rm -rf autom4te.cache
config.status: configure
dh_testdir
# Not done here since configure must be invoked
# separately for static and shared libraries.
#./configure \
# --host=$(DEB_HOST_GNU_TYPE) \
# --build=$(DEB_BUILD_GNU_TYPE) \
# --prefix=/usr \
# --mandir=\$${prefix}/share/man \
# --infodir=\$${prefix}/share/info \
# --with-tcl=/usr/lib \
# --enable-shared \
# $(ENABLE_THREADS) \
# CFLAGS="$(CFLAGS)" \
# LDFLAGS="-Wl,-z,defs"
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: build-stamp-static build-stamp-shared
touch build-stamp-static
touch build-stamp-shared
touch $@
build-stamp-static: config.status
dh_testdir
# Compile the static library
rm -f config.cache config.log config.status *.o pkgIndex.tcl
./configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--with-tcl=/usr/lib \
--disable-shared \
$(ENABLE_THREADS) \
$(shell $(dpkg_buildflags) --export=configure)
$(MAKE)
touch $@
build-stamp-shared: config.status
dh_testdir
# Compile the shared library
rm -f config.cache config.log config.status *.o pkgIndex.tcl
./configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--with-tcl=/usr/lib \
--enable-shared \
$(ENABLE_THREADS) \
$(shell $(dpkg_buildflags) --export=configure)
$(MAKE)
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp*
# Add here commands to clean up after the build process.
[ ! -f Makefile ] || $(MAKE) distclean
dh_autoreconf_clean
dh_clean
-rm -rf pkgIndex.tcl libtclx*.* config.* $$(find . -name CVS)
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add here commands to install the package into debian/tmp.
$(MAKE) install DESTDIR=$(DESTDIR)
cp -fp libtclx*.a $(DESTDIR)/usr/lib/
# Fix the installation
mv $(DESTDIR)/usr/lib/tclx$(TCLX_VERSION)/lib* $(DESTDIR)/usr/lib/
ln -nfs libtclx$(TCLX_VERSION).so.0 \
$(DESTDIR)/usr/lib/libtclx$(TCLX_VERSION).so
mkdir -p $(DESTDIR)/usr/include/tclx$(TCLX_VERSION)
mv $(DESTDIR)/usr/include/*.h \
$(DESTDIR)/usr/include/tclx$(TCLX_VERSION)/
sh ./debian/install_manpages $(DESTDIR)
ln -nfs TclX.3tclx.gz $(DESTDIR)/usr/share/man/man3/tclx.3tclx.gz
# Load only on tcl8.4
echo 'if {[package vcompare [info tclversion] 8.4] < 0} return' \
> $(DESTDIR)/usr/lib/tclx$(TCLX_VERSION)/pkgIndex.tcl
sed 's|\$$dir|/usr/lib|' < pkgIndex.tcl \
>>$(DESTDIR)/usr/lib/tclx$(TCLX_VERSION)/pkgIndex.tcl
# Copy files in packages directories
dh_install -v --sourcedir=debian/tmp
# Build architecture-independent files here.
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installchangelogs ChangeLog -i
dh_installdocs -i
# dh_installexamples -i
# dh_install -i
# dh_installmenu -i
# dh_installdebconf -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installmime -i
# dh_python -i
# dh_installinit -i
# dh_installcron -i
# dh_installinfo -i
dh_installman -i
dh_link -i
# dh_strip -i
dh_compress -i
dh_fixperms -i
# dh_perl -i
# dh_makeshlibs -i
dh_installdeb -i
# dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs ChangeLog -a
dh_installdocs -a
# dh_installexamples -a
# dh_install -a
# dh_installmenu -a
# dh_installdebconf -a
# dh_installlogrotate -a
# dh_installemacsen -a
# dh_installpam -a
# dh_installmime -a
# dh_python -a
# dh_installinit -a
# dh_installcron -a
# dh_installinfo -a
dh_installman -a
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
# dh_perl -a
dh_makeshlibs -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
package:
dh_testdir
dpkg-buildpackage -rfakeroot
dist:
dh_testdir
dpkg-buildpackage -rfakeroot
deb:
dh_testdir
dpkg-buildpackage -rfakeroot -us -uc
debclean:
dh_testdir
fakeroot ./debian/rules clean
debinst:
dh_testdir
cd .. && sudo dpkg -i $(PKGFILES)
lintian:
dh_testdir
cd .. && lintian -i $(PKGFILES)
upload:
dh_testdir
cd .. && grep -q 'PGP SIGNED MESSAGE' $(CHANGES) && dupload $(CHANGES)
|