forked from schweikert/mailgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (34 loc) · 1.19 KB
/
Makefile
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
VERSION_MAJOR=1
VERSION_MINOR=14
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
FILES=mailgraph.cgi mailgraph.css mailgraph-init README COPYING CHANGES
SVNREPO=svn://svn.schweikert.ch/mailgraph
D=mailgraph-$(VERSION)
all: tag-build
tag-build: tag build
tag:
@svn st | grep 'M' >/dev/null; \
if [ $$? -eq 0 ]; then \
echo "Commit your changes!"; \
exit 1; \
fi
@if svn ls $(SVNREPO)/tags/version-$(VERSION_MAJOR).$(VERSION_MINOR) >/dev/null 2>&1; then \
echo "Tag version-$(VERSION_MAJOR).$(VERSION_MINOR) already exists!"; \
exit 1; \
fi
svn cp -m 'Tag version $(VERSION_MAJOR).$(VERSION_MINOR)' $(SVNREPO)/trunk $(SVNREPO)/tags/version-$(VERSION_MAJOR).$(VERSION_MINOR)
build:
# D/mailgraph.pl
mkdir $(D)
perl embed.pl mailgraph.pl >$(D)/mailgraph.pl
perl -pi -e 's/^my \$$VERSION =.*/my \$$VERSION = "$(VERSION)";/' $(D)/mailgraph.pl
chmod 755 $(D)/mailgraph.pl
# mailgraph.cgi
perl -pi -e 's/^my \$$VERSION =.*/my \$$VERSION = "$(VERSION)";/' mailgraph.cgi
# copy the files
tar cf - $(FILES) | (cd mailgraph-$(VERSION) && tar xf -)
# tarball
tar czvf pub/mailgraph-$(VERSION).tar.gz mailgraph-$(VERSION)
rm -rf mailgraph-$(VERSION)
cp CHANGES pub
.PHONY: all tag-build merge build