summaryrefslogtreecommitdiff
path: root/pkg/pyinst/pyinst-build.mk
blob: b6a7a6f3600b3ff03510d3c7b9ac1071dbe64ea0 (plain)
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
freeze-ver:
	cp pkg/version-template src/leap/bitmask/_version.py
	sed  -i 's/^version_version\(.*\)/version_version = "$(NEXT_VERSION)"/'  src/leap/bitmask/_version.py
	sed  -i 's/^full_revisionid\(.*\)/full_revisionid = "$(GIT_COMMIT)"/' src/leap/bitmask/_version.py

hash-binaries:
	# TODO get from a build dir
	OPENVPN_BIN=/usr/sbin/openvpn BITMASK_ROOT=pkg/linux/bitmask-root python setup.py hash_binaries

pyinst: freeze-ver hash-binaries
	pyinstaller -y pkg/pyinst/bitmask.spec

reset-ver:
	git checkout -- src/leap/bitmask/_version.py

pyinst-hacks:
	cp ../leap_common/src/leap/common/cacert.pem $(DIST)
	mkdir -p $(DIST)pysqlcipher
	mkdir -p $(DIST)pixelated
	mkdir -p $(DIST)twisted/web
	cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/pysqlcipher/_sqlite.so $(DIST)pysqlcipher 
	cp -r $(VIRTUAL_ENV)/lib/python2.7/site-packages/pixelated_www $(DIST)
	cp -r $(VIRTUAL_ENV)/lib/python2.7/site-packages/pixelated/assets/ $(DIST)pixelated
	cp -r $(VIRTUAL_ENV)/lib/python2.7/site-packages/twisted/web/failure.xhtml $(DIST)twisted/web/

pyinst-trim:
	rm -f $(DIST)libQtOpenGL.so.4
	rm -f $(DIST)libQtSql.so.4
	rm -f $(DIST)libQt3Support.so.4
	rm -f $(DIST)libaudio.so.2
	rm -f $(DIST)libnvidia-*
	#rm -f dist/bitmask/libgstvideo-1.0.so.0
	#rm -f dist/bitmask/libgstaudio0.0.so.0
	#rm -f dist/bitmask/libgstreamer-1.0.so.0

pyinst-cleanup:
	rm -rf $(DIST)config
	mkdir -p $(DIST_VERSION)
	mv $(DIST) $(DIST_VERSION)lib
	cd pkg/launcher && make 
	mv pkg/launcher/bitmask $(DIST_VERSION)

pyinst-distribution-data:
	cp release-notes.rst $(DIST_VERSION)
	cp pkg/PixelatedWebmail.README $(DIST_VERSION)
	cp LICENSE $(DIST_VERSION)

pyinst-linux-helpers:
	mkdir -p $(DIST_VERSION)apps/eip/files
	# TODO compile static
	cp /usr/sbin/openvpn $(DIST_VERSION)apps/eip/files/leap-openvpn
	cp pkg/linux/bitmask-root $(DIST_VERSION)apps/eip/files/
	cp pkg/linux/leap-install-helper.sh $(DIST_VERSION)apps/eip/files/
	cp pkg/linux/polkit/se.leap.bitmask.bundle.policy $(DIST_VERSION)apps/eip/files/
	mkdir -p $(DIST_VERSION)apps/mail
	# TODO compile static
	cp /usr/bin/gpg $(DIST_VERSION)apps/mail

pyinst-tar:
	cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION)

pyinst-sign:
	gpg2 -a --sign --detach-sign dist/Bitmask.$(NEXT_VERSION).tar.gz 

pyinst-upload:
	scp dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./ 

pyinst-linux: pyinst reset-ver pyinst-hacks pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-linux-helpers pyinst-tar

clean_pkg:
	rm -rf build dist