summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 00db236f9cca5088cfb1056c469016c963d29f36 (plain)
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
VERSION=`git describe | sed 's/^v//; s/-/./g' `
NAME="publik-base-theme"

prefix = /usr

all: themes.json icons css

static/includes/_data_uris.scss: $(wildcard static/includes/img/*)
	python make_data_uris.py static/includes/

static/grandlyon-gnm/_data_uris.scss: $(wildcard static/grandlyon-gnm/img/*)
	python make_data_uris.py static/grandlyon-gnm/

static/toodego/_data_uris.scss: $(wildcard static/toodego/img/*)
	python make_data_uris.py static/toodego/

static/lille/_data_uris.scss: $(wildcard static/lille/img/*)
	python make_data_uris.py static/lille/

static/lomme/_data_uris.scss: $(wildcard static/lomme/img/*)
	python make_data_uris.py static/lomme/

static/hellemmes/_data_uris.scss: $(wildcard static/hellemmes/img/*)
	python make_data_uris.py static/hellemmes/

themes.json: $(wildcard static/*/config.json)
	python create_themes_json.py

%.css: export LC_ALL=C.UTF-8
.SECONDEXPANSION:
%.css: %.scss $(wildcard static/includes/*.scss) static/includes/_data_uris.scss static/grandlyon-gnm/_data_uris.scss static/lille/_data_uris.scss static/lomme/_data_uris.scss static/hellemmes/_data_uris.scss static/toodego/_data_uris.scss $$(wildcard $$(@D)/*.scss)
	sass $< $@

css: $(shell python get_themes.py) static/portal-agent/css/agent-portal.css
	rm -rf static/*/.sass-cache/

icons:
	# chateauroux
	cd src/ && python render-imgs-dashboard.py ../static/chateauroux/img/ --normal 333333 --selected 0779B7 --title FFFFFF --title-width 80
	# grandlyon-gnm
	python src/grandlyon-gnm/render-imgs-signalement.py static/grandlyon-gnm/img/signalement/ --color FFFFFF # white
	python src/grandlyon-gnm/render-imgs-signalement.py static/grandlyon-gnm/img/signalement/ --color 2A2E49 # blue
	python src/grandlyon-gnm/render-imgs-signalement.py static/grandlyon-gnm/img/signalement/ --color DA0D02 # red
	# orleans
	cd src/ && python render-imgs-categories.py ../static/orleans/img/ --primary f05923 --secondary 34697D
	cd src/ && python render-imgs-dashboard.py ../static/orleans/img/ --normal FFFFFF --normal-width 30 --selected f05923 --selected-width 30 --title FFFFFF --title-width 80
	# publik
	cd src/ && python render-imgs-categories.py ../static/publik/img/
	cd src/ && python render-imgs-dashboard.py ../static/publik/img/ --normal 4D4D4D --selected DF017A --title FFFFFF --title-width 80
	# somme
	cd src/ && python render-imgs-categories.py ../static/somme-cd80/img/ --primary A8002B --secondary A8002B
	cd src/ && python render-imgs-dashboard.py ../static/somme-cd80/img/ --normal 4D4D4D --selected 87A738 --title FFFFFF --title-width 80
	cd src/ && python render-imgs-categories.py ../static/hautes-alpes-2018/img/icon-rouge --primary B73720 --secondary B73720
	cd src/ && python render-imgs-categories.py ../static/hautes-alpes-2018/img/icon-bleu --primary 1C515E --secondary 1C515E
	# tournai
	cd static/tournai/ && for F in assets/*.svg; do inkscape --without-gui --file $$F --export-area-drawing --export-area-snap --export-png img/$$(basename $$F .svg).png --export-width 40; done

clean:
	rm -rf sdist
	rm -f src/tmp-*.svg
	rm -f static/*/_data_uris.scss

DIST_FILES = \
	Makefile \
	desc.xml \
	create_themes_json.py \
	get_themes.py \
	make_data_uris.py \
	static templates \
	src

dist: clean
	-mkdir sdist
	rm -rf sdist/$(NAME)-$(VERSION)
	mkdir -p sdist/$(NAME)-$(VERSION)
	for i in $(DIST_FILES); do \
		cp -R "$$i" sdist/$(NAME)-$(VERSION); \
	done

install:
	mkdir -p $(DESTDIR)$(prefix)/share/publik/themes/publik-base
	cp -r static templates themes.json desc.xml $(DESTDIR)$(prefix)/share/publik/themes/publik-base
	rm $(DESTDIR)$(prefix)/share/publik/themes/publik-base/static/*/config.json
	mkdir -p $(DESTDIR)$(prefix)/share/wcs/themes/
	ln -s $(prefix)/share/publik/themes/publik-base $(DESTDIR)$(prefix)/share/wcs/themes/publik-base

dist-bzip2: dist
	-mkdir sdist
	cd sdist && tar cfj ../sdist/$(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION)

version:
	@(echo $(VERSION))

name:
	@(echo $(NAME))

fullname:
	@(echo $(NAME)-$(VERSION))