forked from camptocamp/demo_geomapfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CONST_Makefile
1334 lines (1154 loc) · 49.4 KB
/
CONST_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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
PYTHON_VERSION = $(shell $(VENV_BIN)/python -c "import sys; print('%i.%i' % (sys.version_info.major, sys.version_info.minor))" 2> /dev/null)
export PACKAGE = demo
OPERATING_SYSTEM ?= LINUX
ifeq ($(DEBUG), TRUE)
ifeq ($(OPERATING_SYSTEM), WINDOWS)
PRERULE_CMD ?= @echo "Build $@ due mofification on $?"; ls -lt --reverse $? $@ || true
else
PRERULE_CMD ?= @echo "Build \033[1;34m$@\033[0m due mofification on \033[1;34m$?\033[0m"; ls -lt --reverse $? $@ || true
endif
endif
ifeq ($(OPERATING_SYSTEM), WINDOWS)
VENV_BIN = .build/venv/Scripts
PYTHON_BIN_POSTFIX = .exe
NODE_BIN_POSTFIX = .cmd
FIND ?= $(CYGWIN_PATH)/bin/find.exe
HOME_DIR ?= ""
# TILECLOUD_CHAIN require Shapely but does not have a system specific setup.
# You can still install it but you must install Shapely manualy inside
# TILECLOUD_CHAIN virtualenv
TILECLOUD_CHAIN ?= FALSE
# Some python packages are installed from already packaged wheels.
CONST_REQUIREMENT ?= CONST_requirements_windows.txt
# because Windows does not like path with //
PRINT_TMP ?= tmp
else
VENV_BIN ?= .build/venv/bin
PYTHON_BIN_POSTFIX =
NODE_BIN_POSTFIX =
FIND ?= find
HOME_DIR ?= $(HOME)/
# Use TileCloud chain
TILECLOUD_CHAIN ?= TRUE
TILECLOUD_CHAIN_LOCAL ?= FALSE
CONST_REQUIREMENT ?= CONST_requirements.txt
PRINT_TMP ?= /tmp
endif
TEMPLATE_EXCLUDE += .build node_modules \
print/templates CONST_alembic \
$(PACKAGE)/static/lib
FIND_OPTS = $(foreach ELEM, $(TEMPLATE_EXCLUDE),-path ./$(ELEM) -prune -o) -type f
# Do not minify the js / css, ...
DEVELOPMENT ?= FALSE
export DEVELOPMENT
# Language provided by the application
LANGUAGES ?= en fr de
NGEO_INTERFACES ?= desktop mobile
CGXP_INTERFACES ?=
CGXP_API ?= TRUE
INTERFACES += $(NGEO_INTERFACES) $(CGXP_INTERFACES)
export INTERFACES
# Used print version
PRINT_VERSION ?= 3
# Enable Docker target
DOCKER ?= FALSE
DOCKER_BASE ?= no
export DOCKER
export DOCKER_BASE
DOCKER_TAG ?= latest
# Use deploy
ifeq ($(DOCKER), FALSE)
DEPLOY ?= TRUE
else
DEPLOY ?= FALSE
INSTANCE_ID =
endif
export INSTANCE_ID
PIP_CMD ?= $(VENV_BIN)/pip
PIP_VERSION ?= $(shell grep ^pip== CONST_optional-requirements.txt --colour=never)
SETUPTOOLS_VERSION ?= $(shell grep ^setuptools== CONST_optional-requirements.txt --colour=never)
TILECLOUD_VERSION ?= $(shell grep ^tilecloud== CONST_optional-requirements.txt --colour=never)
TILECLOUDCHAIN_VERSION ?= $(shell grep ^tilecloud-chain== CONST_optional-requirements.txt --colour=never)
JSTOOLS_VERSION ?= $(shell grep ^JSTools== CONST_optional-requirements.txt --colour=never)
C2CCSSMIN_VERSION ?= $(shell grep ^c2c.cssmin== CONST_optional-requirements.txt --colour=never)
GIT_MODULES_FOLDER ?= .git/modules/
ifdef CGXP_INTERFACES
DEFAULT_WEB_RULE += build-cgxp
else
ifeq ($(CGXP_API), TRUE)
DEFAULT_WEB_RULE += build-cgxp
endif
endif
ifneq ($(NGEO_INTERFACES), "")
DEFAULT_WEB_RULE += build-ngeo
CLIENT_CHECK_RULE ?= lint-ngeo
endif
WEB_RULE ?= $(DEFAULT_WEB_RULE)
DEFAULT_BUILD_RULES ?= .build/requirements.timestamp $(WEB_RULE) $(PACKAGE)/version.py build-server apache
# TileCloud-chain
WMTSCAPABILITIES_PATH ?= 1.0.0/WMTSCapabilities-$(INSTANCE_ID).xml
export WMTSCAPABILITIES_PATH
ifeq ($(TILECLOUD_CHAIN), TRUE)
WMTSCAPABILITIES_FILE ?= /var/sig/tiles/$(WMTSCAPABILITIES_PATH)
DEFAULT_BUILD_RULES += apache/tiles.conf tilegeneration/config.yaml
ifeq ($(TILECLOUD_CHAIN_LOCAL), TRUE)
DEFAULT_BUILD_RULES += $(WMTSCAPABILITIES_FILE)
endif
endif
# Test packages
ifndef TEST_PACKAGES
TEST_PACKAGES = common
ifeq ($(DOCKER), FALSE)
TEST_PACKAGES += main
ifneq (, $(filter $(PRINT_VERSION), 2 3))
TEST_PACKAGES += print
endif
ifeq ($(MAPSERVER), TRUE)
TEST_PACKAGES += mapserver
endif
ifeq ($(POSTGRES), TRUE)
TEST_PACKAGES += postgres
endif
ifeq ($(TILECLOUD_CHAIN), TRUE)
TEST_PACKAGES += tilecloud-chain
endif
ifeq ($(DEPLOY), TRUE)
TEST_PACKAGES += deploy
endif
ifneq ($(NGEO_INTERFACES), "")
TEST_PACKAGES += ngeo
endif
else
TEST_PACKAGES += docker
endif # DOCKER
endif # TEST_PACKAGES
# Make rules
ifneq ($(TEST_PACKAGES), FALSE)
DEFAULT_BUILD_RULES += test-packages
endif
ifeq ($(TILECLOUD_CHAIN), TRUE)
DEFAULT_BUILD_RULES += tilegeneration/config.yaml
endif
ifeq ($(PRINT_VERSION), 2)
DEFAULT_BUILD_RULES += print
endif
ifeq ($(PRINT_VERSION), 3)
DEFAULT_BUILD_RULES += print
endif
ifeq (${DEPOY}, TRUE)
DEFAULT_BUILD_RULES += deploy/deploy.cfg
endif
ifeq (${DOCKER}, TRUE)
DEFAULT_BUILD_RULES += testDB
endif
BUILD_RULES ?= $(PRE_RULES) $(filter-out $(DISABLE_BUILD_RULES),$(DEFAULT_BUILD_RULES)) $(POST_RULES)
# Requirements
EGGS_DEPENDENCIES += .build/venv.timestamp-noclean setup.py \
CONST_versions_requirements.txt \
CONST_fixversions.txt \
CONST_optional-requirements.txt \
$(CONST_REQUIREMENT)
REQUIREMENTS ?= c2cgeoportal==2.2.0.dev9
REQUIREMENTS += -r $(CONST_REQUIREMENT)
DEV_REQUIREMENTS += -r CONST_fixversions.txt
DEV_REQUIREMENTS += -r CONST_dev-requirements.txt
ifeq ($(TILECLOUD_CHAIN), TRUE)
DEV_REQUIREMENTS += $(TILECLOUD_VERSION) $(TILECLOUDCHAIN_VERSION)
endif
ifneq ($(CGXP_INTERFACES), "")
REQUIREMENTS += $(JSTOOLS_VERSION)
DEV_REQUIREMENTS += $(C2CCSSMIN_VERSION)
endif
OUTPUT_DIR = $(PACKAGE)/static/build
# Git
GIT_REMOTE ?= origin
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
# Visible web URL
# The protocol part
VISIBLE_WEB_PROTOCOL ?= https
export VISIBLE_WEB_HOST
export VISIBLE_WEB_PROTOCOL
# ngeo
ANGULAR_VERSION = 1.6
ifeq ($(OPERATING_SYSTEM), LINUX)
NPM_CMD = node_modules/.bin/npm
else
NPM_CMD = npm
endif
APP_OUTPUT_DIR = $(PACKAGE)/static-ngeo/build
OL_JS_FILES = $(shell $(FIND) node_modules/openlayers/src/ol -type f -name '*.js' 2> /dev/null)
NGEO_JS_FILES = $(shell $(FIND) node_modules/ngeo/src -type f -name '*.js' 2> /dev/null)
APP_JS_FILES = $(shell $(FIND) $(PACKAGE)/static-ngeo/js $(PACKAGE)/static-ngeo/components -type f -name '*.js' 2> /dev/null)
APP_JS_MAKO_FILES += $(shell $(FIND) $(PACKAGE)/static-ngeo/js $(PACKAGE)/static-ngeo/components $(FIND_OPTS) -name "*.js.mako" -print 2> /dev/null)
APP_JS_JINJA_FILES += $(shell $(FIND) $(PACKAGE)/static-ngeo/js $(PACKAGE)/static-ngeo/components $(FIND_OPTS) -name "*.js.jinja" -print 2> /dev/null)
APP_JS_FILES += $(APP_JS_MAKO_FILES:.mako=) $(APP_JS_JINJA_FILES:.jinja=)
APP_HTML_FILES += $(addprefix $(PACKAGE)/templates/, $(addsuffix .html, $(NGEO_INTERFACES)))
NGEO_DIRECTIVES_PARTIALS_FILES = $(shell ls -1 node_modules/ngeo/src/directives/partials/*.html 2> /dev/null)
GMF_DIRECTIVES_PARTIALS_FILES = $(shell ls -1 node_modules/ngeo/contribs/gmf/src/directives/partials/*.html 2> /dev/null)
APP_DIRECTIVES_PARTIALS_FILES = $(shell $(FIND) $(PACKAGE)/static-ngeo/components $(PACKAGE)/static-ngeo/partials $(PACKAGE)/static-ngeo/js -type f -name '*.html' 2> /dev/null)
LESS_FILES = $(shell $(FIND) $(PACKAGE)/static-ngeo/less $(PACKAGE)/static-ngeo/components -type f -name '*.less' 2> /dev/null)
NGEO_GMF_FONTS = $(addprefix $(PACKAGE)/static-ngeo/fonts/gmf-icons, .woff .ttf .eot)
NGEO_FONTAWESOME_FONTS = $(addprefix $(PACKAGE)/static-ngeo/fonts/fontawesome-webfont, .woff .woff2 .ttf .eot)
NGEO_FONTS = $(NGEO_GMF_FONTS) $(NGEO_FONTAWESOME_FONTS)
JSON_CLIENT_LOCALISATION_FILES = $(addprefix $(APP_OUTPUT_DIR)/, $(addsuffix .json, $(LANGUAGES)))
L10N_CLIENT_POSTFIX=client
L10N_SERVER_POSTFIX=server
MO_CLIENT_LOCALISATION_FILES = $(addprefix $(PACKAGE)/locale/, $(addsuffix /LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po, $(LANGUAGES)))
ANGULAR_LOCALES_FILES = $(addprefix $(APP_OUTPUT_DIR)/angular-locale_, $(addsuffix .js, $(LANGUAGES)))
NGEO_OUTPUT_JS_INTERFACES_FILES = $(addprefix $(APP_OUTPUT_DIR)/, $(addsuffix .js, $(NGEO_INTERFACES)))
NGEO_OUTPUT_CSS_INTERFACES_FILES = $(addprefix $(APP_OUTPUT_DIR)/, $(addsuffix .css, $(NGEO_INTERFACES)))
NGEO_OUTPUT_FILES = $(JSON_CLIENT_LOCALISATION_FILES) \
$(MO_CLIENT_LOCALISATION_FILES) \
node_modules/ngeo/node_modules/font-awesome \
node_modules/ngeo/node_modules/openlayers \
node_modules/ngeo/node_modules/bootstrap \
node_modules/ngeo/contribs/gmf/fonts/fontawesome-webfont.woff2 \
node_modules/ngeo/contribs/gmf/fonts/fontawesome-webfont.woff \
node_modules/ngeo/contribs/gmf/fonts/fontawesome-webfont.ttf \
node_modules/ngeo/contribs/gmf/fonts/fontawesome-webfont.eot \
$(APP_OUTPUT_DIR)/templatecache.js \
$(NGEO_OUTPUT_JS_INTERFACES_FILES) \
$(NGEO_OUTPUT_CSS_INTERFACES_FILES) \
$(ANGULAR_LOCALES_FILES)
NGEO_LIBS_JS_FILES += \
node_modules/jquery/dist/jquery.min.js \
node_modules/ngeo/third-party/jquery-ui/jquery-ui.min.js \
node_modules/angular/angular.min.js \
node_modules/angular-animate/angular-animate.min.js \
node_modules/angular-sanitize/angular-sanitize.min.js \
node_modules/angular-touch/angular-touch.min.js \
node_modules/corejs-typeahead/dist/typeahead.bundle.min.js \
node_modules/angular-ui-date/dist/date.js \
node_modules/angular-float-thead/angular-floatThead.js \
node_modules/floatthead/dist/jquery.floatThead.min.js \
node_modules/angular-ui-slider/src/slider.js \
node_modules/proj4/dist/proj4.js \
node_modules/angular-gettext/dist/angular-gettext.min.js \
node_modules/angular-dynamic-locale/dist/tmhDynamicLocale.min.js \
node_modules/bootstrap/dist/js/bootstrap.min.js \
node_modules/d3/build/d3.min.js
NGEO_PROJECT_LIBS_JS_FILES ?=
ifeq ($(OPERATING_SYSTEM),WINDOWS)
COMPILE_CATALOG = node_modules/ngeo/buildtools/compile-catalog.js
else
COMPILE_CATALOG = node_modules/.bin/compile-catalog
endif
# i18n
TX_VERSION = $(shell $(VENV_BIN)/python -c "print('_'.join(__import__('pkg_resources').get_distribution('c2cgeoportal').version.split('.')[0:2]))")
TX_RC = $(HOME_DIR).transifexrc
TX_DEPENDENCIES = $(VENV_BIN)/tx$(PYTHON_BIN_POSTFIX) $(TX_RC) .tx/config
TX_HOST ?= https://www.transifex.com
ifeq (,$(wildcard $(TX_RC)))
TOUCHBACK_TXRC =
else
TOUCHBACK_TXRC = touch --date "$(shell stat -c '%y' $(TX_RC))" $(TX_RC)
endif
MAP_FILES += $(shell $(FIND) mapserver $(FIND_OPTS) \( -name "*.map" -o -name "*.sym" -o -name "*.conf" \) -print)
MAP_MAKO_FILES += $(shell $(FIND) mapserver $(FIND_OPTS) \( -name "*.map.mako" -o -name "*.sym.mako" -o -name "*.conf.mako" \) -print)
MAP_JINJA_FILES += $(shell $(FIND) mapserver $(FIND_OPTS) \( -name "*.map.jinja" -o -name "*.sym.jinja" -o -name "*.conf.jinja" \) -print)
MAP_FILES += $(MAP_MAKO_FILES:.mako=) $(MAP_JINJA_FILES:.jinja=)
I18N_SOURCE_FILES += $(APP_HTML_FILES) \
$(APP_JS_FILES) \
$(APP_DIRECTIVES_PARTIALS_FILES) \
.build/config.yaml
ifeq ($(DOCKER),FALSE)
# The theme from the database
I18N_SOURCE_FILES += development.ini
endif
I18N_DEPENDENCIES += $(MAP_FILES) \
project.yaml
# CGXP
JSBUILD_MAIN_FILES = $(shell $(FIND) $(PACKAGE)/static/lib/cgxp $(PACKAGE)/static/js -name "*.js" -print 2> /dev/null)
JSBUILD_MAIN_CONFIG = jsbuild/app.cfg
JSBUILD_MAIN_OUTPUT_FILES ?= $(addsuffix .js, $(CGXP_INTERFACES)) api.js xapi.js
ifdef CGXP_INTERFACES
JSBUILD_MAIN_OUTPUT_FILES += $(addprefix lang-, $(addsuffix .js, $(LANGUAGES)))
endif
JSBUILD_MAIN_OUTPUT_FILES += $(addprefix api-lang-, $(addsuffix .js, $(LANGUAGES)))
JSBUILD_MAIN_OUTPUT_FILES := $(addprefix $(OUTPUT_DIR)/, $(JSBUILD_MAIN_OUTPUT_FILES))
ifeq ($(DEVELOPMENT), TRUE)
JSBUILD_ARGS += --uncompress
endif
ifeq ($(DEVELOPMENT), FALSE)
CSSMIN_ARGS += --compress
LESS_ARGS += --clean-css="--s0"
endif
LESS_ARGS += --autoprefix
DEFAULT_CSS_BASE_FILES += \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/ext-all.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/xtheme-gray.css \
$(PACKAGE)/static/lib/cgxp/openlayers/theme/default/style.css \
$(PACKAGE)/static/lib/cgxp/geoext/resources/css/popup.css \
$(PACKAGE)/static/lib/cgxp/geoext/resources/css/gxtheme-gray.css \
$(PACKAGE)/static/lib/cgxp/geoext.ux/ux/Measure/resources/css/measure.css \
$(PACKAGE)/static/lib/cgxp/sandbox/FeatureEditing/resources/css/feature-editing.css \
$(PACKAGE)/static/lib/cgxp/styler/theme/css/styler.css \
$(PACKAGE)/static/lib/cgxp/gxp/src/theme/all.css \
$(PACKAGE)/static/lib/cgxp/core/src/theme/all.css \
$(PACKAGE)/static/lib/cgxp/ext.ux/ColorPicker/ressources/colorpicker.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/examples/ux/css/Spinner.css \
$(PACKAGE)/static/css/proj.css \
$(PACKAGE)/static/css/proj-map.css \
$(PACKAGE)/static/css/proj-widgets.css
ifdef CSS_BASE_FILES
CSS_BASE_FILES := $(DEFAULT_CSS_BASE_FILES) $(CSS_BASE_FILES)
else
CSS_BASE_FILES := $(DEFAULT_CSS_BASE_FILES)
endif
CSS_BASE_OUTPUT = $(OUTPUT_DIR)/app.css
DEFAULT_CSS_API_FILES += \
$(PACKAGE)/static/lib/cgxp/openlayers/theme/default/style.css \
$(PACKAGE)/static/css/proj-map.css
ifdef CSS_API_FILES
CSS_API_FILES := $(DEFAULT_CSS_API_FILES) $(CSS_API_FILES)
else
CSS_API_FILES := $(DEFAULT_CSS_API_FILES)
endif
CSS_API_OUTPUT = $(OUTPUT_DIR)/api.css
DEFAULT_CSS_XAPI_FILES += \
$(PACKAGE)/static/lib/cgxp/core/src/theme/reset.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/editor.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/pivotgrid.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/menu.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/panel.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/grid.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/debug.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/qtips.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/dd.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/form.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/resizable.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/toolbar.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/slider.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/combo.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/layout.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/dialog.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/core.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/button.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/progress.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/tabs.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/box.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/borders.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/date-picker.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/tree.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/window.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/visual/list-view.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/editor.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/pivotgrid.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/menu.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/panel.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/grid.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/debug.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/qtips.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/dd.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/form.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/resizable.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/toolbar.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/panel-reset.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/slider.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/combo.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/layout.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/dialog.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/core.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/button.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/progress.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/tabs.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/box.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/borders.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/date-picker.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/tree.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/window.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/structure/list-view.css \
$(PACKAGE)/static/lib/cgxp/ext/Ext/resources/css/xtheme-gray.css \
$(PACKAGE)/static/lib/cgxp/openlayers/theme/default/style.css \
$(PACKAGE)/static/lib/cgxp/geoext/resources/css/gxtheme-gray.css \
$(PACKAGE)/static/lib/cgxp/geoext.ux/ux/Measure/resources/css/measure.css \
$(PACKAGE)/static/lib/cgxp/gxp/src/theme/all.css \
$(PACKAGE)/static/lib/cgxp/core/src/theme/all.css \
$(PACKAGE)/static/css/proj-map.css \
$(PACKAGE)/static/css/proj-widgets.css
ifdef CSS_XAPI_FILES
CSS_XAPI_FILES := $(DEFAULT_CSS_XAPI_FILES) $(CSS_XAPI_FILES)
else
CSS_XAPI_FILES := $(DEFAULT_CSS_XAPI_FILES)
endif
CSS_XAPI_OUTPUT = $(OUTPUT_DIR)/xapi.css
VALIDATE_PY_FOLDERS = $(PACKAGE)/*.py $(PACKAGE)/lib $(PACKAGE)/scripts $(PACKAGE)/views
VALIDATE_PY_TEST_FOLDERS = $(PACKAGE)/tests
# Documentation
SPHINX_FILES = $(shell $(FIND) doc -name "*.rst" -print)
# Server localisation
ifdef CGXP_INTERFACES
SERVER_LOCALISATION_SOURCES_FILES += $(PACKAGE)/models.py $(shell $(FIND) $(PACKAGE)/templates -type f -name '*.html')
SERVER_LOCALISATION_FILES = $(addprefix $(PACKAGE)/locale/, $(addsuffix /LC_MESSAGES/$(PACKAGE)-$(L10N_SERVER_POSTFIX).mo, $(LANGUAGES)))
endif
# Print
PRINT_BASE_DIR ?= print
PRINT_WAR ?= print-$(INSTANCE_ID).war
PRINT_OUTPUT ?= /srv/tomcat/tomcat1/webapps
PRINT_OUTPUT_WAR =
JASPERREPORTS_VERSION ?= 6.1.1
TOMCAT_SERVICE_COMMAND ?= sudo /etc/init.d/tomcat-tomcat1
ifneq ($(TOMCAT_SERVICE_COMMAND),)
TOMCAT_STOP_COMMAND ?= $(TOMCAT_SERVICE_COMMAND) stop
TOMCAT_START_COMMAND ?= $(TOMCAT_SERVICE_COMMAND) start
endif
ifeq ($(PRINT_VERSION), 3)
PRINT_OUTPUT_WAR = $(PRINT_OUTPUT)/$(PRINT_WAR)
PRINT_BASE_WAR ?= print-servlet.war
PRINT_INPUT += print-apps WEB-INF
PRINT_EXTRA_LIBS += \
$(PRINT_BASE_DIR)/WEB-INF/lib/jasperreports-functions-$(JASPERREPORTS_VERSION).jar \
$(PRINT_BASE_DIR)/WEB-INF/lib/joda-time-1.6.jar \
$(PRINT_BASE_DIR)/WEB-INF/lib/postgresql-9.3-1102.jdbc41.jar
PRINT_REQUIREMENT += $(PRINT_EXTRA_LIBS) \
$(PRINT_BASE_DIR)/WEB-INF/classes/logback.xml \
$(PRINT_BASE_DIR)/WEB-INF/classes/mapfish-spring-application-context-override.xml \
$(shell $(FIND) $(PRINT_BASE_DIR)/print-apps)
I18N_SOURCE_FILES += print/print-apps/$(PACKAGE)/config.yaml
endif
ifeq ($(PRINT_VERSION), 2)
PRINT_OUTPUT_WAR = $(PRINT_OUTPUT)/$(PRINT_WAR)
PRINT_BASE_WAR ?= print-servlet-2.1-SNAPSHOT-IMG-MAGICK.war
PRINT_INPUT_LS += config.yaml WEB-INF/classes/log4j.properties
PRINT_INPUT_FIND += *.tif *.bmp *.jpg *.jpeg *.gif *.png *.pdf *.xml
PRINT_INPUT += $(shell cd $(PRINT_BASE_DIR) && ls -1 $(PRINT_INPUT_LS) 2> /dev/null)
PRINT_INPUT += $(foreach INPUT, $(PRINT_INPUT_FIND), $(shell cd $(PRINT_BASE_DIR) && $(FIND) -name '$(INPUT)' -type f))
PRINT_REQUIREMENT += $(addprefix $(PRINT_BASE_DIR)/, $(PRINT_INPUT))
endif
ifneq (, $(filter $(PRINT_VERSION), 2 3))
PRINT_FILES += $(shell $(FIND) print $(FIND_OPTS) -not -name ".mako" -not -name ".jinja" -print)
PRINT_MAKO_FILES += $(shell $(FIND) print $(FIND_OPTS) -name "*.mako" -print)
PRINT_JINJA_FILES += $(shell $(FIND) print $(FIND_OPTS) -name "*.jinja" -print)
PRINT_FILES += $(PRINT_MAKO_FILES:.mako=) $(PRINT_JINJA_FILES:.jinja=)
PRINT_REQUIREMENT += $(PRINT_FILES)
endif
ifeq ($(DOCKER), FALSE)
PRINT_REQUIREMENT += $(PRINT_BASE_DIR)/$(PRINT_BASE_WAR)
endif
# Apache
APACHE_ENTRY_POINT ?= /$(INSTANCE_ID)/
export APACHE_ENTRY_POINT
APACHE_VHOST ?= $(PACKAGE)
APACHE_CONF_DIR ?= /var/www/vhosts/$(APACHE_VHOST)/conf
APACHE_GRACEFUL ?= sudo /usr/sbin/apache2ctl graceful
MODWSGI_USER ?= www-data
export MODWSGI_USER
CONF_FILES += apache/application.wsgi
CONF_FILES_MAKO = $(shell ls -1 apache/*.conf.mako 2> /dev/null)
CONF_FILES_JINJA = $(shell ls -1 apache/*.conf.jinja 2> /dev/null)
CONF_FILES += $(shell ls -1 apache/*.conf 2> /dev/null) $(CONF_FILES_MAKO:.mako=) $(CONF_FILES_JINJA:.jinja=)
ifeq ($(TILECLOUD_CHAIN), TRUE)
CONF_FILES += apache/tiles.conf apache/mapcache.xml
endif
PY_FILES = $(shell $(FIND) $(PACKAGE) -type f -name '*.py' -print)
TEMPLATES_FILES = $(shell $(FIND) $(PACKAGE)/templates -type f -print)
# Templates
ALL_MAKO_FILES = $(shell $(FIND) $(FIND_OPTS) -name "*.mako" -print)
ALL_JINJA_FILES = $(shell $(FIND) $(FIND_OPTS) -name "*.jinja" -print)
EXTRA_EXCLUDE = $(foreach ELEM, print apache mapfile deploy jsbuild tilegeneration,-path ./$(ELEM) -prune -o)
MAKO_FILES = $(shell $(FIND) $(EXTRA_EXCLUDE) $(FIND_OPTS) -name "*.mako" -print)
JINJA_FILES = $(shell $(FIND) $(EXTRA_EXCLUDE) $(FIND_OPTS) -name "*.jinja" -print)
VARS_FILES += CONST_vars.yaml $(VARS_FILE)
VARS_DEPENDS += $(VARS_FILES) .build/node_modules.timestamp
CONFIG_VARS += instanceid sqlalchemy.url schema parentschema enable_admin_interface pyramid_closure \
node_modules_path closure_library_path default_locale_name servers layers \
available_locale_names cache admin_interface functionalities external_themes_url \
raster shortener hide_capabilities mapserverproxy tinyowsproxy resourceproxy print_url \
tiles_url checker check_collector default_max_age jsbuild package srid \
reset_password fulltextsearch headers authorized_referers hooks stats db_chooser \
ogcproxy_enable dbsessions urllogin
C2C_TEMPLATE_CMD = $(ENVIRONMENT_VARS) $(VENV_BIN)/c2c-template --vars $(VARS_FILE)
MAKE_FILES = $(shell ls -1 *.mk) CONST_Makefile
# Disabling Make built-in rules to speed up execution time
.SUFFIXES:
.PHONY: help
help:
@echo "Usage: make <target>"
@echo
@echo "Main targets:"
@echo
@echo "- build Build and configure the project"
@echo "- checks Perform a number of checks on the code"
@echo "- serve Run the development server (Pserve)"
@echo "- clean Remove generated files"
@echo "- cleanall Remove all the build artefacts"
@echo "- cleanallcache Remove all the build artefacts and the extra caches (npm and pip)"
@echo
@echo "Utility targets:"
@echo
@echo "- update Update and clean the project (Git, Node, Pip)"
@echo "- update-git-submodules Update and clean the Git submodules"
@echo "- update-node-modules Update node modules (using --force)"
@echo "- upgrade-db Upgrade the database to the latest version"
@echo "- upgrade Launch the upgrade process"
@echo
@echo "Deploy branch target:"
@echo
@echo "- theme2fts Inport the theme in the full-text search"
@echo "- deploy-branch Deploy the curent branch to demos"
@echo "- remove-branch Remove the curent branch from demos"
ifdef UTILITY_HELP
@echo $(UTILITY_HELP)
endif
@echo
@echo "Secondary targets:"
@echo
@echo "- build-cgxp Build the javascript and the css for cgxp"
@echo "- build-ngeo Build the javascript and the css for ngeo"
@echo "- build-server Build the files required by the server"
@echo "- compile-js-catalog Compile the Angular translation catalog"
@echo "- compile-py-catalog Compile the Python translation catalog"
@echo "- flake8 Run Flake8 checker on the Python code"
@echo "- lint-ngeo Check the JavaScript code with linters for ngeo"
@echo "- template-clean Clean the template file"
@echo "- template-generate Generate the template file"
ifdef SECONDARY_HELP
@echo $(SECONDARY_HELP)
endif
@echo
.PHONY: build
build: $(BUILD_RULES)
.PHONY: checks
checks: flake8 $(CLIENT_CHECK_RULE) $(NGEO_OUTPUT_JS_INTERFACES_FILES) $(NGEO_OUTPUT_CSS_INTERFACES_FILES) git-attributes
.PHONY: git-attributes
git-attributes:
git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
.PHONY: clean
clean: template-clean
rm -f .build/*.timestamp
rm -f apache/mapcache.xml apache/tiles.conf
rm -rf $(OUTPUT_DIR)/
rm -rf $(APP_OUTPUT_DIR)/
rm -f $(PACKAGE)/locale/$(PACKAGE)-*.pot
# We use the print
ifdef PRINT_BASE_WAR
$(TOMCAT_OUTPUT_CMD_PREFIX) rm -f $(PRINT_OUTPUT)/$(PRINT_WAR)
$(TOMCAT_OUTPUT_CMD_PREFIX) rm -rf $(PRINT_OUTPUT)/$(PRINT_WAR:.war=) 2> /dev/null || true
endif
rm -f $(APACHE_CONF_DIR)/$(INSTANCE_ID).conf
ifeq ($(TILECLOUD_CHAIN_LOCAL), TRUE)
rm -f $(WMTSCAPABILITIES_FILE)
endif
.PHONY: cleanall
cleanall: clean
rm -rf .build
rm -rf node_modules
rm -f $(ANGULAR_LOCALES_FILES)
ifdef PRINT_BASE_WAR
ifeq ($(PRINT_VERSION), 3)
rm -f $(PRINT_BASE_DIR)/$(PRINT_BASE_WAR) $(PRINT_EXTRA_LIBS)
endif
endif
.PHONY: cleanallcache
cleanallcache: cleanall
ifeq ($(OPERATING_SYSTEM), WINDOWS)
rm -rf %AppData%/npm-cache
rm -rf %AppData%/../Local/pip/cache
else
rm -rf $(HOME_DIR).npm
rm -rf $(HOME_DIR).cache/pip
endif
.PHONY: theme2fts
theme2fts: $(VENV_BIN)/theme2fts$(PYTHON_BIN_POSTFIX) \
$(MO_CLIENT_LOCALISATION_FILES)
$(VENV_BIN)/theme2fts
.PHONY: flake8
flake8: $(VENV_BIN)/flake8$(PYTHON_BIN_POSTFIX)
$(VENV_BIN)/flake8 $(PACKAGE)
.PHONY: build-server
build-server: template-generate compile-py-catalog $(SERVER_LOCALISATION_FILES)
.PHONY: build-cgxp
build-cgxp: $(JSBUILD_MAIN_OUTPUT_FILES) $(CSS_BASE_OUTPUT) $(CSS_API_OUTPUT) $(CSS_XAPI_OUTPUT)
.PHONY: lint-ngeo
lint-ngeo: .build/eslint.timestamp
.PHONY: serve
serve: build development.ini
$(VENV_BIN)/pserve --reload --monitor-restart development.ini
.PHONY: update-node-modules
update-node-modules: $(NPM_CMD)
$(NPM_CMD) install --force || sleep 20 || $(NPM_CMD) install --force || sleep 90 || $(NPM_CMD) install --force
mkdir -p .build
touch .build/node_modules.timestamp
$(VENV_BIN)/alembic$(PYTHON_BIN_POSTFIX): .build/dev-requirements.timestamp
.PHONY: upgrade-db
upgrade-db: alembic.ini alembic_static.ini $(VENV_BIN)/alembic$(PYTHON_BIN_POSTFIX)
$(VENV_BIN)/alembic -c alembic.ini upgrade head
$(VENV_BIN)/alembic -c alembic_static.ini upgrade head
# Deploy branch
.PHONY: deploy-branch
deploy-branch:
@read -p "Are you sure to deploy the branch in $(DEPLOY_BRANCH_DIR)/$(GIT_BRANCH) (Y/n)?" RESP; RESP=`echo $$RESP | tr '[:upper:]' '[:lower:]'`; /usr/bin/test "$$RESP" == "y" -o "$$RESP" == "yes" -o "$$RESP" == ""
rm -f $(APACHE_CONF_DIR)/$(GIT_BRANCH).conf
rm -rf $(DEPLOY_BRANCH_DIR)/$(GIT_BRANCH)
mkdir --parents $(DEPLOY_BRANCH_DIR)/$(GIT_BRANCH)
git clone $(GIT_REMOTE_URL) -b $(GIT_BRANCH) $(DEPLOY_BRANCH_DIR)/$(GIT_BRANCH)
cd $(DEPLOY_BRANCH_DIR)/$(GIT_BRANCH); INSTANCE_ID=$(GIT_BRANCH) APACHE_CONF_DIR=$(APACHE_CONF_DIR) APACHE_ENTRY_POINT=/$(GIT_BRANCH)/ $(MAKE) -f $(DEPLOY_BRANCH_MAKEFILE) build
@echo Now open $(DEPLOY_BRANCH_BASE_URL)/$(GIT_BRANCH)
.PHONY: remove-branch
remove-branch:
rm -f $(APACHE_CONF_DIR)/$(GIT_BRANCH).conf
rm -fr $(DEPLOY_BRANCH_DIR)/$(GIT_BRANCH)
$(APACHE_GRACEFUL)
# Templates
.PHONY: template-clean
template-clean:
rm -f $(ALL_MAKO_FILES:.mako=)
rm -f $(ALL_JINJA_FILES:.jinja=)
rm -f .build/config.yaml
.PHONY: template-generate
template-generate: $(ALL_MAKO_FILES:.mako=) $(ALL_JINJA_FILES:.jinja=) .build/config.yaml
$(MAKO_FILES:.mako=) $(JINJA_FILES:.jinja=): $(VENV_BIN)/c2c-template$(PYTHON_BIN_POSTFIX) $(VARS_DEPENDS)
%: %.mako $(INSTANCE_ID_MARKER) $(VENV_BIN)/c2c-template$(PYTHON_BIN_POSTFIX)
$(PRERULE_CMD)
ifeq ($(origin VARS_FILE), undefined)
@echo "Error: the variable VARS_FILE is required."
exit 1
endif
$(C2C_TEMPLATE_CMD) --engine mako --files $<
%: %.jinja $(INSTANCE_ID_MARKER) $(VENV_BIN)/c2c-template$(PYTHON_BIN_POSTFIX)
$(PRERULE_CMD)
ifeq ($(origin VARS_FILE), undefined)
@echo "Error: the variable VARS_FILE is required."
exit 1
endif
$(C2C_TEMPLATE_CMD) --engine jinja --files $<
$(VENV_BIN)/c2c-template$(PYTHON_BIN_POSTFIX): .build/requirements.timestamp
$(VENV_BIN)/pykwalify$(PYTHON_BIN_POSTFIX): .build/dev-requirements.timestamp
.build/config.yaml: $(INSTANCE_ID_MARKER) $(VENV_BIN)/c2c-template$(PYTHON_BIN_POSTFIX) $(VENV_BIN)/pykwalify$(PYTHON_BIN_POSTFIX) $(VARS_DEPENDS) $(MAKE_FILES)
$(PRERULE_CMD)
$(C2C_TEMPLATE_CMD) --get-config .build/_config.yaml $(CONFIG_VARS)
$(VENV_BIN)/pykwalify --data-file .build/_config.yaml --schema-file CONST_config-schema.yaml
mv .build/_config.yaml .build/config.yaml
touch $@
# server localisation
.PRECIOUS: $(VENV_BIN)/pot-create$(PYTHON_BIN_POSTFIX)
$(VENV_BIN)/pot-create$(PYTHON_BIN_POSTFIX): .build/requirements.timestamp
$(PRERULE_CMD)
touch --no-create $@
.PHONY: compile-py-catalog
compile-py-catalog: $(SERVER_LOCALISATION_FILES)
.PRECIOUS: $(PACKAGE)/locale/$(PACKAGE)-$(L10N_SERVER_POSTFIX).pot
$(PACKAGE)/locale/$(PACKAGE)-$(L10N_SERVER_POSTFIX).pot: \
lingua-server.cfg \
$(VENV_BIN)/pot-create$(PYTHON_BIN_POSTFIX) \
$(SERVER_LOCALISATION_SOURCES_FILES)
$(PRERULE_CMD)
$(VENV_BIN)/pot-create --keyword _ --config $< --output $@ $(SERVER_LOCALISATION_SOURCES_FILES)
# removes the always changed date line
sed -i '/^"POT-Creation-Date: /d' $@
sed -i '/^"PO-Revision-Date: /d' $@
chmod go+r $@
.PRECIOUS: $(PACKAGE)/locale/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).pot
$(PACKAGE)/locale/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).pot: \
lingua-client.cfg \
$(I18N_DEPENDENCIES) \
$(I18N_SOURCE_FILES) \
$(VENV_BIN)/pot-create$(PYTHON_BIN_POSTFIX) \
.build/mapserver.timestamp \
.build/config.yaml
$(PRERULE_CMD)
$(VENV_BIN)/pot-create --config $< --output $@ $(I18N_SOURCE_FILES)
# removes the always changed date line
sed -i '/^"POT-Creation-Date: /d' $@
sed -i '/^"PO-Revision-Date: /d' $@
chmod go+r $@
.PRECIOUS: $(PACKAGE)/locale/%/LC_MESSAGES/$(PACKAGE)-$(L10N_SERVER_POSTFIX).po
$(PACKAGE)/locale/%/LC_MESSAGES/$(PACKAGE)-$(L10N_SERVER_POSTFIX).po: $(PACKAGE)/locale/$(PACKAGE)-$(L10N_SERVER_POSTFIX).pot
$(PRERULE_CMD)
mkdir -p $(dir $@)
[ -f $@ ] || msginit --no-translator --input=$< --output-file=$@ -l $*
touch --no-create $@
msgmerge --backup=none --update --sort-output --no-location $@ $<
.PRECIOUS: $(PACKAGE)/locale/%/LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po
$(PACKAGE)/locale/%/LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po: $(PACKAGE)/locale/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).pot
$(PRERULE_CMD)
mkdir -p $(dir $@)
[ -f $@ ] || msginit --no-translator --input=$< --output-file=$@ -l $*
touch --no-create $@
msgmerge --backup=none --update --sort-output --no-location $@ $<
.PRECIOUS: %.mo
%.mo: %.po
$(PRERULE_CMD)
msgfmt -o $@ $<
touch --no-create $@
# Get l10n from ngeo
$(VENV_BIN)/tx$(PYTHON_BIN_POSTFIX): .build/dev-requirements.timestamp
$(VENV_BIN)/mako-render$(PYTHON_BIN_POSTFIX): .build/dev-requirements.timestamp
$(TX_RC):
$(PRERULE_CMD)
echo "[$(TX_HOST)]" > $@
echo "hostname = $(TX_HOST)" >> $@
echo "username = c2c" >> $@
echo "password = c2cc2c" >> $@
echo "token =" >> $@
.tx/config: .tx/CONST_config_mako $(VENV_BIN)/mako-render$(PYTHON_BIN_POSTFIX)
$(PRERULE_CMD)
PYTHONIOENCODING=UTF-8 $(VENV_BIN)/mako-render \
--var "tx_version=$(TX_VERSION)" --var "tx_host=$(TX_HOST)" $< > $@
.PRECIOUS: .build/locale/%/LC_MESSAGES/gmf.po
.build/locale/%/LC_MESSAGES/gmf.po: $(TX_DEPENDENCIES)
$(PRERULE_CMD)
mkdir -p $(dir $@)
sleep 1 # To be sure that the creation date should be after the .transifexrc file. (the $(TOUCHBACK_TXRC) lost the ms)
$(VENV_BIN)/tx pull --language $* --resource ngeo.gmf-$(TX_VERSION) --force
$(TOUCHBACK_TXRC)
test -s $@
.PRECIOUS: .build/locale/%/LC_MESSAGES/ngeo.po
.build/locale/%/LC_MESSAGES/ngeo.po: $(TX_DEPENDENCIES)
$(PRERULE_CMD)
mkdir -p $(dir $@)
sleep 1 # To be sure that the creation date should be after the .transifexrc file. (the $(TOUCHBACK_TXRC) lost the ms)
$(VENV_BIN)/tx pull --language $* --resource ngeo.ngeo-$(TX_VERSION) --force
$(TOUCHBACK_TXRC)
test -s $@
.build/locale/en/LC_MESSAGES/gmf.po:
$(PRERULE_CMD)
@echo "The en language is the source language, so the file must stay empty"
.build/locale/en/LC_MESSAGES/ngeo.po:
$(PRERULE_CMD)
@echo "The en language is the source language, so the file must stay empty"
# ngeo
.PHONY: build-ngeo
build-ngeo: $(NGEO_OUTPUT_FILES)
.PHONY: compile-js-catalog
compile-js-catalog: $(JSON_CLIENT_LOCALISATION_FILES)
$(VENV_BIN)/db2pot$(PYTHON_BIN_POSTFIX): .build/requirements.timestamp
$(JSON_CLIENT_LOCALISATION_FILES): .build/node_modules.timestamp
$(COMPILE_CATALOG): .build/node_modules.timestamp
.PRECIOUS: $(APP_OUTPUT_DIR)/%.json
$(APP_OUTPUT_DIR)/%.json: $(PACKAGE)/locale/%/LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po \
.build/locale/%/LC_MESSAGES/gmf.po \
.build/locale/%/LC_MESSAGES/ngeo.po \
$(COMPILE_CATALOG) \
.build/node_modules.timestamp
$(PRERULE_CMD)
mkdir -p $(dir $@)
node $(COMPILE_CATALOG) \
.build/locale/$*/LC_MESSAGES/gmf.po \
.build/locale/$*/LC_MESSAGES/ngeo.po \
$< > $@
$(APP_OUTPUT_DIR)/angular-locale_%.js: node_modules/ngeo/github_versions
mkdir -p $(dir $@)
wget -O $@ https://raw.githubusercontent.com/angular/angular.js/`grep ^angular.js= $< | cut --delimiter = --fields 2`/src/ngLocale/angular-locale_$*.js
$(APP_OUTPUT_DIR)/%.js: .build/%.js .build/node_modules.timestamp $(NGEO_LIBS_JS_FILES) $(NGEO_PROJECT_LIBS_JS_FILES)
$(PRERULE_CMD)
mkdir -p $(dir $@)
awk 'FNR==1{print ""}1' $(NGEO_LIBS_JS_FILES) $(NGEO_PROJECT_LIBS_JS_FILES) $< > $@
sed -i '/^\/\/# sourceMappingURL=.*\.map$$/d' $@
.PRECIOUS: node_modules/%
node_modules/%: .build/node_modules.timestamp
$(PRERULE_CMD)
touch --no-create $@
.PRECIOUS: node_modules/ngeo/node_modules/%
node_modules/ngeo/node_modules/%: node_modules/%
$(PRERULE_CMD)
mkdir -p $(dir $@)
[ -e $@ ] || ln -s ../../../$< $@
touch --no-create $@
.PRECIOUS: node_modules/font-awesome/fonts/fontawesome-webfont.%
node_modules/font-awesome/fonts/fontawesome-webfont.%: .build/node_modules.timestamp
$(PRERULE_CMD)
touch --no-create $@
.PRECIOUS: node_modules/ngeo/contribs/gmf/fonts/fontawesome-webfont.%
node_modules/ngeo/contribs/gmf/fonts/fontawesome-webfont.%: node_modules/font-awesome/fonts/fontawesome-webfont.%
$(PRERULE_CMD)
mkdir -p $(dir $@)
cp $< $@
touch --no-create $@
.PRECIOUS: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.svg
node_modules/ngeo/contribs/gmf/fonts/gmf-icons.%: .build/node_modules.timestamp
$(PRERULE_CMD)
touch --no-create $@
.PRECIOUS: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.ttf
node_modules/ngeo/contribs/gmf/fonts/gmf-icons.ttf: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.svg
node_modules/.bin/svg2ttf $< $@
.PRECIOUS: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.eot
node_modules/ngeo/contribs/gmf/fonts/gmf-icons.eot: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.ttf
node_modules/.bin/ttf2eot $< $@
.PRECIOUS: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.woff
node_modules/ngeo/contribs/gmf/fonts/gmf-icons.woff: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.ttf
node_modules/.bin/ttf2woff $< $@
.PRECIOUS: $(PACKAGE)/static-ngeo/fonts/gmf-icons.%
$(PACKAGE)/static-ngeo/fonts/gmf-icons.%: node_modules/ngeo/contribs/gmf/fonts/gmf-icons.%
$(PRERULE_CMD)
mkdir -p $(dir $@)
cp $< $@
.PRECIOUS: node_modules/font-awesome/fonts/fontawesome-webfont.%
node_modules/font-awesome/fonts/fontawesome-webfont.%: .build/node_modules.timestamp
$(PRERULE_CMD)
touch --no-create $@
.PRECIOUS: $(PACKAGE)/static-ngeo/fonts/fontawesome-webfont.%
$(PACKAGE)/static-ngeo/fonts/fontawesome-webfont.%: node_modules/font-awesome/fonts/fontawesome-webfont.%
$(PRERULE_CMD)
mkdir -p $(dir $@)
cp $< $@
$(APP_OUTPUT_DIR)/%.css: $(PACKAGE)/static-ngeo/less/%.less $(LESS_FILES) $(NGEO_FONTS) .build/node_modules.timestamp
$(PRERULE_CMD)
mkdir -p $(dir $@)
node_modules/.bin/lessc $(LESS_ARGS) $< $@
.PRECIOUS: node_modules/ngeo/buildtools/mako_build.json
node_modules/ngeo/buildtools/mako_build.json: .build/node_modules.timestamp
$(PRERULE_CMD)
touch --no-create $@
.PRECIOUS: .build/%.json
.build/%.json: node_modules/ngeo/buildtools/mako_build.json \
$(VENV_BIN)/mako-render$(PYTHON_BIN_POSTFIX)
$(PRERULE_CMD)
PYTHONIOENCODING=UTF-8 $(VENV_BIN)/mako-render \
--var 'src=$(PACKAGE)/static-ngeo/js/**/*.js,$(PACKAGE)/static-ngeo/components/**/*.js' \
--var src_set=contribs_gmf \
--var entry_point=$(PACKAGE)_$* \
--var ngeo_folder=node_modules/ngeo/ \
--var generate_exports=true $< > $@
.PRECIOUS: .build/%.js
.build/%.js: .build/%.json $(OL_JS_FILES) $(NGEO_JS_FILES) $(APP_JS_FILES) \
.build/gmftemplatecache.js \
.build/externs/angular-$(ANGULAR_VERSION).js \
.build/externs/angular-$(ANGULAR_VERSION)-q_templated.js \
.build/externs/angular-$(ANGULAR_VERSION)-http-promise_templated.js \
.build/externs/jquery-1.9.js \
.build/node_modules.timestamp
$(PRERULE_CMD)
node node_modules/ngeo/buildtools/build.js $< $@
node_modules/ngeo/buildtools/templatecache.mako.js: .build/node_modules.timestamp
$(APP_OUTPUT_DIR)/templatecache.js: .build/gmftemplatecache.js
$(PRERULE_CMD)
mkdir -p $(dir $@)
cp $< $@
.PRECIOUS: .build/gmftemplatecache.js
.build/gmftemplatecache.js: node_modules/ngeo/buildtools/templatecache.mako.js \
.build/dev-requirements.timestamp \
$(VENV_BIN)/mako-render$(PYTHON_BIN_POSTFIX) \
$(APP_DIRECTIVES_PARTIALS_FILES) \
$(GMF_DIRECTIVES_PARTIALS_FILES) \
$(NGEO_DIRECTIVES_PARTIALS_FILES)
$(PRERULE_CMD)
mkdir -p $(dir $@)
PYTHONIOENCODING=UTF-8 $(VENV_BIN)/mako-render \
--var "partials=ngeo:node_modules/ngeo/src/directives/partials \
gmf:node_modules/ngeo/contribs/gmf/src/directives/partials \
$(PACKAGE)_components:$(PACKAGE)/static-ngeo/components \
$(PACKAGE)_partials:$(PACKAGE)/static-ngeo/partials \
$(PACKAGE)_js:$(PACKAGE)/static-ngeo/js"\
--var "app=$(PACKAGE)" $< > $@
.build/externs/angular-$(ANGULAR_VERSION).js: node_modules/ngeo/github_versions
$(PRERULE_CMD)
mkdir -p $(dir $@)
curl --max-redirs 0 --location --output $@ https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/angular-$(ANGULAR_VERSION).js
.build/externs/angular-$(ANGULAR_VERSION)-q_templated.js: node_modules/ngeo/github_versions
$(PRERULE_CMD)
mkdir -p $(dir $@)
curl --max-redirs 0 --location --output $@ https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/angular-$(ANGULAR_VERSION)-q_templated.js
.build/externs/angular-$(ANGULAR_VERSION)-http-promise_templated.js: node_modules/ngeo/github_versions
$(PRERULE_CMD)
mkdir -p $(dir $@)
curl --max-redirs 0 --location --output $@ https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/angular-$(ANGULAR_VERSION)-http-promise_templated.js
.build/externs/jquery-1.9.js: node_modules/ngeo/github_versions
$(PRERULE_CMD)
mkdir -p $(dir $@)
curl --max-redirs 0 --location --output $@ https://raw.githubusercontent.com/google/closure-compiler/`grep ^closure-compiler= $< | cut --delimiter = --fields 2`/contrib/externs/jquery-1.9.js
package.json:
$(PRERULE_CMD)
ifneq ($(NGEO_INTERFACES), "")
@echo Missing $@ required file by ngeo
exit 1
else
touch $@
endif
$(NPM_CMD):
$(PRERULE_CMD)
ifeq ($(OPERATING_SYSTEM), LINUX)
npm install npm || sleep 20 || npm install npm || sleep 90 || npm install npm
else
touch $@
endif
.build/node_modules.timestamp: package.json $(NPM_CMD)
$(PRERULE_CMD)
mkdir -p $(dir $@)
ifneq ($(NGEO_INTERFACES), "")
$(NPM_CMD) install || sleep 20 || $(NPM_CMD) install || sleep 90 || $(NPM_CMD) install
endif
touch $@
node_modules/.bin/eslint$(NODE_BIN_POSTFIX): .build/node_modules.timestamp
.build/eslint.timestamp: node_modules/.bin/eslint$(NODE_BIN_POSTFIX) $(APP_JS_FILES)
$(PRERULE_CMD)
mkdir -p $(dir $@)
node_modules/.bin/eslint$(NODE_BIN_POSTFIX) $(filter-out node_modules/.bin/eslint$(NODE_BIN_POSTFIX), $?)
touch $@
# Git
$(VENV_BIN)/jsbuild$(PYTHON_BIN_POSTFIX): .build/dev-requirements.timestamp
.PHONY: update