forked from devstructure/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
179 lines (159 loc) · 5.51 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
VERSION=3.0.2
prefix=/usr/local
bindir=${prefix}/bin
libdir=${prefix}/lib
pydir=$(shell python pydir.py ${libdir})
mandir=${prefix}/share/man
sysconfdir=${prefix}/etc
all:
clean:
rm -f \
control \
blueprint/**.pyc \
man/man*/*.[12345678] man/man*/*.html
install: install-bin install-lib install-man install-sysconf
install-bin:
install -d $(DESTDIR)$(bindir)
install \
bin/blueprint \
bin/blueprint-apply \
bin/blueprint-create \
bin/blueprint-destroy \
bin/blueprint-list \
bin/blueprint-show \
$(DESTDIR)$(bindir)/
install-lib:
install -d $(DESTDIR)$(pydir)/blueprint/
install -m644 \
blueprint/chef.py \
blueprint/context_managers.py \
blueprint/git.py \
blueprint/__init__.py \
blueprint/manager.py \
blueprint/puppet.py \
blueprint/sh.py \
$(DESTDIR)$(pydir)/blueprint/
install -d $(DESTDIR)$(pydir)/blueprint/backend/
install -m644 \
blueprint/backend/apt.py \
blueprint/backend/files.py \
blueprint/backend/gem.py \
blueprint/backend/__init__.py \
blueprint/backend/php.py \
blueprint/backend/pypi.py \
blueprint/backend/sources.py \
$(DESTDIR)$(pydir)/blueprint/backend/
PYTHONPATH=$(DESTDIR)$(pydir) python -mcompileall \
$(DESTDIR)$(pydir)/blueprint
install-man:
install -d $(DESTDIR)$(mandir)/man1
install -m644 \
man/man1/blueprint.1 \
man/man1/blueprint-apply.1 \
man/man1/blueprint-create.1 \
man/man1/blueprint-destroy.1 \
man/man1/blueprint-list.1 \
man/man1/blueprint-show.1 \
$(DESTDIR)$(mandir)/man1/
install -d $(DESTDIR)$(mandir)/man5
install -m644 \
man/man5/blueprint.5 \
man/man5/blueprintignore.5 \
$(DESTDIR)$(mandir)/man5/
install -d $(DESTDIR)$(mandir)/man7
install -m644 man/man7/blueprint.7 $(DESTDIR)$(mandir)/man7/
install-sysconf:
install -d $(DESTDIR)$(sysconfdir)/bash_completion.d
install -m644 etc/bash_completion.d/blueprint \
$(DESTDIR)$(sysconfdir)/bash_completion.d/
uninstall: uninstall-bin uninstall-lib uninstall-man uninstall-sysconf
uninstall-bin:
rm -f \
$(DESTDIR)$(bindir)/blueprint \
$(DESTDIR)$(bindir)/blueprint-apply \
$(DESTDIR)$(bindir)/blueprint-create \
$(DESTDIR)$(bindir)/blueprint-destroy \
$(DESTDIR)$(bindir)/blueprint-list \
$(DESTDIR)$(bindir)/blueprint-show
rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(bindir)
uninstall-lib:
rm -f \
$(DESTDIR)$(pydir)/blueprint/chef.py \
$(DESTDIR)$(pydir)/blueprint/chef.pyc \
$(DESTDIR)$(pydir)/blueprint/context_managers.py \
$(DESTDIR)$(pydir)/blueprint/context_managers.pyc \
$(DESTDIR)$(pydir)/blueprint/git.py \
$(DESTDIR)$(pydir)/blueprint/git.pyc \
$(DESTDIR)$(pydir)/blueprint/__init__.py \
$(DESTDIR)$(pydir)/blueprint/__init__.pyc \
$(DESTDIR)$(pydir)/blueprint/manager.py \
$(DESTDIR)$(pydir)/blueprint/manager.pyc \
$(DESTDIR)$(pydir)/blueprint/puppet.py \
$(DESTDIR)$(pydir)/blueprint/puppet.pyc \
$(DESTDIR)$(pydir)/blueprint/sh.py \
$(DESTDIR)$(pydir)/blueprint/sh.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/apt.py \
$(DESTDIR)$(pydir)/blueprint/backend/apt.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/files.py \
$(DESTDIR)$(pydir)/blueprint/backend/files.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/gem.py \
$(DESTDIR)$(pydir)/blueprint/backend/gem.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/__init__.py \
$(DESTDIR)$(pydir)/blueprint/backend/__init__.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/php.py \
$(DESTDIR)$(pydir)/blueprint/backend/php.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/pypi.py \
$(DESTDIR)$(pydir)/blueprint/backend/pypi.pyc \
$(DESTDIR)$(pydir)/blueprint/backend/sources.py \
$(DESTDIR)$(pydir)/blueprint/backend/sources.pyc
rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(pydir)/blueprint/backend
uninstall-man:
rm -f \
$(DESTDIR)$(mandir)/man1/blueprint.1 \
$(DESTDIR)$(mandir)/man1/blueprint-apply.1 \
$(DESTDIR)$(mandir)/man1/blueprint-create.1 \
$(DESTDIR)$(mandir)/man1/blueprint-destroy.1 \
$(DESTDIR)$(mandir)/man1/blueprint-list.1 \
$(DESTDIR)$(mandir)/man1/blueprint-show.1 \
$(DESTDIR)$(mandir)/man5/blueprint.5 \
$(DESTDIR)$(mandir)/man5/blueprintignore.5 \
$(DESTDIR)$(mandir)/man7/blueprint.7
rmdir -p --ignore-fail-on-non-empty \
$(DESTDIR)$(mandir)/man1 \
$(DESTDIR)$(mandir)/man5 \
$(DESTDIR)$(mandir)/man7
uninstall-sysconf:
rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/blueprint
rmdir -p --ignore-fail-on-non-empty \
$(DESTDIR)$(sysconfdir)/bash_completion.d
build:
sudo make deb
make pypi
deb:
[ "$$(whoami)" = "root" ] || false
m4 -D__VERSION__=$(VERSION)-1 control.m4 >control
debra create debian control
make install prefix=/usr sysconfdir=/etc DESTDIR=debian
chown -R root:root debian
debra build debian blueprint_$(VERSION)-1_all.deb
debra destroy debian
pypi:
python setup.py bdist_egg
deploy:
scp -i ~/production.pem blueprint_$(VERSION)-1_all.deb [email protected]:
ssh -i ~/production.pem -t [email protected] "sudo freight add blueprint_$(VERSION)-1_all.deb apt/lucid apt/maverick && rm blueprint_$(VERSION)-1_all.deb && sudo freight cache apt/lucid apt/maverick"
python setup.py sdist upload
man:
find man -name \*.ronn | xargs -n1 ronn \
--manual=Blueprint --organization=DevStructure --style=toc
gh-pages: man
mkdir -p gh-pages
find man -name \*.html | xargs -I__ mv __ gh-pages/
git checkout -q gh-pages
cp -R gh-pages/* ./
rm -rf gh-pages
git add .
git commit -m "Rebuilt manual."
git push origin gh-pages
git checkout -q master
.PHONY: all clean install install-bin install-lib install-man install-sysconf uninstall uninstall-bin uninstall-lib uninstall-man uninstall-sysconf deb deploy man gh-pages