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
|
#! /usr/bin/make -f
#
# Debian rules file rewritten by Martin Mitchell <martin@debian.org>
#
# The name of the package (for example, `emacs').
p = gnuchess
# The target architecture (for example, `i386').
a = $(shell dpkg --print-architecture)
STRIP=strip
build:
$(checkdir)
( cd src ; ./configure --prefix=/usr ; \
make CFLAGS="-O2 -g" LDFLAGS=-s BINDIR=/usr/games/Gnuchess.real LIBDIR=/usr/lib/games/gnuchess )
test -f gnuchess.data.huge || debian/generate
touch build
clean:
$(checkdir)
( cd src ; if test -f Makefile ; then make distclean ; fi )
-rm -f gnuchess.data.huge testfile ./t build src/t src/test
-rm -rf debian/tmp debian/substvars debian/files debian/*~
chmod +x debian/generate
binary-indep: checkroot build
$(checkdir)
gnuchess: checkroot build
install -d debian/tmp/gnuchess/DEBIAN debian/tmp/gnuchess/etc/gnuchess debian/tmp/gnuchess/usr/games/Gnuchess.real debian/tmp/gnuchess/usr/lib/games/gnuchess debian/tmp/gnuchess/usr/man/man6 debian/tmp/gnuchess/usr/doc/gnuchess
( cd src ; \
make install BINDIR=../debian/tmp/gnuchess/usr/games/Gnuchess.real \
LIBDIR=../debian/tmp/gnuchess/usr/lib/games/gnuchess \
MANDIR=../debian/tmp/gnuchess/usr/man/man6 )
( cd debian/tmp/gnuchess/usr/games/Gnuchess.real; \
for i in gnuchess gnuchess? gnuan postprint game; do \
$(STRIP) $$i; \
ln -sf Gnuchess.real/gnuchess.run ../$$i; \
done )
chmod 0644 debian/tmp/gnuchess/usr/lib/games/gnuchess/gnuchess.data
chmod 0644 debian/tmp/gnuchess/usr/lib/games/gnuchess/eco.pgn
chmod 0644 debian/tmp/gnuchess/usr/lib/games/gnuchess/gnuchess.lang
chmod 0644 debian/tmp/gnuchess/usr/lib/games/gnuchess/gnuchess.eco
install -g root -m 755 -o root debian/gnuchess.run \
debian/tmp/gnuchess/usr/games/Gnuchess.real/gnuchess.run
install -g root -m 644 -o root debian/memsz.global \
debian/tmp/gnuchess/etc/gnuchess/global
install -g root -m 644 -o root debian/README.debian \
debian/tmp/gnuchess/usr/doc/gnuchess/README.debian
install -g root -m 644 -o root debian/changelog \
debian/tmp/gnuchess/usr/doc/gnuchess/changelog.Debian
install -m 644 doc/{CHANGES,CHESSTOOL,ChangeLog,FAQ,HEURISTICS,TODO} \
debian/tmp/gnuchess/usr/doc/gnuchess
gzip -9v debian/tmp/gnuchess/usr/doc/gnuchess/*
install -g root -m 644 -o root debian/copyright \
debian/tmp/gnuchess/usr/doc/gnuchess
gzip -9v debian/tmp/gnuchess/usr/man/man6/*
( cd debian/tmp/gnuchess/usr/doc/gnuchess && ln -s ChangeLog.gz changelog.gz )
cd debian/tmp/gnuchess/usr/man/man6 && ln -s gnuchess.6.gz gnuchess.run.6.gz
cd debian/tmp/gnuchess/usr/man/man6 && ln -s gnuchess.6.gz gnuchessc.6.gz
cd debian/tmp/gnuchess/usr/man/man6 && ln -s gnuchess.6.gz gnuchessn.6.gz
cd debian/tmp/gnuchess/usr/man/man6 && ln -s gnuchess.6.gz gnuchessr.6.gz
cd debian/tmp/gnuchess/usr/man/man6 && ln -s gnuchess.6.gz gnuchessx.6.gz
install -g root -m 644 -o root debian/conffiles \
debian/tmp/gnuchess/DEBIAN/conffiles
install -g root -m 755 -o root debian/postrm \
debian/tmp/gnuchess/DEBIAN/postrm
dpkg-shlibdeps debian/tmp/gnuchess/usr/games/Gnuchess.real/*
dpkg-gencontrol -pgnuchess -Pdebian/tmp/gnuchess
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
binary-arch: checkroot gnuchess gnuchess-book
dpkg --build debian/tmp/gnuchess ..
dpkg --build debian/tmp/gnuchess-book ..
gnuchess-book:
install -d debian/tmp/gnuchess-book/DEBIAN debian/tmp/gnuchess-book/usr/lib/games/gnuchess debian/tmp/gnuchess-book/usr/doc
install -g root -m 644 -o root gnuchess.data.huge \
debian/tmp/gnuchess-book/usr/lib/games/gnuchess/gnuchess.data
install -m 755 debian/preinst.book debian/tmp/gnuchess-book/DEBIAN/preinst
install -m 755 debian/postrm.book debian/tmp/gnuchess-book/DEBIAN/postrm
( cd debian/tmp/gnuchess-book/usr/doc && ln -s gnuchess gnuchess-book )
dpkg-gencontrol -pgnuchess-book -Pdebian/tmp/gnuchess-book
chown -R root.root debian/tmp/gnuchess-book
chmod -R go=rX debian/tmp/gnuchess-book
define checkdir
test -s src/eval.c -a -f debian/rules
endef
# Below here is fairly generic really
binary: binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|