X-Git-Url: https://git.deb.at/?p=pkg%2Fnetris.git;a=blobdiff_plain;f=debian%2Frules;h=38168531204b4e0aea0cea353962e0288013e7a5;hp=2622a1db33c2faa65376ea06eae4871259279e94;hb=6b1f6251013f5cf018e37ec7e67fe629a7f34455;hpb=971ca7559abc33e92afe979820f81785ca80025a diff --git a/debian/rules b/debian/rules index 2622a1d..3816853 100755 --- a/debian/rules +++ b/debian/rules @@ -1,62 +1,99 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# rules file for netris +# copyright 2002++ by Gerfried Fuchs +# Licenced the same way as netris itself -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +COPT = -g +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -oroot -groot -m644 +INSTALL_PROGRAM = $(INSTALL) -p -oroot -groot -m755 +INSTALL_SCRIPT = $(INSTALL) -p -oroot -groot -m755 +INSTALL_DIR = $(INSTALL) -p -d -oroot -groot -m755 -build: build-stamp -build-stamp: - dh_testdir +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + COPT += -O0 +else + COPT += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + + +include /usr/share/quilt/quilt.make - # Add here commands to compile the package. - ./Configure -O2 - make +clean: unpatch + $(checkdir) + $(checkroot) + -rm -rf debian/netris debian/substvars debian/files \ + build-stamp install-stamp config.h .depend + [ ! -f Makefile ] || $(MAKE) clean + -rm -rf Makefile + +build: build-stamp +build-stamp: patch + $(checkdir) + ./Configure -g + $(MAKE) COPT="$(COPT)" touch build-stamp -clean: - dh_testdir - dh_testroot - rm -f build-stamp - # Add here commands to clean up after the build process. - $(MAKE) clean +install: install-stamp +install-stamp: build + $(checkdir) + $(checkroot) + -rm -rf debian/netris + $(INSTALL_DIR) debian/netris + cd debian/netris && $(INSTALL_DIR) usr/games usr/share/man/man6 \ + usr/share/doc/netris/examples + $(INSTALL_PROGRAM) netris debian/netris/usr/games + $(INSTALL_PROGRAM) sr debian/netris/usr/games/netris-sample-robot + $(INSTALL_FILE) debian/netris*.6 debian/netris/usr/share/man/man6 + $(INSTALL_FILE) FAQ robot_desc debian/netris/usr/share/doc/netris + $(INSTALL_FILE) sr.c debian/netris/usr/share/doc/netris/examples + gzip -9 debian/netris/usr/share/man/man6/netris*.6 \ + debian/netris/usr/share/doc/netris/FAQ \ + debian/netris/usr/share/doc/netris/robot_desc \ + debian/netris/usr/share/doc/netris/examples/sr.c + touch install-stamp - dh_clean # Build architecture-independent files here. binary-indep: build # We have nothing to do by default. + # Build architecture-dependent files here. -binary-arch: build - dh_testversion 2.0.40 - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the files into debian/tmp - install -s netris debian/tmp/usr/games - install -s sr debian/tmp/usr/games/netris-sample-robot - - dh_installdocs FAQ robot_desc - dh_installexamples sr.c - dh_installmenu - dh_installmanpages - dh_undocumented netris.1 netris-sample-robot.1 - dh_installchangelogs - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -source diff: - @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false +binary-arch: build install + $(checkdir) + $(checkroot) + $(INSTALL_DIR) debian/netris/DEBIAN debian/netris/usr/share/menu + $(INSTALL_FILE) debian/menu debian/netris/usr/share/menu/netris + $(INSTALL_FILE) debian/copyright debian/README.Debian \ + debian/netris/usr/share/doc/netris + $(INSTALL_FILE) debian/changelog \ + debian/netris/usr/share/doc/netris/changelog.Debian + gzip -9 debian/netris/usr/share/doc/netris/changelog.Debian + $(INSTALL_SCRIPT) debian/postinst debian/postrm \ + debian/netris/DEBIAN + dpkg-shlibdeps -Tdebian/substvars -dDepends \ + debian/netris/usr/games/netris* + dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars -pnetris \ + -Pdebian/netris + cd debian/netris && find * -type f ! -regex '^DEBIAN/.*' -print0 | \ + xargs -r0 md5sum > DEBIAN/md5sums + dpkg --build debian/netris .. + binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary + +define checkdir + test -f debian/rules +endef + +define checkroot + test root = "`whoami`" +endef + +.PHONY: clean build install binary-indep binary-arch binary