-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.release
57 lines (49 loc) · 2.82 KB
/
Makefile.release
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
# -*- Makefile -*-
PRODUCT=vtwm
RELEASEDIR=.release
RSYNCDIR=$(RELEASEDIR)/$(PRODUCT)-SF-FRS
SFTPBATCH=$(RELEASEDIR)/sftp.batch
release:
@VERSION=`git describe --exact-match --match '[0-9]*' 2>/dev/null`; \
if [ $$? -ne 0 -o "$$VERSION" = "" ]; then echo "Not a tagged version, you may not release"; exit 3; fi; \
if [ `git status --porcelain | wc -l` -gt 0 ]; then echo "Uncommitted changes, you may not release"; exit 2; fi; \
VERSION=$$VERSION $(MAKE) -f Makefile.release subrelease
subrelease:
@if [ -z "$$VERSION" ]; then VERSION=`git describe --tags 2>/dev/null`; fi; \
git checkout-index -af --prefix=$(RELEASEDIR)/$(PRODUCT)-$$VERSION/; \
cd $(RELEASEDIR)/$(PRODUCT)-$$VERSION; \
sed -i "s/SUBST/$${VERSION}/" version.c; \
cd ..; \
tar czf $(PRODUCT)-$$VERSION.tar.gz $(PRODUCT)-$$VERSION; \
rm -rf $(RELEASEDIR)/$(PRODUCT)-$$VERSION; \
echo $(RELEASEDIR)/$(PRODUCT)-$$VERSION.tar.gz
install:
echo "Please use install-snap install-stable"; exit 1;
install-snap: NAME=snap
install-snap: install-actual
install-stable: NAME=stable
install-stable: ALTNAME=snap
install-stable: install-actual
install-actual: clean release
@if [ "$(NAME)" = "" ]; then echo "Please use install-snap install-stable"; exit 1; fi
@VERSION=`git describe --exact-match --match '[0-9]*' 2>/dev/null`; \
if [ $$? -ne 0 -o "$$VERSION" = "" ]; then echo "Not a tagged version, you may not install release"; exit 3; fi; \
if [ "$$SFUSER" = "" ]; then echo "Must set SFUSER environmental variable to install "; exit 4; fi; \
mkdir -p $(RSYNCDIR)/ReleaseNotes; \
cp doc/CHANGELOG $(RSYNCDIR)/ReleaseNotes/CHANGELOG-$$VERSION; \
echo "cd /home/frs/project/v/vt/vtwm" > $(SFTPBATCH); \
echo "rm $(PRODUCT)-$(NAME).tar.gz" >> $(SFTPBATCH); \
echo "rm ReleaseNotes/CHANGELOG-$(NAME)" >> $(SFTPBATCH); \
ln -s CHANGELOG-$$VERSION $(RSYNCDIR)/ReleaseNotes/CHANGELOG-$(NAME); \
ln -s $(PRODUCT)-$$VERSION.tar.gz $(RSYNCDIR)/$(PRODUCT)-$(NAME).tar.gz; \
if [ "$(ALTNAME)" != "" ]; then ln -s $(PRODUCT)-$$VERSION.tar.gz $(RSYNCDIR)/$(PRODUCT)-$(ALTNAME).tar.gz; fi; \
if [ "$(ALTNAME)" != "" ]; then echo "rm $(PRODUCT)-$(ALTNAME).tar.gz" >> $(SFTPBATCH); fi; \
if [ "$(ALTNAME)" != "" ]; then ln -s CHANGELOG-$$VERSION $(RSYNCDIR)/ReleaseNotes/CHANGELOG-$(ALTNAME); fi; \
if [ "$(ALTNAME)" != "" ]; then echo "rm ReleaseNotes/CHANGELOG-$(ALTNAME)" >> $(SFTPBATCH); fi; \
cp $(RELEASEDIR)/$(PRODUCT)-$$VERSION.tar.gz $(RSYNCDIR); \
chmod -R u+rwX,g+rwX,o+rX $(RSYNCDIR); \
sftp -b $(SFTPBATCH) $$SFUSER,[email protected]; \
rsync -vPr --links -e ssh $(RSYNCDIR)/. $$SFUSER,[email protected]:/home/frs/project/v/vt/vtwm
make -f Makefile.release clean
clean:
rm -fr $(RELEASEDIR)