#! /usr/bin/make -f # # Copyright (C) 2008 Richard Kettlewell # # 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; either version 2 of the License, or # (at your option) any later version. # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA # # Options to configure. This can be overridden by the caller if necessary. CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS=-O0 -g else CFLAGS=-O2 -g endif export CFLAGS # Install commands. You wouldn't normally override these. INSTALL=install INSTALL_DATA=$(INSTALL) -p -o root -g root -m 644 INSTALL_PROGRAM=$(INSTALL) -p -o root -g root -m 755 INSTALL_SCRIPT=$(INSTALL) -p -o root -g root -m 755 MKDIR=mkdir -p -m 755 # Set DEB_BUILD_OPTIONS=nostrip to install debuggable executables. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif export INSTALL_DATA export INSTALL_SCRIPT export INSTALL_PROGRAM FAKEROOT=fakeroot # ./prepare is the script that generates configure etc. It only needs to be # run if building from a checkout rather than a tarball. build: @set -e;if test ! -f configure; then \ echo ./prepare;\ ./prepare;\ fi @set -e;if test ! -f config.status; then \ echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\ ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\ else\ echo ./config.status;\ ./config.status;\ fi $(MAKE) pkg-rjk-nntp-tools: rm -rf debian/rjk-nntp-tools $(MKDIR) debian/rjk-nntp-tools debian/rjk-nntp-tools/DEBIAN \ debian/rjk-nntp-tools/usr/share/doc/rjk-nntp-tools $(INSTALL_DATA) debian/copyright \ debian/rjk-nntp-tools/usr/share/doc/rjk-nntp-tools/copyright $(INSTALL_DATA) debian/changelog \ debian/rjk-nntp-tools/usr/share/doc/rjk-nntp-tools/changelog gzip -9 debian/rjk-nntp-tools/usr/share/doc/rjk-nntp-tools/changelog* @for f in preinst postinst prerm postrm conffiles templates config; do\ if test -e debian/$$f.rjk-nntp-tools; then\ echo $(INSTALL_SCRIPT) debian/$$f.rjk-nntp-tools debian/rjk-nntp-tools/DEBIAN/$$f; \ $(INSTALL_SCRIPT) debian/$$f.rjk-nntp-tools debian/rjk-nntp-tools/DEBIAN/$$f; \ fi;\ done $(MAKE) DESTDIR=`pwd`/debian/rjk-nntp-tools install strip --remove-section=.comment debian/rjk-nntp-tools/usr/bin/bzr2news \ debian/rjk-nntp-tools/usr/bin/tla2news \ debian/rjk-nntp-tools/usr/bin/lj2news dpkg-shlibdeps -Tdebian/substvars.rjk-nntp-tools \ debian/rjk-nntp-tools/usr/bin/* $(INSTALL_DATA) README debian/rjk-nntp-tools/usr/share/doc/rjk-nntp-tools/. gzip -9f debian/rjk-nntp-tools/usr/share/doc/rjk-nntp-tools/README \ debian/rjk-nntp-tools/usr/share/man/man*/* cd debian/rjk-nntp-tools && \ find -name DEBIAN -prune -o -type f -print \ | sed 's/^\.\///' \ | xargs md5sum > DEBIAN/md5sums dpkg-gencontrol -isp -prjk-nntp-tools -Pdebian/rjk-nntp-tools -Tdebian/substvars.rjk-nntp-tools chown -R root:root debian/rjk-nntp-tools chmod -R g-ws debian/rjk-nntp-tools dpkg --build debian/rjk-nntp-tools .. DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}') DSC=rjk-nntp-tools_$(DEBVERSION).dsc DEBSRC=rjk-nntp-tools_$(DEBVERSION).tar.gz VERSION=$(shell $(MAKE) echo-version) source: $(MAKE) dist rm -rf rjk-nntp-tools-$(VERSION) tar xfz rjk-nntp-tools-$(VERSION).tar.gz dpkg-source -b rjk-nntp-tools-$(VERSION) rm -rf rjk-nntp-tools-$(VERSION) rjk-nntp-tools-$(VERSION).tar.gz source-check: source rm -rf rjk-nntp-tools-$(DEBVERSION) dpkg-source -x $(DSC) cd rjk-nntp-tools-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT) binary: binary-arch binary-indep binary-arch: pkg-rjk-nntp-tools binary-indep: clean: -$(MAKE) distclean rm -f config.cache rm -f debian/files rm -f debian/substvars.* rm -rf debian/rjk-nntp-tools .PHONY: clean build pkg-rjk-nntp-tools source source-check \ binary binary-arch binary-indep