#!/usr/bin/make -f # Made with the aid of dh_make, by Craig Small # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Also some stuff taken from debmake scripts, by Cristopt Lameter. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #version=$(shell expr `pwd` : '.*-\([0-9.]*\)') #version := $(shell grep ^VERSION Makefile | cut -d" " -f3) version := $(shell perl -ne 'if (/AC_INIT\(gri, ([0-9.]+)\)/){print $$1}' configure.ac) somefutureversion=2.14.0 CXXFLAGS = -O2 -Wall ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CXXFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) STRIPIT=1 endif ARCH := $(shell dpkg --print-architecture | perl -pe chop) build: build-indep build-arch # Build architecture-dependent files here (no need to be root). build-arch: debian/gri_merge.1 gri cd doc; make info gri: Makefile dh_testdir ifeq ($(ARCH),m68k) cd src; make CXXFLAGS="-O0 -Wall" rpncalc.o endif cd src; make CXXFLAGS=${CXXFLAGS} clean: dh_testdir dh_testroot [ ! -f Makefile ] || $(MAKE) distclean mv doc/FAQ.html doc/FAQ.html.KEEP -rm -f config.log config.status debian/Makefile doc/*.html -rm -f doc/gri.info* doc/*.dvi doc/*.ps doc/*.pdf doc/*.log doc/html -rm -f doc/screenshots/*.pdf doc/examples/*.pdf -rm src/gri.cmd src/startup.msg-tmp mv doc/FAQ.html.KEEP doc/FAQ.html -mv texinfo.tex.KEEP texinfo.tex -mv doc/texinfo.tex.KEEP doc/texinfo.tex dh_clean rm -fR debian/gri-$(version)static rm -f debian/README.Debian debian/gri.1 rm -f doc/gri_unpage.1 doc/gri_merge.1 chmod u+w debian/changelog install: gri dh_testdir dh_testroot dh_prep dh_installdirs cd src; make install_linux_debian debian=`pwd`/../debian/gri debian/gri_merge.1: #sed -e 's/VSN/$(version)/g' \ # debian/copyright.template > debian/copyright sed -e 's/LATERVSN/$(somefutureversion)/g;s/VSN/$(version)/g' \ debian/gri.man > debian/gri.1 sed -e 's/LATERVSN/$(somefutureversion)/g;s/VSN/$(version)/g' \ debian/README.Debian.template > debian/README.Debian cp doc/gri_unpage.1-skel doc/gri_unpage.1 cp doc/gri_merge.1-skel doc/gri_merge.1 # Temporary fix for 2.12.23-9 (Fixed upstream for 2.12.24) -mv texinfo.tex texinfo.tex.KEEP -mv doc/texinfo.tex doc/texinfo.tex.KEEP Makefile: # To test on g++-3.0 : # CC=gcc-3.0 CXX=g++-3.0 ./configure --prefix=/usr ./configure --prefix=/usr --enable-linux_debian # Build architecture-independent files here (no need to be root). build-indep: debian/gri_merge.1 Makefile cd doc; make refcard.ps cmdrefcard.ps gri.pdf html # Install (as root) architecture-independent files here. binary-indep: build-indep dh_testdir -i dh_testroot -i install -d debian/gri-el/usr/share/emacs/site-lisp/gri-el install -m 644 src/gri-mode.el debian/gri-el/usr/share/emacs/site-lisp/gri-el install -d debian/gri-pdf-doc/usr/share/doc/gri install -m 644 doc/gri.pdf debian/gri-pdf-doc/usr/share/doc/gri install -m 644 doc/refcard.ps debian/gri-pdf-doc/usr/share/doc/gri install -m 644 doc/cmdrefcard.ps debian/gri-pdf-doc/usr/share/doc/gri cd doc; make html-install DESTDIR=`pwd`/../debian/gri-html-doc/ rm -f debian/*debhelper dh_installdocs -i -A README debian/README.Debian dh_installexamples -i dh_installemacsen -i dh_installchangelogs -i dh_compress -i -X.jpg -Xlogo.gri dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Install (as root) architecture-dependent files here. binary-arch: build-arch install dh_testdir -a dh_testroot -a (cd debian/gri/usr/share/gri/$(version) ; ln -fs ../../common-licenses/GPL license.txt) rm -f debian/*debhelper dh_installdocs -a README dh_installexamples -a dh_installemacsen -a dh_installinfo doc/gri.info* dh_installman debian/gri.1 doc/gri_unpage.1 doc/gri_merge.1 (cd debian/gri/usr/share/man/man1 ; ln -fs gri.1.gz gri-$(version).1.gz) dh_installchangelogs -a ifdef STRIPIT dh_strip -a endif dh_compress -a dh_fixperms -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary