| 1 |
#!/usr/bin/make -f
|
| 2 |
|
| 3 |
# Uncomment this to turn on verbose mode.
|
| 4 |
#export DH_VERBOSE=1
|
| 5 |
|
| 6 |
SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
|
| 7 |
VERSION := $(shell dpkg-parsechangelog | perl -ne '/^Version:\s+(\S+)-[^-]+$$/ && print $$1;')
|
| 8 |
|
| 9 |
BUILD_DIR = debian/build
|
| 10 |
STAMPS_DIR = debian/stamps
|
| 11 |
|
| 12 |
setup: $(STAMPS_DIR)/setup
|
| 13 |
|
| 14 |
$(STAMPS_DIR)/setup: SOURCE_FILES = $(filter-out debian .svn .svk, $(wildcard * .[^.]*))
|
| 15 |
$(STAMPS_DIR)/setup: DIR = $(BUILD_DIR)/build
|
| 16 |
$(STAMPS_DIR)/setup:
|
| 17 |
@[ -d $(BUILD_DIR) ] || mkdir $(BUILD_DIR)
|
| 18 |
@[ -d $(STAMPS_DIR) ] || mkdir $(STAMPS_DIR)
|
| 19 |
dh_testdir
|
| 20 |
@rm -rf $(DIR)
|
| 21 |
mkdir $(DIR)
|
| 22 |
cp -a $(SOURCE_FILES) $(DIR)
|
| 23 |
cd $(DIR); QUILT_PATCHES=$(CURDIR)/debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2
|
| 24 |
touch $@
|
| 25 |
|
| 26 |
build: $(STAMPS_DIR)/build
|
| 27 |
|
| 28 |
$(STAMPS_DIR)/build: DIR = $(BUILD_DIR)/build
|
| 29 |
$(STAMPS_DIR)/build: $(STAMPS_DIR)/setup
|
| 30 |
dh_testdir
|
| 31 |
$(MAKE) -C $(DIR)
|
| 32 |
touch $@
|
| 33 |
|
| 34 |
clean:
|
| 35 |
dh_testdir
|
| 36 |
rm -rf $(BUILD_DIR) $(STAMPS_DIR)
|
| 37 |
dh_clean
|
| 38 |
|
| 39 |
maintainerclean:
|
| 40 |
rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*))
|
| 41 |
|
| 42 |
install: DIR = $(BUILD_DIR)/build
|
| 43 |
install: INSTALL_DIR = $(BUILD_DIR)/install
|
| 44 |
install: $(STAMPS_DIR)/build
|
| 45 |
dh_testdir
|
| 46 |
dh_testroot
|
| 47 |
dh_clean -k
|
| 48 |
dh_installdirs
|
| 49 |
|
| 50 |
$(MAKE) -C $(DIR) install INSTROOT=$(CURDIR)/$(INSTALL_DIR)
|
| 51 |
|
| 52 |
dh_install --sourcedir=$(INSTALL_DIR)
|
| 53 |
|
| 54 |
binary-indep:
|
| 55 |
|
| 56 |
binary-arch: install
|
| 57 |
dh_testdir -a
|
| 58 |
dh_testroot -a
|
| 59 |
dh_installchangelogs -a
|
| 60 |
dh_installdocs -a
|
| 61 |
dh_strip -a
|
| 62 |
dh_compress -a
|
| 63 |
dh_fixperms -a
|
| 64 |
dh_makeshlibs -a
|
| 65 |
dh_installdeb -a
|
| 66 |
dh_shlibdeps -a
|
| 67 |
dh_gencontrol -a
|
| 68 |
dh_md5sums -a
|
| 69 |
dh_builddeb -a
|
| 70 |
|
| 71 |
binary: binary-indep binary-arch
|
| 72 |
|
| 73 |
DIR_ORIG = ../orig/$(SOURCE)-$(VERSION)
|
| 74 |
TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.gz
|
| 75 |
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
|
| 76 |
|
| 77 |
orig: $(DIR_ORIG)
|
| 78 |
rsync --delete --exclude debian --exclude .svk --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
|
| 79 |
|
| 80 |
$(DIR_ORIG):
|
| 81 |
ifeq ($(TAR_ORIG),)
|
| 82 |
$(error Cannot find orig tarball $(TAR_ORIG_NAME))
|
| 83 |
else
|
| 84 |
mkdir -p ../orig
|
| 85 |
tar -C ../orig -xzf $(TAR_ORIG)
|
| 86 |
endif
|
| 87 |
|