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
|
#!/usr/bin/make -f
export DH_OPTIONS
export DH_GOPKG := code.google.com/p/log4go
%:
dh $@ --buildsystem=golang --with=golang
override_dh_auto_configure:
# Move away examples, they cannot be compiled in a single package
[ ! -d examples ] || mv examples .examples
dh_auto_configure
override_dh_auto_install:
[ ! -d .examples ] || mv .examples examples
dh_auto_install
rm -rf debian/golang-log4go-dev/usr/share/gocode/src/code.google.com/p/log4go/.examples
override_dh_clean:
[ ! -d .examples ] || mv .examples examples
dh_clean
.PHONY: get-orig-source
PKD = $(abspath $(dir $(MAKEFILE_LIST)))
PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
REV = $(shell echo $(VER) | perl -ne 'print $$1 if m/~hg(\d+)$$/')
get-orig-source: $(PKG)_$(VER).orig.tar.xz $(info I: $(PKG)_$(VER))
$(PKG)_$(VER).orig.tar.xz:
GOPATH=$(PKG)-$(VER) go get -d $(DH_GOPKG)
cd $(PKG)-$(VER)/src/$(DH_GOPKG) \
&& hg archive -r $(REV) $(PKG)-$(VER).tar \
&& xz $(PKG)-$(VER).tar
mv $(PKG)-$(VER)/src/$(DH_GOPKG)/$(PKG)-$(VER).tar.xz $@
rm -rf $(PKG)-$(VER)
|