#! /usr/bin/make -f # Copyright 1994-97,2008 joey@infodrom.org (Martin Schulze) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA. # The name of the package source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g') package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g') version = $(shell grep "^$(package) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g') SHELL=/bin/bash installbin = install -g root -o root -m 755 installdoc = install -g root -o root -m 644 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS = -g -O2 -Wall else CFLAGS = -O2 -Wall endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) STRIP = -s endif build: # Builds the binary package. $(MAKE) CFLAGS="$(CFLAGS)" touch stamp-build clean: debclean # Undoes the effect of `make -f debian/rules build'. $(MAKE) clean rm -rf stamp-build *~ debclean: # Cleans debian binary directories to allow binary creation rm -rf debian/tmp rm -f debian/{files,substvars} binary-indep: # Nothing to be done here binary-arch: debclean # Makes a binary package. test -f stamp-build || make -f debian/rules build $(installbin) -d debian/tmp/DEBIAN install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(package) chmod g-s debian/tmp # $(installdoc) debian/conffiles debian/tmp/DEBIAN $(installdoc) debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian $(installdoc) debian/copyright debian/tmp/usr/share/doc/$(package)/copyright $(installdoc) readme debian/tmp/usr/share/doc/$(package)/ gzip -9fn debian/tmp/usr/share/doc/$(package)/changelog.Debian # install -d -g news -o news -m 755 -d debian/tmp/etc/news $(installdoc) uucpsend.ctl debian/tmp/etc/news # install -d -g news -o news -m 755 -d debian/tmp/usr/lib/news/bin $(MAKE) DEST=debian/tmp MAN=root STRIP="$(STRIP)" install mv debian/tmp/usr/man debian/tmp/usr/share/man gzip -9fn debian/tmp/usr/share/man/man?/* dpkg-shlibdeps debian/tmp/usr/lib/news/bin/uucpsend dpkg-gencontrol -isp dpkg --build debian/tmp .. binary: binary-indep binary-arch source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false dsc: clean cd .. && dpkg-source -b $(source)-$(version) checkroot: $(checkdir) test root = "`whoami`" dist: binary dsc .PHONY: binary binary-arch binary-indep clean checkroot