| 
1
2
3
4
56
7
89
10
11
12
1314
1516
1718
19
20
21
22
23
24
25
26
27
28
2930
31
32
33
34
35
3637
3839
40
41
42
43
44
45
46
47
48
49
50 | 
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
66
67
68
69
70
71
72
73
74
75
76
77
 | 
+
+
+
+
-
+
+
+
-
-
+
+
+
+
+
+
-
+
-
-
-
+
+
-
+
-
+
-
-
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 | 
# Requires 
# ยท http://fossil.include-once.org/versionnum/
# ยท http://fossil.include-once.org/xpm/
SHELL   := /bin/bash #(for brace expansion)
NAME    := streamtuner2
VERSION := $(shell version get:plugin st2.py)
VERSION := $(shell version get:plugin st2.py || echo 2.1dev)
DEST    := /usr/share/streamtuner2
INST    := install -v
PACK    := xpm
DEPS    := -n $(NAME) -d python-pyquery -d python-gtk2 -d python-requests -d python-keybinderOPTS    := -s src -u man,fixperms -f --prefix=OPTS    := -s src -u man,fixperms -f --prefix=$(DEST) --deb-compression xz --rpm-compression xz --exe-autoextract
.PHONY:  bin
all:  gtk3 #(most used)
pack: all ver docs xpm src
gtk3: gtk3.xml.gz
zip:  pyz/usr/share/streamtuner2--deb-compression xz --rpm-compression xz --exe-autoextract
all: gtk3 #(most used)# Convert between internal GtkBuilder-# Convert between internal GtkBuilder-gzipped file and uncompressed xmlzlibfile and uncompressed xmlgtk3.xml.gz: gtk3.xml
	gzip -c9 < gtk3.xml > gtk3.xml.gz
glade:# (workaround because Python2 has no working gzip support)gtk3:zlib-flate-compress< gtk3.xml > gtk3.xml.zlib	gzip -dc > gtk3.xml < gtk3.xml.gz
	glade gtk3.xml 2>/dev/nullzlib-flate-uncompress< gtk3.xml.zlib > gtk3.xml	gzip -c9 < gtk3.xml > gtk3.xml.gzzlib-flate-compress< gtk3.xml > gtk3.xml.zlib# Prepare packaging
docs:	# update static files
	gzip -9c NEWS > NEWS.gz
ver:	# copy `version:` info
	version get:plugin st2.py write:control PKG-INFO
clean:
	rm *.pyc */*.pyc
	rm -r __pycache__ */__pycache__
#-- bundles# Package up using fpm/xpmpack:	gtk3, ver, docs, xpm, srcxpm: debxpm: deb pyz bin rpm exe
deb:
	$(PACK) $(OPTS) $(DEPS) -t deb -p "$(NAME)-VERSION.deb" st2.py
rpm:
	$(PACK) $(OPTS) $(DEPS) -t rpm -p "$(NAME)-VERSION.rpm" st2.py
bin:
	$(PACK) $(OPTS) $(DEPS) -t tar -p "$(NAME)-VERSION.bin.txz" st2.py,pyz#,bin, rpm,exepyz:zip:pyz	$(PACK) -s src -t zip -p "$(PACK) -s src -t zip -p ".pyz" --prefix=./ --verbose -f .zip.py st2.py
	echo "#!/usr/bin/env python" | cat - ".pyz" > "$(NAME)-$(VERSION).pyz"
	chmod +x "$(NAME)-$(VERSION).pyz" ; rm ".pyz"
exe:
	$(PACK) $(OPTS) $(DEPS) -t exe -p "$(NAME)-VERSION.exe" st2.py
src:
	cd .. && pax -wvJf streamtuner2/streamtuner2-$(VERSION).src.txz \
		streamtuner2/*.{py,png,svg,desktop} streamtuner2/channels/*.{py,png} \
		streamtuner2/{bundle/,help/,gtk,NEWS,READ,PACK,PKG,CRED,Make,bin,.zip}*
# test .deb contents
check:
	dpkg-deb -c streamtuner2*deb
	dpkg-deb -I streamtuner2*deb
	rpm -qpil *rpm
# manual installation
install:
	$(INST)		bin		/usr/bin/streamtuner2
	$(INST)		*.py		-d -t $(DEST)
	$(INST)		channels/	-d -t $(DEST)
	$(INST)		CREDITS		-d -t $(DEST)
	$(INST)		gtk3.*		-d -t $(DEST)
	$(INST)		help/		-d -t /usr/share/doc/streamtuner2/
	$(INST)		*.desktop	-t /usr/share/applications/
	$(INST)		help/str*2.1	-t /usr/share/man/man1/
	$(INST)		icon.png	-t /usr/share/pixmaps/streamtuner2.png
	$(INST)		README		-d -t /usr/share/doc/streamtuner2/
# start locally
st2: run
run:
	./st2.py$(NAME)-VERSION.pyz" --prefix=./ --verbose -f .zip.py st2.py |