forked from pwsafe/pwsafe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.linux
110 lines (81 loc) · 3.2 KB
/
Makefile.linux
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Toplevel Makefile for Linux build of PasswordSafe
# Since we use wxWidgets 3.x, while some distros still provide 2.8
# The following need to be set to point to the local build of wxWidgets.
# Alternately, you can just set WX_CONFIG in your shell environment
# export WX_CONFIG=$(HOME)/src/wxWidgets-3.0.2/wx-config
# version numbers are defined in version.wx
include version.wx
export VER_MAJOR
export VER_MINOR
export VER_REV
export VER_SPECIAL
export RELEASENUM := $(VER_MAJOR).$(VER_MINOR).$(VER_REV)
export RELEASE_SPECIAL := $(VER_SPECIAL)
export RELEASENAME := $(RELEASENUM)$(RELEASE_SPECIAL)
.PHONY: all tar signatures \
sha1sums upload upload-sf upload-src-sf upload-github git-tag I18N \
help
RELEASEDIR := ./Releases/
PKG_BASE := pwsafe
SRC_TGZ = $(PKG_BASE)-$(RELEASENAME)-src.tgz
MKDIR := mkdir -p
RM := /bin/rm -rf
GIT := git
GZIP := gzip
ECHO := /bin/echo
TAR := /usr/bin/tar
GPG := /usr/bin/gpg
GPG_SIGN := $(GPG) --detach-sign --default-key $(GPG_KEY)
SIGN_CMD := $(foreach file, $(wildcard $(RELEASEDIR)/*$(RELEASENAME)*), $(GPG_SIGN) $(file); )
SHA1SUM := /usr/bin/sha1sum
SF_UPLOAD_CMD := /usr/bin/rsync -avP -e ssh
SF_UPLOAD_DST := $(SF_UPLOAD_ROOT)/Linux-BETA/$(RELEASENUM)
RELTAG = wx$(subst .,_,$(RELEASENAME))
export CPPFLAGS += -std=c++11
all:
@echo "Toplevel make is no longer supported for building Linux versions of PasswordSafe. Please use cmake as described in README.LINUX.DEVELOPERS.md"
tar:
@$(MKDIR) $(RELEASEDIR)
@$(GIT) archive --format=tar.gz \
--prefix=$(PKG_BASE)-$(RELEASENAME)/ \
-o $(RELEASEDIR)/$(SRC_TGZ) \
$(RELEASENAME)
# Following needed because GitHub creates its own tar.gz and .zip files for a release
# and we need to verify those before signing them
cmpsrc-github: tar
(cd $(RELEASEDIR); $(TAR) xzf $(SRC_TGZ) && \
../Misc/sighlp_cmp.py -f ChangeLog -f pwsafe.pot -f version.h -v 1 -s $(RELEASENAME).zip \
https://github.com/pwsafe/pwsafe/archive/$(RELEASENAME).zip \
$(PKG_BASE)-$(RELEASENAME)/ && $(GPG_SIGN) $(RELEASENAME).zip; \
../Misc/sighlp_cmp.py -f ChangeLog -f pwsafe.pot -f version.h -v 1 -s $(RELEASENAME).tar.gz \
https://github.com/pwsafe/pwsafe/archive/$(RELEASENAME).tar.gz \
$(PKG_BASE)-$(RELEASENAME)/ && $(GPG_SIGN) $(RELEASENAME).tar.gz)
(cd $(RELEASEDIR); $(RM) $(RELEASENAME).zip $(RELEASENAME).tar.gz && $(RM) -rf $(PKG_BASE)-$(RELEASENAME))
@echo "GitHub source signature files ready to upload from $(RELEASEDIR)"
sha1sums:
(cd $(RELEASEDIR); $(SHA1SUM) *$(RELEASENAME)*)
signatures:
$(SIGN_CMD)
upload: upload-sf upload-src-sf upload-github
upload-sf:
$(SF_UPLOAD_CMD) \
$(wildcard $(RELEASEDIR)/passwordsafe-*$(RELEASENAME)*) \
$(wildcard $(RELEASEDIR)/pwsafe-*$(RELEASENAME)*) \
$(SF_UPLOAD_DST)
upload-github:
@echo $@ TBD
# Uploading source is a separate target as we only want to do this once,
# as opposed to uploading the compiled package, which we need to do per distro.
upload-src-sf:
$(SF_UPLOAD_CMD) \
$(wildcard $(RELEASEDIR)/pwsafe-*$(RELEASENAME)-src*) \
$(SF_UPLOAD_DST)
git-tag:
$(GIT) tag -u $(GPG_KEY) -m "tag wx $(RELEASENAME) release" $(RELEASENAME)
I18N:
$(MAKE) -C src/ui/wxWidgets/I18N mos
help:
$(MAKE) -C help
# Local variables:
# mode: makefile
# End: