~libravatar/libravatar/master

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
CSS := $(shell find static/css -type f -name "*.css" -a -not -name "*.css.css")
JS := $(shell find static/js -type f -name "*.js" -a -not -name "*.js.js")

MIN_CSS := ${CSS:=.css} 
MIN_JS := ${JS:=.js}
COMPRESSED_CSS := ${CSS:=.gz}
COMPRESSED_JS := ${JS:=.gz}
CLEANUP := 

all: $(MIN_CSS) $(MIN_JS) $(COMPRESSED_JS) $(COMPRESSED_CSS) mofiles

%.css: %
	yui-compressor -o $@ $<
%.js: %
	yui-compressor -o $@ $<

%.gz: %.css
	zopfli -c --i1000 $< > $@
%.gz: %.js
	zopfli -c --i1000 $< > $@

pofiles:
	cd libravatar && for l in ca cs en en_GB es eu de fr it ja nl pt_BR ru sq tr uk ; do django-admin makemessages -l $$l -e html,txt,json ; done

mofiles:
	cd libravatar && django-admin compilemessages

clean:
	rm -f $(COMPRESSED_CSS) $(COMPRESSED_JS) $(MIN_CSS) $(MIN_JS)
	find -name "*.pyc" -delete
	( [ -h libravatar/settings.py ] && rm -f libravatar/settings.py ) || true

lint:
	@echo Running pylint...
	@( [ -d debian/libravatar-www ] && rm -rf debian/libravatar-www/ ) || true
	@DJANGO_SETTINGS_MODULE=libravatar.settings find libravatar/ -type f -name "*.py" -exec pylint --rcfile=.pylintrc {} \;

pyflakes:
	@echo Running pyflakes...
	@pyflakes libravatar/

pep8:
	@echo Running pep8...
	@pep8 --ignore=E501,E128,E124,E265,E731 libravatar/

codespell:
	@echo Running codespell...
	@codespell libravatar/*.py libravatar/*/*.py

unittests:
	@echo Running unit tests...
	@python manage.py test libravatar/public libravatar/tools

test: pep8 pyflakes codespell unittests lint

package:
	dpkg-buildpackage -us -uc