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
|
#!/usr/bin/make -f
# Debian Package Building Makefile
# Package maintainer: John Goerzen <jgoerzen@complete.org>
# Configuration and compilation
PACKAGENAME=netmaze
BASE=debian/tmp
BINARIES=$(PACKAGENAME)
AUXBINARIES=netserv betterbot dummy follower
LIBDIR=$(BASE)/usr/lib/games/$(PACKAGENAME)
STRIP=strip
SHELL=/bin/bash
# use -02 on ia64 to avoid a ftbfs
DEB_BUILD_ARCH_CPU ?=$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
ifeq ($(DEB_BUILD_ARCH_CPU),ia64)
OPTLEVEL=-O2
else
OPTLEVEL=-O3
endif
export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
build:
xmkmf
# Force compilation using the desired optimisation level....
cp Makefile Makefile~
sed s/-O2/$(OPTLEVEL)/ Makefile~ > Makefile
make
touch build
binary: binary-arch binary-indep
binary-indep: build
# This one needs to be root.
binary-arch: build
rm -rf debian/tmp
install -d debian/tmp debian/tmp/DEBIAN debian/tmp/usr/games \
debian/tmp/usr/share/doc/$(PACKAGENAME) debian/tmp/usr/lib/menu \
$(LIBDIR)
# Netmaze goes into bin, everything else to the lib dir.
install -o root -g root -m 0755 $(BINARIES) debian/tmp/usr/games
install -o root -g root -m 0755 xnetserv debian/tmp/usr/games
install -o root -g root -m 0755 $(AUXBINARIES) $(LIBDIR)/
cp -r mazes lib *.tcl $(LIBDIR)
chmod 0755 $(LIBDIR)/{mazes,lib,*.tcl}
uudecode nmlogo.gif.uue
cp nmlogo.gif $(LIBDIR)
cp debian/changelog debian/tmp/usr/share/doc/$(PACKAGENAME)/changelog.Debian
cp README.Debian CREDITS README TODO debian/tmp/usr/share/doc/$(PACKAGENAME)
cp CHANGES debian/tmp/usr/share/doc/$(PACKAGENAME)/changelog
gzip -9nvr debian/tmp/usr/share/doc/$(PACKAGENAME)
cp debian/copyright debian/tmp/usr/share/doc/$(PACKAGENAME)/copyright
cp debian/menu debian/tmp/usr/lib/menu/netmaze
dpkg-shlibdeps debian/tmp/usr/games/netmaze \
$(LIBDIR)/{netserv,betterbot,follower,dummy}
install -o root -g root -m 755 debian/prerm debian/tmp/DEBIAN/
install -o root -g root -m 755 debian/postinst debian/tmp/DEBIAN/
install -o root -g root -m 755 debian/postrm debian/tmp/DEBIAN/
dh_strip -Pdebian/tmp
dpkg-gencontrol -isp
chown -R root.root debian/tmp
chmod -R go-ws,go+r debian/tmp
find debian/tmp -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
dpkg --build debian/tmp ..
clean:
-make clean
-rm -rf build debian/tmp debian/files debian/substvars debian/*~ \
*.o *~ Makefile *.bak
-rm nmlogo.gif
build-arch: build
build-indep: build
.PHONY: build-arch build-indep binary binary-indep binary-arch clean
|