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 -*-
#
# debian/rules file for package `console-tools'
# turn around bug in dpkg-parsechangelog
export LC_ALL=C
package=console-tools
VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//')
DATA_PACKAGE=console-tools-data
DATA_VERSION=$(shell dpkg -l ${DATA_PACKAGE} | tail -1 | cut -c 21-35)
MIN_DATA_VERSION=1999.04.15
ARCH=$(shell dpkg --print-architecture)
DEBSCRIPTS=debian/kbdconfig debian/install-keymap debian/keymaps-lct.sh
MANDIR=/usr/share/man
topdir=$(shell pwd)
builddir=${topdir}/debian/BUILD
debdir=${topdir}/debian
tmpdir=${debdir}/tmp
mandir=${tmpdir}${MANDIR}
compatdir=${debdir}/kbd-compat
libsdir=${debdir}/console-tools-libs
devdir=${debdir}/console-tools-dev
docdir=${tmpdir}/usr/share/doc/${package}
exampledir=${docdir}/examples
confdir=${tmpdir}/etc/console-tools
# get the main Makefile's SUBDIRS
include Makefile.am
${DEBSCRIPTS}: debian/% : debian/%.in
sed s/@PACKAGE@/${package}/ <$< >$@
build: build-stamp
build-stamp: configure-stamp
dh_testdir
make -C ${builddir} CFLAGS="-O2 -g -Wall" ARCH=${ARCH}
touch build-stamp
configure-stamp:
dh_testdir
@if dpkg --compare-versions "${DATA_VERSION}" '<<' ${MIN_DATA_VERSION} ; then \
echo "ERROR: You need ${DATA_PACKAGE} >= ${MIN_DATA_VERSION} to build" ;\
false ; fi
mkdir -p ${builddir}
( cd ${builddir} && ${topdir}/configure --enable-kbd-compat --disable-debugging \
--mandir=${MANDIR} --enable-localdatadir)
touch configure-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp ${DEBSCRIPTS}
-make -C ${builddir} distclean
rm -rf ${builddir}
dh_clean
binary-indep: build
dh_testdir -i
dh_testroot -i
dh_clean -i -k
dh_installdirs -i
ln -s console-tools-libs ${compatdir}/usr/share/doc/kbd-compat
make -C ${builddir}/compat install DESTDIR=${compatdir}
dh_installdocs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i -u '-isp'
dh_md5sums -i
dh_builddeb -i
binary-arch: build ${DEBSCRIPTS}
dh_testversion 2.0.40 # /usr/share/doc
dh_testdir -a
dh_testroot -a
dh_clean -a -k
dh_installdirs -a
ln -s console-tools-libs ${tmpdir}/usr/share/doc/console-tools
ln -s console-tools-libs ${devdir}/usr/share/doc/console-tools-dev
make -C ${builddir} install DESTDIR=${tmpdir} \
gnulocaledir=${tmpdir}/usr/share/locale
# uninstall stuff that goes into arch-indep packages
make -C ${builddir}/compat uninstall DESTDIR=${tmpdir}
# open compat symlink
ln -s openvt ${tmpdir}/usr/bin/open
ln -s openvt.1 ${tmpdir}${MANDIR}/man1/open.1
# install data dirs
( cd ${tmpdir}/usr/share/ && \
install -d -m 755 keymaps consolefonts consoletrans videomodes )
# correct some install locations for programs
mv ${tmpdir}/usr/bin/loadkeys ${tmpdir}/bin # needed at boot-time
# move the libs into /lib, as loadkeys need all of them
mv ${tmpdir}/usr/lib/*.so.* ${tmpdir}/lib/
for i in libcfont libconsole libctutils; do\
ln -sf /lib/$$i.so.?.* ${tmpdir}/usr/lib/$$i.so ;\
done
# these programs are usable only by root because of permissions in /dev:
mv ${tmpdir}/usr/bin/vcstime \
${tmpdir}/usr/bin/writevt \
${tmpdir}/usr/bin/setvesablank \
${tmpdir}/usr/sbin/
dh_movefiles -a
(cd ${tmpdir}/usr && rmdir -p include/lct lib)
(cd ${tmpdir} && rmdir lib)
(cd ${tmpdir}/usr/share/ && \
(cd locale && rmdir -p */LC_MESSAGES/) && \
rmdir locale)
# dh_installdebconf -a
dh_installdocs -a
mv ${docdir}/*.html ${docdir}/html/
dh_installexamples -a
install -m 644 debian/lct.docbase ${tmpdir}/usr/share/doc-base/lct
# this file is only useful in the source tree
rm -f ${docdir}/file-formats/TMPL
# move unicode examples to subdir
( cd ${docdir}/examples/ && mv README.strange-name ?????? utflist* \
unicode/ )
dh_installinit -pconsole-tools --init-script=keymaps-lct.sh -r -u"start 05 S ."
dh_installinit -pconsole-tools --init-script=console-screen.sh -r -u"start 48 S ."
# fake /usr/man for dh_
ln -s ${tmpdir}/usr/share/man ${tmpdir}/usr/man
dh_undocumented -a
rm ${tmpdir}/usr/man
# some deb-specific files
install -m 0755 debian/kbdconfig debian/install-keymap ${tmpdir}/usr/sbin
install -m 644 debian/conffiles.d/config ${tmpdir}/etc/console-tools/
dh_installchangelogs ChangeLog -pconsole-tools-libs
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
LD_LIBRARY_PATH=${builddir}/lib/.libs:/lib:/usr/lib \
dh_shlibdeps -a
dh_gencontrol -a -u '-isp'
dh_makeshlibs -a --version-info="console-tools-libs (= ${VERSION})"
dh_md5sums -a
dh_builddeb -a
# Below here is fairly generic really
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean checkroot
|