summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 497902516f96e945193cf8bdf5dbccf7faf7bd34 (plain)
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
#!/usr/bin/make -f


DEBIAN_PATH  := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
SRC_VERSION  := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | \
	awk '/^Version:/ {sub(/[-+][^-]*/, "", $$2); print $$2}')

major := $(firstword $(subst ., ,$(SRC_VERSION)))
minor := $(lastword $(subst ., ,$(SRC_VERSION)))

url := git://github.com/illumos/illumos-gate.git

VER := $(major).$(minor)

year := $(shell expr 2010 + $(major))
month := $(minor)

illumos-gate:
	git clone $(url) illumos-gate || rm -rf illumos-gate

checkout: illumos-gate
	cd illumos-gate && git checkout `git rev-list -n 1 --before="$(year)-$(month)-01" master`
	touch $@

illumos-gate-$(VER).tar.xz: checkout
	tar -c -f - --exclude-vcs illumos-gate | xz -9 > $@

ChangeLog: checkout
	cd illumos-gate && git log --date-order --after=1/10/2011 --before="$(year)-$(month)-01" --stat > ../$@

build-arch build-indep build:

debian/control: debian/control.in debian/rules
	sed 's,@VER@,$(VER),g' $< > $@

binary-arch binary-indep binary: binary-stamp
binary-stamp: install-stamp debian/control
	dh_testroot
	dh_testdir
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb
	touch $@


install: install-stamp
install-stamp: illumos-gate-$(VER).tar.xz ChangeLog
	dh_testroot
	dh_testdir
	dh_installdirs usr/src/illumos-gate
	dh_install illumos-gate-$(VER).tar.xz usr/src/illumos-gate/
	dh_installchangelogs ChangeLog
	touch $@

clean: debian/control
	dh_clean
	rm -f ChangeLog
	rm -f checkout
	rm -f illumos-gate-$(VER).tar.xz
	rm -rf illumos-gate