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
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
VERSION_DEBIAN := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
VERSION := $(shell echo "$(VERSION_DEBIAN)" | sed -e 's,-[^-]*$$,,')
BUILD_DIR = debian/build
STAMPS_DIR = debian/stamps
$(STAMPS_DIR)/source:
@mkdir -p $(STAMPS_DIR)
QUILT_PATCHES=$(CURDIR)/debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2
touch $@
$(STAMPS_DIR)/setup: SOURCE_FILES = $(filter-out debian, $(wildcard *))
$(STAMPS_DIR)/setup: DIR=$(BUILD_DIR)
$(STAMPS_DIR)/setup: $(STAMPS_DIR)/source
@rm -rf $(DIR)
mkdir $(DIR)
cp -al $(SOURCE_FILES) $(DIR)
cp -al debian/scripts $(DIR)
touch $@
build: $(STAMPS_DIR)/setup
make -C $(BUILD_DIR)/docs man-pages
clean:
dh_testdir
rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/*/*.pyc
dh_clean
NO_ORIG = .svn .svk debian
DIR_ORIG = ../orig/$(SOURCE)-$(VERSION)
TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.gz
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
orig: $(DIR_ORIG)
rsync --delete $(foreach t, $(NO_ORIG), --exclude $(t)) --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
$(DIR_ORIG):
ifeq ($(TAR_ORIG),)
$(error Cannot find orig tarball $(TAR_ORIG_NAME))
else
mkdir -p ../orig
tar -C ../orig -xzf $(TAR_ORIG)
endif
maintainerclean:
rm -rf $(filter-out $(NO_ORIG), $(wildcard * .[^.]*))
install: export DESTDIR=$(CURDIR)/debian/tmp
install: $(STAMPS_DIR)/source
dh_testdir
dh_testroot
dh_prep
$(MAKE) -C $(BUILD_DIR)/tools/examples install-configs
$(MAKE) -C $(BUILD_DIR)/tools/hotplug/Linux install-udev install-scripts UDEV_RULES_DIR=/lib/udev/rules.d
$(MAKE) -C $(BUILD_DIR)/scripts install
binary-indep: install
dh_testdir
dh_testroot
dh_install --sourcedir=debian/tmp
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installinit -p xen-utils-common --name xend --no-restart-on-upgrade -- defaults 20 21
dh_installinit -p xen-utils-common --name xendomains --no-start -- defaults 21 20
dh_installman $(BUILD_DIR)/docs/man1/* $(BUILD_DIR)/docs/man5/*
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch:
binary: build binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|