-# Made with the aid of dh_make, by Craig Small
-# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
-# Some lines taken from debmake, by Christoph Lameter.
-# $Id: rules,v 1.68 2004/05/30 18:21:43 mdz Exp $
-
-# LD_LIBRARY_PATH=pwd/debian/apt/usr/lib dh_shlibdeps -papt
-# dpkg: /home/jgg/work/apt2/debian/apt/usr/lib/libapt-pkg.so.2.9 not found.
-
-# For the deb builder, you can run 'debian/rules cvs-build', which does all
-# steps nescessary to produce a proper source tarball with the CVS/ removed.
-# It builds in debian/cvs-build/apt-<VER>/, and places files in
-# debian/cvs-build/. Optionally, you can run 'debian/rules cvs-mkul' to
-# create ../upload-<VER>, with all the files needed to be uploaded placed
-# in it.
-
-export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-# FOR AUTOCONF 2.52 AND NEWER ONLY
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
- confflags += --build $(DEB_HOST_GNU_TYPE)
-else
- confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
-endif
-
-# See below
--include build/environment.mak
-
-ifneq (,$(shell which dpkg-buildflags))
- export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
-else
- ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- export CXXFLAGS = -O0 -g -Wall
- else
- export CXXFLAGS = -O2 -g -Wall
- endif
-endif
-
-# Default rule
-build:
-
-PKG=apt
-DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS)
-APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p' | sed -e 's/\+.*$$//')
-APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in)
-APT_CVSTAG=$(shell echo "$(APT_DEBVER)" | sed -e 's/^/v/' -e 's/\./_/g')
-
-# Determine the build directory to use
-BASE=.
-ifdef BUILD
-BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
-else
-BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname --machine) $(BASE)/build
-endif
-BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
-BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
-override BLD := $(BUILDX)
-
-ifeq ($(words $(BLD)),0)
-override BLD := ./build
-endif
-
-# Rebuild configure.in to have the correct version from the change log
-ifneq ($(APT_DEBVER),$(APT_CONFVER))
-ifneq ($(APT_DEBVER),)
-.PHONY: configure.in
-configure.in:
- sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$ && mv $@.$$$$ $@
-endif
-else
-configure.in:
-endif
-
-# APT Programs in apt-utils
-APT_UTILS=ftparchive sortpkgs extracttemplates
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# Find the libapt-pkg major version for use in other control files
-include buildlib/libversion.mak
-
-# Determine which package we should provide in the control files
-LIBAPTPKG_PROVIDE=libapt-pkg$(LIBAPTPKG_MAJOR)
-LIBAPTINST_PROVIDE=libapt-inst$(LIBAPTINST_MAJOR)
-
-debian/shlibs.local: apt-pkg/makefile
- # We have 3 shlibs.local files: One for 'apt', one for 'apt-utils' and
- # one for the rest of the packages. This ensures that each package gets
- # the right overrides…
- rm -rf $@ $@.apt $@.apt-utils
- echo "libapt-pkg $(LIBAPTPKG_MAJOR)" > $@.apt
-
- echo "libapt-pkg $(LIBAPTPKG_MAJOR) $(LIBAPTPKG_PROVIDE)" > $@.apt-utils
- echo "libapt-inst $(LIBAPTINST_MAJOR)" >> $@.apt-utils
-
- echo "libapt-pkg $(LIBAPTPKG_MAJOR) $(LIBAPTPKG_PROVIDE)" > $@
- echo "libapt-inst $(LIBAPTINST_MAJOR) $(LIBAPTINST_PROVIDE)" >> $@
-
-build: build/build-stamp
-build-doc: build/build-doc-stamp
-
-# Note that this is unconditionally done first as part of loading environment.mak
-# The true is needed to force make to reload environment.mak after running
-# configure-stamp. Otherwise we can get stale or invalid, or missing config data.
-build/environment.mak: build/configure-stamp
- @true
-
-configure: configure.in
-build/configure-stamp: configure
- dh_testdir
- -mkdir build
- cp COPYING debian/copyright
- cd build && CXXFLAGS="$(CXXFLAGS)" ../configure $(confflags)
- touch $@
-
-build/build-stamp: build/configure-stamp
- # Add here commands to compile the package.
- $(MAKE) binary
- touch $@
-
-build/build-doc-stamp: build/configure-stamp
- # Add here commands to compile the package.
- $(MAKE) doc
- touch $@
-
-clean:
- dh_testdir
-
- [ ! -f Makefile ] || $(MAKE) clean distclean
- rm -rf build
-
- # Add here commands to clean up after the build process.
- dh_clean debian/copyright debian/shlibs.local debian/shlibs.local.apt debian/shlibs.local.apt-utils
-
-binary-indep: apt-doc libapt-pkg-doc
-# Build architecture-independent files here.
-libapt-pkg-doc: build-doc debian/shlibs.local
- dh_testdir -p$@
- dh_testroot -p$@
- dh_clean -p$@ -k
- dh_installdirs -p$@
-#
-# libapt-pkg-doc install