1 | #!/usr/bin/make -f |
---|
2 | |
---|
3 | #export DH_VERBOSE=1 |
---|
4 | |
---|
5 | VERSION := $(shell dpkg-parsechangelog | perl -ne '/^Version:\s+(\S+)-[^-]+$$/ && print $$1;') |
---|
6 | |
---|
7 | BUILD_DIR = debian/build |
---|
8 | STAMPS_DIR = debian/stamps |
---|
9 | |
---|
10 | srcfiles := $(filter-out debian, $(wildcard * .[^.]*)) |
---|
11 | source: $(STAMPS_DIR)/source |
---|
12 | $(STAMPS_DIR)/source: $(STAMPS_DIR) |
---|
13 | dh_testdir |
---|
14 | @rm -rf $(BUILD_DIR) |
---|
15 | mkdir -p $(BUILD_DIR) |
---|
16 | cp -a $(srcfiles) $(BUILD_DIR) |
---|
17 | dpatch -d $(BUILD_DIR) apply-all |
---|
18 | touch $@ |
---|
19 | |
---|
20 | define build_man |
---|
21 | mkdir -p $(BUILD_DIR)/docs/out |
---|
22 | pod2man --release=$(VERSION) --name=$(3) -s $(4) -c Xen $(BUILD_DIR)/docs/man/$(1) $(BUILD_DIR)/docs/out/$(2) |
---|
23 | endef |
---|
24 | |
---|
25 | build: $(STAMPS_DIR)/source |
---|
26 | mkdir -p $(BUILD_DIR)/docs/man |
---|
27 | $(call build_man,xend-config.sxp.pod.5,xend-config.sxp.5,xend-config.sxp,5) |
---|
28 | $(call build_man,xmdomain.cfg.pod.5,xmdomain.cfg.5,xmdomain.cfg,5) |
---|
29 | $(call build_man,xm.pod.1,xm.1,xm,1) |
---|
30 | |
---|
31 | clean: |
---|
32 | dh_testdir |
---|
33 | rm -rf $(BUILD_DIR) $(STAMPS_DIR) |
---|
34 | dh_clean |
---|
35 | |
---|
36 | $(BUILD_DIR) $(STAMPS_DIR): |
---|
37 | @[ -d $@ ] || mkdir -p $@ |
---|
38 | |
---|
39 | NO_ORIG = .svn debian scripts |
---|
40 | |
---|
41 | DIR_ORIG = ../orig/xen-common-$(VERSION) |
---|
42 | |
---|
43 | orig: $(DIR_ORIG) |
---|
44 | rsync --delete $(foreach t, $(NO_ORIG), --exclude $(t)) --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ . |
---|
45 | |
---|
46 | # This is to make dpatch-edit-patch work |
---|
47 | unpatch: clean |
---|
48 | |
---|
49 | maintainerclean: |
---|
50 | rm -rf $(filter-out $(NO_ORIG), $(wildcard * .[^.]*)) |
---|
51 | |
---|
52 | install: $(STAMPS_DIR)/source |
---|
53 | dh_testdir |
---|
54 | dh_testroot |
---|
55 | dh_clean -k |
---|
56 | $(MAKE) -C $(BUILD_DIR)/tools/examples install DESTDIR=$(CURDIR)/debian/tmp DISTDIR=$(CURDIR)/debian/tmp |
---|
57 | $(MAKE) -C $(BUILD_DIR)/scripts install DESTDIR=$(CURDIR)/debian/tmp |
---|
58 | |
---|
59 | binary-indep: install |
---|
60 | dh_testdir |
---|
61 | dh_testroot |
---|
62 | dh_install --sourcedir=debian/tmp |
---|
63 | dh_installchangelogs |
---|
64 | dh_installdocs |
---|
65 | dh_installexamples |
---|
66 | dh_installinit -p xen-utils-common --name xend --no-restart-on-upgrade -- defaults 20 21 |
---|
67 | dh_installinit -p xen-utils-common --name xendomains --no-start -- defaults 21 20 |
---|
68 | dh_installman $(BUILD_DIR)/docs/man/* |
---|
69 | dh_link |
---|
70 | dh_strip |
---|
71 | dh_compress |
---|
72 | dh_fixperms |
---|
73 | dh_installdeb |
---|
74 | dh_shlibdeps |
---|
75 | dh_gencontrol |
---|
76 | dh_md5sums |
---|
77 | dh_builddeb |
---|
78 | |
---|
79 | binary-arch: |
---|
80 | |
---|
81 | binary: build binary-indep binary-arch |
---|
82 | .PHONY: build clean binary-indep binary-arch binary install #PHONY_CONFIGURE# |
---|