2 # debian/rules file for netris
3 # copyright 2002-2010 by Gerfried Fuchs <rhonda@debian.at>
4 # Licenced under WTFPLv2
7 TMP = $(CURDIR)/debian/$(PKG)
11 INSTALL_FILE = $(INSTALL) -p -oroot -groot -m644
12 INSTALL_PROGRAM = $(INSTALL) -p -oroot -groot -m755
13 INSTALL_SCRIPT = $(INSTALL) -p -oroot -groot -m755
14 INSTALL_DIR = $(INSTALL) -p -d -oroot -groot -m755
16 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
21 ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
25 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
26 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
27 MAKEFLAGS += -j$(NUMJOBS)
32 include /usr/share/quilt/quilt.make
37 -rm -rf $(TMP) debian/substvars debian/files \
38 build-stamp install-stamp config.h .depend
39 [ ! -f Makefile ] || $(MAKE) clean
47 $(MAKE) COPT="$(COPT)"
51 install: install-stamp
57 cd $(TMP) && $(INSTALL_DIR) usr/games usr/share/man/man6 \
58 usr/share/doc/$(PKG)/examples
59 $(INSTALL_PROGRAM) netris $(TMP)/usr/games
60 $(INSTALL_PROGRAM) sr $(TMP)/usr/games/netris-sample-robot
61 test "$(STRIP)" != true || strip \
62 --remove-section=.comment --remove-section=.note \
64 $(INSTALL_FILE) debian/netris*.6 $(TMP)/usr/share/man/man6
65 $(INSTALL_FILE) FAQ robot_desc $(TMP)/usr/share/doc/$(PKG)
66 $(INSTALL_FILE) sr.c $(TMP)/usr/share/doc/$(PKG)/examples
67 gzip -9 $(TMP)/usr/share/man/man6/netris*.6 \
68 $(TMP)/usr/share/doc/$(PKG)/FAQ \
69 $(TMP)/usr/share/doc/$(PKG)/robot_desc \
70 $(TMP)/usr/share/doc/$(PKG)/examples/sr.c
74 # Build architecture-independent files here.
76 # We have nothing to do by default.
79 # Build architecture-dependent files here.
80 binary-arch: build install
83 $(INSTALL_DIR) $(TMP)/DEBIAN $(TMP)/usr/share/menu
84 $(INSTALL_FILE) debian/menu $(TMP)/usr/share/menu/$(PKG)
85 $(INSTALL_FILE) debian/copyright debian/README.Debian \
86 $(TMP)/usr/share/doc/$(PKG)
87 $(INSTALL_FILE) debian/changelog \
88 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
89 gzip -9 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
90 $(INSTALL_SCRIPT) debian/postinst debian/postrm \
92 dpkg-shlibdeps -Tdebian/substvars -dDepends \
93 $(TMP)/usr/games/netris*
94 dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars -pnetris \
96 cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
97 xargs -r0 md5sum > DEBIAN/md5sums
98 dpkg --build $(TMP) ..
101 binary: binary-indep binary-arch
108 test root = "`whoami`"
111 .PHONY: clean build install binary-indep binary-arch binary