forked from mailpile/Mailpile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (107 loc) · 4.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
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
# Recipes for stuff
export PYTHONPATH := .
all: alltests docs dev 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
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 python-pexpect
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
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 python-pexpect
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
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 testing/gpg-keyring
@python2 scripts/mailpile-test.py || true
@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` mailpile-tmp.py mailpile.py
@rm -f .appver MANIFEST setup.cfg .SELF .*deps
@rm -f scripts/less-compiler.mk
@rm -rf *.egg-info build/ mp-virtualenv/ dist/ testing/tmp/
virtualenv:
virtualenv -p python2 mp-virtualenv
bash -c 'source mp-virtualenv/bin/activate && pip install -r requirements.txt && python setup.py install'
js:
@cat static/default/js/mailpile.js > static/default/js/mailpile-min.js
@cat `find static/default/js/app/ -name "*.js"` >> static/default/js/mailpile-min.js
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 static/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