~niemeyer/cobzr/package

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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export GOPATH=$(CURDIR)

PKGDIR=debian/cobzr

%:
	dh $@ 

clean:
	dh_clean
	rm -rf $(GOPATH)/bin/* $(GOPATH)/pkg/*
	#cd $(GOPATH)/src && find * -name '*.go' -exec dirname {} \; | xargs -n1 go clean
	rm -f $(GOPATH)/goinstall.log

binary-arch: clean
	dh_prep
	dh_installdirs
	cd $(GOPATH)/src && find * -name '*.go' -exec dirname {} \; | xargs -n1 go install
	mkdir -p $(PKGDIR)/usr/bin
	cp $(GOPATH)/bin/* $(PKGDIR)/usr/bin/
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch