#!/usr/bin/make -f #export DH_VERBOSE=1 VERSION := $(shell dpkg-parsechangelog | perl -ne '/^Version:\s+(\S+)-[^-]+$$/ && print $$1;') BUILD_DIR = debian/build STAMPS_DIR = debian/stamps srcfiles := $(filter-out debian, $(wildcard * .[^.]*)) source: $(STAMPS_DIR)/source $(STAMPS_DIR)/source: $(STAMPS_DIR) dh_testdir @rm -rf $(BUILD_DIR) mkdir -p $(BUILD_DIR) cp -a $(srcfiles) $(BUILD_DIR) dpatch -d $(BUILD_DIR) apply-all touch $@ define build_man mkdir -p $(BUILD_DIR)/docs/out pod2man --release=$(VERSION) --name=$(3) -s $(4) -c Xen $(BUILD_DIR)/docs/man/$(1) $(BUILD_DIR)/docs/out/$(2) endef build: $(STAMPS_DIR)/source mkdir -p $(BUILD_DIR)/docs/man $(call build_man,xend-config.sxp.pod.5,xend-config.sxp.5,xend-config.sxp,5) $(call build_man,xmdomain.cfg.pod.5,xmdomain.cfg.5,xmdomain.cfg,5) $(call build_man,xm.pod.1,xm.1,xm,1) clean: dh_testdir rm -rf $(BUILD_DIR) $(STAMPS_DIR) dh_clean $(BUILD_DIR) $(STAMPS_DIR): @[ -d $@ ] || mkdir -p $@ NO_ORIG = .svn debian scripts DIR_ORIG = ../orig/xen-common-$(VERSION) orig: $(DIR_ORIG) rsync --delete $(foreach t, $(NO_ORIG), --exclude $(t)) --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ . # This is to make dpatch-edit-patch work unpatch: clean maintainerclean: rm -rf $(filter-out $(NO_ORIG), $(wildcard * .[^.]*)) install: $(STAMPS_DIR)/source dh_testdir dh_testroot dh_clean -k $(MAKE) -C $(BUILD_DIR)/tools/examples install DESTDIR=$(CURDIR)/debian/tmp DISTDIR=$(CURDIR)/debian/tmp $(MAKE) -C $(BUILD_DIR)/scripts install DESTDIR=$(CURDIR)/debian/tmp 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/man/* 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 #PHONY_CONFIGURE#