1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
#!/usr/bin/make -f
# -*- makefile -*-
export DH_VERBOSE=1
TG_BRANCHES := "debian/locations"
include /usr/share/quilt/quilt.make
-include /usr/share/topgit/tg2quilt.mk
# Package name
PACKAGE_NAME = logapp
# Install program
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -m 644
INSTALL_PROGRAM = $(INSTALL) -p -m 755
INSTALL_SCRIPT = $(INSTALL) -p -m 755
INSTALL_DIR = $(INSTALL) -p -d -m 755
# The installation directory
PACKAGE_DIR = debian/$(PACKAGE_NAME)
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
# Set default CFLAGS
CFLAGS ?= -g
build-arch: build
build: build-stamp
build-indep:
build-stamp: patch
$(checkdir)
$(MAKE)
touch $@
clean: unpatch
$(checkdir)
rm -f build-stamp
[ ! -f Makefile ] || $(MAKE) clean
rm -rf $(PACKAGE_DIR) debian/files debian/substvars debian/logapplogmake \
debian/logapplogsvn debian/logapplogcvs debian/logapp.substvars
install: build
$(checkdir)
$(INSTALL_DIR) $(PACKAGE_DIR)/usr/bin
$(MAKE) DESTDIR=$(CURDIR)/$(PACKAGE_DIR) install
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
$(checkdir)
$(INSTALL_DIR) $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/
for i in README TODO;do \
$(INSTALL_FILE) -m 644 $$i $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/; \
done;
$(INSTALL_FILE) -m 644 debian/changelog $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/changelog.Debian
gzip -9nv $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/changelog.Debian
$(INSTALL_FILE) -m 644 debian/copyright $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/copyright
$(INSTALL_DIR) $(PACKAGE_DIR)/usr/share/man/man1
$(INSTALL_FILE) -m 644 $(PACKAGE_NAME).1 $(PACKAGE_DIR)/usr/share/man/man1
gzip -9nv $(PACKAGE_DIR)/usr/share/man/*/*
(cd $(PACKAGE_DIR)/usr/share/man/man1/;for i in logcvs logmake logsvn;do ln -s logapp.1.gz $$i.1.gz; done)
# Recreate the symbolic links for the executables, to ensure that they are relative to $PWD
(cd $(PACKAGE_DIR)/usr/bin;for i in logcvs logmake logsvn;do rm -f "$$i"; ln -s logapp $$i; done)
# Strip binaries
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip -R.note -R.comment $(PACKAGE_DIR)/usr/bin/*
endif
dpkg-shlibdeps $(PACKAGE_DIR)/usr/bin/logapp
$(INSTALL_DIR) $(PACKAGE_DIR)/DEBIAN
cd $(PACKAGE_DIR) && find * -type f ! -regex '^DEBIAN/.*' -print0 | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
dpkg-gencontrol -p$(PACKAGE_NAME) -P$(PACKAGE_DIR)
dpkg-deb --root-owner-group --build $(PACKAGE_DIR) ..
binary: binary-indep binary-arch
define checkdir
test -f logapp.h && test -f debian/rules
endef
.PHONY: build clean binary-indep binary-arch binary install
|