Imported Upstream version 0.3.0
[debian/orchestra.git] / Makefile
1 #
2 # version of Orchestra
3 #
4 VERSION=0.3.0
5
6 #
7 # packaging revision.
8 #
9 REVISION=1
10
11 # remove at your own peril.
12 #
13 # This tells goinstall to work against the local directory as the
14 # build/source path, and not use the system directories.
15 #
16 GOPATH=$(PWD)/build-tree:$(PWD)
17 GOINSTALL_FLAGS=-dashboard=false -clean=true -u=false -make=false
18
19 export GOPATH
20
21 all: build
22
23 build:  build-tree
24         goinstall $(GOINSTALL_FLAGS) conductor
25         goinstall $(GOINSTALL_FLAGS) player
26         goinstall $(GOINSTALL_FLAGS) submitjob
27         goinstall $(GOINSTALL_FLAGS) getstatus
28
29 build-tree:
30         mkdir -p build-tree/src
31         mkdir -p build-tree/bin
32         mkdir -p build-tree/pkg
33
34 clean:
35         -$(RM) -r build-tree/pkg
36         -$(RM) -r build-tree/bin
37
38 distclean:
39         -$(RM) -r build-tree
40
41 ### NOTE:  Make sure the checkouts have the correct tags in the lines below!
42 deps:   distclean build-tree
43         mkdir -p build-tree/src/github.com/kuroneko && cd build-tree/src/github.com/kuroneko && git clone http://github.com/kuroneko/configureit.git && cd configureit && git checkout v0.1
44         mkdir -p build-tree/src/goprotobuf.googlecode.com && cd build-tree/src/goprotobuf.googlecode.com && hg clone -r go.r60 http://goprotobuf.googlecode.com/hg
45
46 archive.deps:   deps
47         tar czf ../orchestra-$(VERSION).build-tree.tar.gz -C build-tree --exclude .git --exclude .hg . 
48
49 archive.release:        archive.deps
50         git archive --format=tar --prefix=orchestra-$(VERSION)/ v$(VERSION) | gzip -9c > ../orchestra-$(VERSION).tgz
51
52 .PHONY : debian debian.orig debian.debian debian.build-tree archive.deps archive.release archive.head
53
54 archive.head:
55         git archive --format=tar --prefix=orchestra/ HEAD | gzip -9c > ../orchestra-HEAD.tgz
56
57 DEBIAN_VERSION=$(shell dpkg-parsechangelog | grep -e 'Version:' | awk '{ print $$2 }')
58 DEBIAN_SRC_VERSION=$(shell echo $(DEBIAN_VERSION) | cut -d- -f 1)
59
60 debian: debian.orig debian.debian debian.build-tree clean
61         cd .. && dpkg-source -b $(PWD)
62
63 debian.orig:
64         git archive --format=tar --prefix=orchestra-$(DEBIAN_SRC_VERSION)/ v$(DEBIAN_SRC_VERSION) | gzip -9c > ../orchestra_$(DEBIAN_SRC_VERSION).orig.tar.gz
65
66 debian.debian:
67         tar zcf ../orchestra_$(DEBIAN_VERSION).debian.tar.gz -C debian .
68
69 debian.build-tree:      deps
70         tar zcf ../orchestra_$(DEBIAN_SRC_VERSION).orig-build-tree.tar.gz -C build-tree --exclude .git --exclude .hg .