#!/usr/bin/make -f ## This is the debian.rules file for the package ## ratfor, by Emilio C. Lopes . ## updated by Alan Bain . ## updated based on f2c's files and hello package package=ratfor ## The architecture arch = $(shell dpkg --print-architecture) INSTALL = /usr/bin/install INSTALL_PROGRAM = $(INSTALL) -o root -g root -m 0755 CFLAGS = -g -DF77 -DS_CHAR=\"signed char\" ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif build: $(checkdir) ## Builds the binary package. make -f Makefile CFLAGS="$(CFLAGS)" touch stamp-build clean: $(checkdir) ## Undoes the effect of `make -f debian.rules build'. make -f Makefile clean rm -f stamp-build debian/files debian/substvars rm -rf debian/tmp binary-indep: checkroot build $(checkdir) binary-arch: checkroot build $(checkdir) ## Makes a binary package. test -f stamp-build || make -f debian/rules build rm -rf debian/tmp > /dev/null 2>&1 install -d -o root -g root -m 755 debian/tmp chmod g-s debian/tmp install -d -o root -g root -m 755 debian/tmp/usr/bin $(INSTALL_PROGRAM) ratfor debian/tmp/usr/bin ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) strip --remove-section=.comment --remove-section=.note debian/tmp/usr/bin/ratfor endif install -d -o root -g root -m 755 debian/tmp/usr/share/man/man1 install -o root -g root -m 644 ratfor.1 debian/tmp/usr/share/man/man1 gzip -9nf debian/tmp/usr/share/man/man1/ratfor.1 install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package) install -o root -g root -m 644 BUGS\ debian/tmp/usr/share/doc/$(package) ## do package copyright install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package) install -o root -g root -m 644 debian/copyright \ debian/tmp/usr/share/doc/$(package)/copyright install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package)/examples install -o root -g root -m 644 *.r \ debian/tmp/usr/share/doc/$(package)/examples gzip -9nf debian/tmp/usr/share/doc/$(package)/examples/*.r install -d -o root -g root -m 755 debian/tmp/DEBIAN install -c -m 0644 debian/changelog \ debian/tmp/usr/share/doc/$(package)/changelog.Debian gzip -9n debian/tmp/usr/share/doc/$(package)/changelog.Debian dpkg-shlibdeps ./ratfor dpkg-gencontrol -isp dh_md5sums --tmpdir=debian/tmp chown -R root.root debian/tmp chmod -R go-ws debian/tmp dpkg --build debian/tmp .. define checkdir test -f rat4.c -a -f debian/rules endef ## Below Here is Generic binary: binary-indep binary-arch source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false dist: binary source diff changes checkroot: $(checkdir) test root = "`whoami`" .PHONY: binary binary-arch binary-indep clean checkroot