forked from mailpile/Mailpile
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
155 lines (134 loc) · 5.16 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
# Recipes for stuff
export PYTHONPATH := .
all: alltests docs web compilemessages
dev:
@echo export PYTHONPATH=`pwd`
arch-dev:
sudo pacman -Syu community/python2-pillow extra/python2-lxml community/python2-jinja \
community/python2-pep8 extra/python2-nose community/phantomjs \
extra/python2-pip community/python2-mock \
extra/ruby
TMPDIR=`mktemp -d /tmp/aur.XXXXXXXXXX`; \
cd $$TMPDIR; \
pacman -Qs '^yuicompressor$$' > /dev/null; \
if [ $$? -ne 0 ]; then \
curl -s https://aur.archlinux.org/packages/yu/yuicompressor/yuicompressor.tar.gz | tar xzv; \
cd yuicompressor; \
makepkg -si; \
cd $$TMPDIR; \
fi; \
pacman -Qs '^spambayes$$' > /dev/null; \
if [ $$? -ne 0 ]; then \
curl -s https://aur.archlinux.org/packages/sp/spambayes/spambayes.tar.gz | tar xzv; \
cd spambayes; \
makepkg -si; \
fi; \
cd /tmp; \
rm -rf $$TMPDIR
sudo pip2 install 'selenium>=2.40.0'
which lessc >/dev/null || sudo gem install therubyracer less
which bower >/dev/null || sudo npm install -g bower
which uglify >/dev/null || sudo npm install -g uglify
fedora-dev:
sudo yum install python-imaging python-lxml python-jinja2 python-pep8 \
ruby-devel python-yui python-nose spambayes \
phantomjs python-pip python-mock npm
sudo yum install rubygems; \
sudo yum install python-pgpdump || pip install pgpdump
sudo pip install 'selenium>=2.40.0'
which lessc >/dev/null || sudo gem install therubyracer less
which bower >/dev/null || sudo npm install -g bower
which uglify >/dev/null || sudo npm install -g uglify
debian-dev:
sudo apt-get install python-imaging python-lxml python-jinja2 pep8 \
ruby-dev yui-compressor python-nose spambayes \
phantomjs python-pip python-mock npm
if [ "$(shell cat /etc/debian_version)" = "jessie/sid" ]; then\
sudo apt-get install rubygems-integration;\
else \
sudo apt-get install rubygems; \
fi
sudo apt-get install python-pgpdump || pip install pgpdump
sudo pip install 'selenium>=2.40.0'
which lessc >/dev/null || sudo gem install therubyracer less
which bower >/dev/null || sudo npm install -g bower
which uglify >/dev/null || sudo npm install -g uglify
docs:
@test -d doc || \
git submodule update --remote
@python2 mailpile/urlmap.py |grep -v ^FIXME: >doc/URLS.md
@ls -l doc/URLS.md
@python2 mailpile/defaults.py |grep -v -e ^FIXME -e ';timestamp' \
>doc/defaults.cfg
@ls -l doc/defaults.cfg
web: less js
@true
alltests: clean pytests
@chmod go-rwx mailpile/tests/data/gpg-keyring
@DISPLAY= python2 scripts/mailpile-test.py || true
@DISPLAY= nosetests
pytests:
@echo -n 'urlmap ' && python2 mailpile/urlmap.py -nomap
@echo -n 'search ' && python2 mailpile/search.py
@echo -n 'mailutils ' && python2 mailpile/mailutils.py
@echo -n 'config ' && python2 mailpile/config.py
@echo -n 'conn_brokers ' && python2 mailpile/conn_brokers.py
@echo -n 'util ' && python2 mailpile/util.py
@echo -n 'vcard ' && python2 mailpile/vcard.py
@echo -n 'workers ' && python2 mailpile/workers.py
@echo -n 'mailboxes/pop3 ' && python2 mailpile/mailboxes/pop3.py
@echo -n 'mail_source/imap ' && python2 mailpile/mail_source/imap.py
@echo 'crypto/streamer...' && python2 mailpile/crypto/streamer.py
@echo
clean:
@rm -f `find . -name \\*.pyc` \
`find . -name \\*.mo` \
mailpile-tmp.py mailpile.py \
.appver MANIFEST setup.cfg .SELF .*deps \
scripts/less-compiler.mk ghostdriver.log
@rm -rf *.egg-info build/ mp-virtualenv/ \
mailpile/tests/data/tmp/ testing/tmp/
mrproper: clean
@rm -rf dist/ bower_components/
sdist: clean
@python setup.py sdist
#bdist-prep: compilemessages web -- FIXME: Make building web assets work!
bdist-prep: compilemessages
@true
bdist:
@python setup.py bdist
virtualenv:
virtualenv -p python2 mp-virtualenv
bash -c 'source mp-virtualenv/bin/activate && pip install -r requirements.txt && python setup.py install'
js:
bower install
# Warning: Horrible hack to extract rules from Gruntfile.js
cat `cat Gruntfile.js \
|sed -e '1,/concat:/d ' \
|sed -e '1,/src:/d' -e '/dest:/,$$d' \
|grep / \
|sed -e "s/[',]/ /g"` \
>> mailpile/www/default/js/mailpile-min.js.tmp
uglify -s mailpile/www/default/js/mailpile-min.js.tmp \
mailpile/www/default/js/mailpile-min.js
@rm -f mailpile/www/default/js/mailpile-min.js.tmp
less: less-compiler
@make -s -f scripts/less-compiler.mk
less-loop: less-compiler
@echo 'Running less compiler every 15 seconds. CTRL+C quits.'
@while [ 1 ]; do \
make -s less; \
sleep 15; \
done
less-compiler:
@cp scripts/less-compiler.in scripts/less-compiler.mk
@find mailpile/www/default/less/ -name '*.less' \
|perl -npe s'/^/\t/' \
|perl -npe 's/$$/\\/' \
>>scripts/less-compiler.mk
@echo >> scripts/less-compiler.mk
@perl -e 'print "\t\@touch .less-deps", $/' >> scripts/less-compiler.mk
genmessages:
@scripts/make-messages.sh
compilemessages:
@scripts/compile-messages.sh