-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (59 loc) · 1.88 KB
/
Makefile
File metadata and controls
80 lines (59 loc) · 1.88 KB
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
NAME=chruby
VERSION=0.4.0
AUTHOR=postmodern
URL=https://github.com/$(AUTHOR)/$(NAME)
DIRS=etc lib bin sbin share
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.md *.txt
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)
PKG=$(PKG_DIR)/$(PKG_NAME).tar.gz
SIG=$(PKG).asc
DESTDIR?=/
PREFIX?=/usr/local
INSTALL_PATH=$(DESTDIR)/$(PREFIX)
DOC_DIR?=$(INSTALL_PATH)/share/doc/$(NAME)
pkg:
mkdir $(PKG_DIR)
share/man/man1/chruby.1: doc/man/chruby.1.md
kramdown-man <doc/man/chruby.1.md >share/man/man1/chruby.1
share/man/man1/chruby-exec.1: doc/man/chruby-exec.1.md
kramdown-man <doc/man/chruby-exec.1.md >share/man/man1/chruby-exec.1
man: share/man/man1/chruby.1
git commit -m "Updated the man pages" doc/man/chruby.1.md share/man/man1/chruby.1
man: share/man/man1/chruby-exec.1
git commit -m "Updated the man pages" doc/man/chruby-exec.1.md share/man/man1/chruby-exec.1
download: pkg
wget -O $(PKG) $(URL)/archive/v$(VERSION).tar.gz
build: pkg
git archive --output=$(PKG) --prefix=$(PKG_NAME)/ HEAD
sign: $(PKG)
gpg --sign --detach-sign --armor $(PKG)
git add $(PKG).asc
git commit $(PKG).asc -m "Added PGP signature for v$(VERSION)"
git push
verify: $(PKG) $(SIG)
gpg --verify $(SIG) $(PKG)
clean:
rm -f $(PKG) $(SIG)
all: $(PKG) $(SIG)
test/rubies:
./test/setup
test: test/rubies
SHELL=`which bash` ./test/runner
SHELL=`which zsh` ./test/runner
tag:
git push
git tag -s -m "Releasing $(VERSION)" v$(VERSION)
git push --tags
release: tag download sign
install:
for dir in $(INSTALL_DIRS); do mkdir -p $(INSTALL_PATH)/$$dir; done
for file in $(INSTALL_FILES); do cp $$file $(INSTALL_PATH)/$$file; done
mkdir -p $(DOC_DIR)
cp -r $(DOC_FILES) $(DOC_DIR)/
uninstall:
for file in $(INSTALL_FILES); do rm -f $(INSTALL_PATH)/$$file; done
rm -rf $(DOC_DIR)
.PHONY: build man download sign verify clean test tag release install uninstall all