~listen-devel/listen/listen.ppa

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
64
65
#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pycentral

DEB_MAKE_BUILD_TARGET    := listen 
DEB_MAKE_INSTALL_TARGET  := install DESTDIR=$(CURDIR)/debian/listen/

include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk

DEB_INSTALL_MANPAGES_listen = listen.1

build/listen::
	docbook2x-man debian/listen.1.docbook
	convert -resize 32x32 $(CURDIR)/data/img/listen.png $(CURDIR)/debian/listen.xpm

binary-install/listen::
	dh_pycentral

clean::
	rm -f listen.1
	rm -f debian/listen.xpm

# Grab from gwibber debian/rules

# Tarball (get-orig-source & get-current-source)
LISTEN_URL := lp:listen
TMP_DIR     := tmp-$(shell echo $$$$)
DEBIAN_NAME := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p')

ifneq (,$(DEBIAN_TAG))
get-orig-source: TAG  = $(NULL)
else
get-orig-source: TAG  = -r $(shell bzr log --limit 1 $(LISTEN_URL) | grep ^r | head -1 | cut -d' ' -f2)
endif
get-orig-source: gos-all

get-current-source: TAG = -r $(DEBIAN_REVISION)
get-current-source: gos-all

gos-all: gos-co gos-pack
gos-co:
	rm -rf $(TMP_DIR)
	mkdir $(TMP_DIR)
	# Checkout
	bzr branch $(LISTEN_URL) $(TMP_DIR)/src

ifneq (,$(DEBIAN_TAG))
gos-pack: VERSION  = $(shell echo $(DEBIAN_TAG) | cut -d= -f2)
else
gos-pack: REVISION = $(shell cd $(TMP_DIR)/src && bzr log --limit 1 | grep ^r | head -1 | cut -d' ' -f2)
gos-pack: VERSION  = $(shell grep '^VERSION' $(TMP_DIR)/src/Makefile | head -1 | awk -F= '{print $$2}' | sed -e 's/~.*//g' -e 's/ //g')~bzr$(REVISION)
endif
gos-pack:
	# Add bzr version
	sed -i -e 's/^VERSION.*/VERSION = $(VERSION)/' $(TMP_DIR)/src/Makefile
	# Pack
	mv $(TMP_DIR)/src $(TMP_DIR)/$(DEBIAN_NAME)-$(VERSION)
	cd $(TMP_DIR) && tar zcf ../$(DEBIAN_NAME)_$(VERSION).orig.tar.gz --exclude=.bzr $(DEBIAN_NAME)-$(VERSION)
	rm -rf $(TMP_DIR)
	@echo "# Done (created $(DEBIAN_NAME)_$(VERSION).orig.tar.gz)"
	@ls -l $(DEBIAN_NAME)_$(VERSION).orig.tar.gz