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
|
#!/usr/bin/make -f
# -*- makefile -*-
#package=siag
export LC_ALL=C
debdir=$(shell pwd)/debian
tmpdir=${debdir}/tmp
siaghome=${tmpdir}/usr/lib/siag
docdir=${tmpdir}/usr/doc
siagdocs=${docdir}/siagoffice-common
configure-stamp:
dh_testdir
xmkmf && make Makefiles && make depend
(cd tsiag && xmkmf && make depend)
# (cd gsiag && xmkmf && make depend)
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
make
make -C tsiag
# make -C gsiag
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
-make clean
-make clean -C tsiag
# -make clean -C gsiag
rm -f Makefile
dh_clean
binary-indep: build
dh_testversion 0.99 # needs this fix to dh_compress
dh_testdir -i
dh_testroot -i
dh_clean -k -i
dh_installdirs -i
make install DESTDIR=${tmpdir}
# correct name for main docdir
(cd ${docdir} && \
mv siag siagoffice-common && \
ln -s siagoffice-common siag-common && \
ln -s siagoffice-common siag)
# FIXME: remove .scm files which went into doc
(cd ${siagdocs} && rm */*.scm)
# remove full GPL, use symlinks
# FIXME: depth changes can break relative symlinks
find ${siagdocs} -name COPYING -exec rm -f {} \; \
-exec ln -s ../../../copyright/GPL {} \;
find ${siagdocs} -name COPYING.LIB -exec rm -f {} \; \
-exec ln -s ../../../copyright/LGPL {} \;
(cd ${siagdocs} && rm common/docs/Copyright)
# remove arch-dep plugins
(cd ${siaghome}/plugins && rm dummy hello image)
# remove files from arch-dep packages
(cd ${tmpdir} && rm -rf usr/X11R6/)
(cd ${siaghome} && rm -rf egon pw siag/examples xsiag)
(cd ${siagdocs} && rm -rf egon pw)
(cd ${siagdocs}/examples && rm -rf egon pw)
# standardize changelog filename
ln -s siag/docs/CHANGES.gz ${siagdocs}/changelog.gz
# changelog symlinks for [xt]siag in siag-common
ln -s CHANGES.gz ${siagdocs}/siag/docs/changelog.gz
ln -s ../../changelog.Debian.gz ${siagdocs}/siag/docs/
dh_movefiles -i
# remove empty dirs
(cd ${tmpdir} && rmdir -p usr/lib/siag/siag/)
(cd ${siagdocs} && rmdir -p plugins/ examples/siag/ siag/docs/)
mkdir -p ${debdir}/siag-common/usr/share/doc-base
install -m644 ${debdir}/siag-common.docbase ${debdir}/siag-common/usr/share/doc-base/siag
dh_installdocs -p siagoffice-common
dh_installchangelogs -p siagoffice-common
dh_compress -i -X examples
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build
dh_testversion 0.99 # needs this fix to dh_compress
dh_testdir -a
dh_testroot -a
dh_clean -k -a
rm -rf ${tmpdir} # this is not cleaned by -a, as it is an arch-indep dir
dh_installdirs -a
make install DESTDIR=${tmpdir}
make install DESTDIR=${tmpdir} -C tsiag BINDIR=/usr/bin
# make install DESTDIR=${tmpdir} -C gsiag
install -d -m755 ${tmpdir}/usr/X11R6/man/man1 ${tmpdir}/usr/man/man1
install -m644 xsiag/siag.man ${tmpdir}/usr/X11R6/man/man1/siag.1x
install -m644 tsiag/tsiag.man ${tmpdir}/usr/man/man1/tsiag.1
install -m644 xpw/pw.man ${tmpdir}/usr/X11R6/man/man1/pw.1x
install -m644 egon/egon.man ${tmpdir}/usr/X11R6/man/man1/egon.1x
# correct name for main docdir
(cd ${docdir} && mv siag siagoffice-common)
# FIXME: remove unwanted files which went into doc
(cd ${siagdocs} && rm */*.scm)
# remove dupplicate .scm files already in arch-indep
rm ${siaghome}/plugins/*.scm
for i in xsiag tsiag; do \
mkdir -p ${debdir}/$$i/usr/doc; \
ln -s siagoffice-common/siag/docs ${debdir}/$$i/usr/doc/$$i; \
done
ln -s siagoffice-common/egon/docs ${docdir}/egon
ln -s siagoffice-common/pw/docs ${docdir}/xpw
ln -s siagoffice-common ${docdir}/siagoffice-plugins
# symlink examples dirs
ln -s ../../examples/egon ${docdir}/egon/examples
ln -s ../../examples/pw ${docdir}/xpw/examples
# remove full GPL
find ${siagdocs} -name COPYING -exec rm -f {} \; \
-exec ln -s ../../../copyright/GPL {} \;
dh_movefiles -a
dh_installdocs -pegon -pxpw
for i in xpw egon ; do \
mkdir -p ${debdir}/$$i/usr/share/doc-base; \
install -m644 ${debdir}/$$i.docbase ${debdir}/$$i/usr/share/doc-base/$$i; \
done
dh_installmenu -a
# dh_undocumented -a
dh_installchangelogs -pegon -pxpw
for i in egon xpw; do \
( cd ${debdir}/$$i/usr/doc/$$i && mv CHANGES changelog ); \
done
dh_strip -a
dh_compress -a -X examples
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
# Below here is fairly generic really
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean
|