Line # Revision Author
1 8 ahitrov@rambler.ru ##############################################################################
2 655 ahitrov #
3 8 ahitrov@rambler.ru ###############################################################################
4
5 # installation settings
6 include ../../config.mk
7
8 # local defines
9 SOURCES = ${ROOT_DIR}/src
10 CORE_SRC = ${SOURCES}/core
11 PLUG_SRC = ${SOURCES}/plugins
12 PROJ_SRC = ${SOURCES}/projects
13
14 CORE_USR = ${ROOT_DIR}/usr/core
15 PLUG_USR = ${ROOT_DIR}/usr/plugins
16 PROJ_USR = ${ROOT_DIR}/usr/projects
17 PROJ_TMP = ${ROOT_DIR}/tmp/projects
18 PROJ_VAR = ${ROOT_DIR}/var/projects
19
20 PORTSDIR = ${CORE_SRC}/ports
21 LOCAL = ${ROOT_DIR}/usr/local
22 PORTSWRK = ${ROOT_DIR}/var/ports
23
24 CORE_VERSION = ${shell svnversion ${CORE_SRC}}
25
26 PAGER ?= ${shell which less || which more}
27 RSYNC_COMMAND = ${shell which rsync}
28
29 HOSTNAME = ${shell hostname}
30
31 PROJECT_LC = ${shell echo "${PROJECT}" | tr '[:upper:]' '[:lower:]'}
32
33 # core settings
34 include ${CORE_SRC}/config.mk
35
36 # perl settings
37 include ${CORE_SRC}/ports/etc/perl.mk
38
39 # project settings
40 ifdef PROJECT
41 ifneq (${shell test -f ${PROJ_SRC}/${PROJECT}/config.mk && echo 1},1)
42 ${error ERROR: no source ${PROJECT}/config.mk found, are you checked out project '${PROJECT}'?}
43 endif
44 -include /usr/local/etc/contenido.mk
45 RSYNC_SERVERS ?= ${addsuffix ::${PROJECT_LC}, ${FRONTENDS}}
46 include ${PROJ_SRC}/${PROJECT}/config.mk
47 include ${CORE_SRC}/project-default.mk
48
49 ifeq (${shell test -f ${PROJ_SRC}/${PROJECT}/GNUmakefile && echo 1},1)
50 include ${PROJ_SRC}/${PROJECT}/GNUmakefile
51 $(warning Use of GNUmakefile in project dir is deprecated, rename it to GNUmakefile.in)
52 endif
53 -include ${PROJ_SRC}/${PROJECT}/GNUmakefile.in
54
55 PROJECT_VERSION = ${shell svnversion ${PROJ_SRC}/${PROJECT}}
56 endif
57
58 .PHONY: \
59 local_clean realclean \
60 local_build build \
61 local_install install \
62 local_preview preview \
63 \
64 core_status cst \
65 core_update cup \
66 core_commit cci \
67 650 ahitrov core_checkout cco \
68 core_push cpush \
69 core_pull cpull \
70 core_branch cbranch \
71 core_merge cmerge \
72 8 ahitrov@rambler.ru core_install cin \
73 core_info cinfo \
74 614 ahitrov core_rsync crs \
75 8 ahitrov@rambler.ru \
76 650 ahitrov project_assets assets \
77 project_assets_dev assdev \
78 8 ahitrov@rambler.ru project_status pst \
79 project_update pup \
80 project_commit pci \
81 650 ahitrov project_checkout pco \
82 project_push ppush push \
83 project_pull ppull pull \
84 project_branch pbranch branch \
85 project_merge pmerge merge \
86 8 ahitrov@rambler.ru project_install pin \
87 project_conf conf \
88 project_rsync prs \
89 650 ahitrov project_assets_rsync ars \
90 8 ahitrov@rambler.ru project_start start \
91 project_stop stop \
92 project_create create \
93 project_import import \
94 project_info pinfo \
95 project_reload reload \
96 project_fullreload full \
97 project_rewind rewind nano \
98 740 ahitrov project_fullrewind giga \
99 8 ahitrov@rambler.ru project_refresh refresh \
100 project_deinstall pdi \
101 project_user user \
102 project_switch switch swi \
103 project_backup backup \
104 \
105 plugin_create plc \
106 plugins_commit plci \
107 650 ahitrov plugins_checkout plco \
108 plugins_push plpush \
109 plugins_pull plpull \
110 plugins_branch plbranch \
111 plugins_merge plmerge \
112 8 ahitrov@rambler.ru plugins_install plin \
113 plugins_status plst \
114 plugins_update plup \
115 plugins_deinstall pldi \
116 \
117 pgsql_init \
118 pgsql_start \
119 pgsql_stop \
120 pgsql_psql psql \
121 pgsql_dump dump \
122 pgsql_dumpz dumpz \
123 \
124 apache_access_log alog \
125 apache_pager_access_log palog \
126 apache_error_log elog \
127 apache_pager_error_log pelog \
128 apache_start \
129 apache_stop \
130 \
131 check_conf_installed \
132 check_core_installed \
133 check_owner \
134 check_project \
135 check_project_installed \
136 check_user \
137
138 #################
139 # local_* targets
140 #################
141
142 # build all required ports (core & project)
143 build: local_build ;
144 local_build: check_user
145 @for P in ${CORE_REQUIRED} ${PROJECT_REQUIRED}; do \
146 ${MAKE} -s port_build PORT=$${P} \
147 || exit 1; \
148 done;
149 @echo $@ done
150
151 # install all required ports (core & project)
152 install: local_install ;
153 local_install: check_user
154 @for P in ${CORE_REQUIRED} ${PROJECT_REQUIRED}; do \
155 ${MAKE} -s port_install PORT=$${P} \
156 || exit 1; \
157 done;
158 ifeq (${DB_TYPE},SINGLE)
159 @${MAKE} -s pgsql_init
160 endif
161 @echo $@ done
162
163 # preview of install all required ports (core & project)
164 preview: local_preview ;
165 @for P in ${CORE_REQUIRED} ${PROJECT_REQUIRED}; do \
166 ${MAKE} -s port_install PORT=$${P} DRY_RUN=yes \
167 || exit 1; \
168 done;
169
170
171
172 ################
173 # core_* targets
174 ################
175
176 # check core sources via repository
177 cst: core_status ;
178 core_status: check_user
179 650 ahitrov ifeq (${VCS_TYPE},git)
180 @echo ${PROJ_SRC}/${PROJECT}
181 @cd ${CORE_SRC} && git status
182 else
183 8 ahitrov@rambler.ru @svn st -u ${CORE_SRC}
184 650 ahitrov endif
185 8 ahitrov@rambler.ru @echo $@ done
186
187 # update core sources from repository
188 cup: core_update ;
189 core_update: check_user
190 650 ahitrov ifeq (${VCS_TYPE},git)
191 @cd ${CORE_SRC} \
192 && echo ">>>> core git pull" \
193 && git pull;
194 8 ahitrov@rambler.ru else
195 650 ahitrov @if [ -n "${REV}" ]; then \
196 svn up -r ${REV} ${CORE_SRC}; \
197 else \
198 svn up ${CORE_SRC}; \
199 fi;
200 8 ahitrov@rambler.ru endif
201 @echo $@ done
202
203 # commit core changes to repository
204 cci: core_commit ;
205 core_commit: check_user
206 650 ahitrov ifeq (${VCS_TYPE},git)
207 @cd ${CORE_SRC} && git commit -a
208 else
209 8 ahitrov@rambler.ru @svn ci ${CORE_SRC}
210 650 ahitrov endif
211 8 ahitrov@rambler.ru @echo $@ done
212 650 ahitrov
213 8 ahitrov@rambler.ru # pretty formatted core info
214 cinfo: core_info ;
215 core_info:
216 @REPOS=`svn info ${CORE_SRC} | grep -E '^URL' | sed -E 's/URL: //'`; \
217 RL=$$(($${#REPOS}+2)); \
218 DEVEL=`perl -e 'print "".(lc "${DEVELOPMENT}" eq "yes" ? "YES" : "NO");'`; \
219 DEBUG=`perl -e 'print "".(lc "${DEBUG}" eq "yes" ? "YES" : "NO");'`; \
220 printf "%-$${RL}s %-12s %-7s %-7s %-6s\n" REPOSITORY REVISION DEVEL DEBUG PORT; \
221 printf "%-$${RL}s %-12s %-7s %-7s %-6s\n" $${REPOS} ${CORE_VERSION} $${DEVEL} \
222 $${DEBUG} ${HTTPD_PORT}
223 @echo $@ done
224
225
226 650 ahitrov # core git checkout and branch switcher
227 cco: core_checkout ;
228 core_checkout:
229 @cd ${PROJ_SRC}/${PROJECT} \
230 && echo ">>>> git checkout ${BRANCH}" \
231 && git checkout ${BRANCH};
232 @echo $@ done
233
234 # core git branch workaround.
235 # Uses NAME as branch name for creation, FROM for branch source and DELETE=1 for branch delete
236 cbranch: core_branch ;
237 core_branch:
238 @if [ -n "${NAME}" -a -n "${FROM}" ]; then \
239 cd ${CORE_SRC} \
240 && echo ">>>> git checkout -b ${NAME} ${FROM}" \
241 && git checkout -b ${NAME} ${FROM}; \
242 elif [ -n "${NAME}" -a -n "${DELETE}" ]; then \
243 cd ${CORE_SRC} \
244 && echo ">>>> git branch -d ${NAME}" \
245 && git branch -d ${NAME}; \
246 elif [ -n "${NAME}" ]; then \
247 cd ${CORE_SRC} \
248 && echo ">>>> git checkout -b ${NAME}" \
249 && git checkout -b ${NAME}; \
250 else \
251 cd ${CORE_SRC} \
252 && git branch -v; \
253 fi;
254 @echo $@ done
255
256 # core git merge
257 cmerge: core_merge ;
258 core_merge:
259 @if [ -n "${BRANCH}" ]; then \
260 cd ${CORE_SRC} \
261 && echo ">>>> git merge --no-ff ${BRANCH}" \
262 && git merge --no-ff ${BRANCH}; \
263 else \
264 echo "Don't know what branch merge to current. Usage: make merge BRANCH=branch-to-merge-with"; \
265 fi;
266 @echo $@ done
267
268 # core git push
269 cush: core_push ;
270 cpush: core_push ;
271 core_push:
272 @cd ${CORE_SRC} \
273 && echo ">>>> git push" \
274 && git push;
275 @echo $@ done
276
277 # core git pull
278 cull: core_pull ;
279 cpull: core_pull ;
280 core_pull:
281 cd ${CORE_SRC} \
282 && echo ">>>> git pull" \
283 && git pull;
284 @echo $@ done
285
286 8 ahitrov@rambler.ru # install core into work directory
287 cin: core_install ;
288 ifeq (${DB_TYPE},SINGLE)
289 core_install: check_user pgsql_init
290 else
291 core_install: check_user
292 endif
293 @if [ -d ${CORE_USR} ]; then \
294 chmod -R u+w ${CORE_USR} \
295 && rm -Rf ${CORE_USR}; \
296 fi;
297
298 @mkdir ${CORE_USR} \
299 && cp -Rp ${CORE_SRC}/comps ${CORE_SRC}/lib ${CORE_SRC}/services ${CORE_USR}/ \
300 && find ${CORE_USR}/ -depth -type d -name .svn -exec rm -Rf {} \; \
301 && find ${CORE_USR}/ -depth -type f -name '*.proto' -exec rm -f {} \;
302
303 @for PROJ in `ls -1A ${PROJ_USR}/`; do \
304 ln -s ${PROJ_USR}/$${PROJ}/lib/$${PROJ} ${CORE_USR}/lib/$${PROJ}; \
305 done;
306
307 @chmod -R a-w ${CORE_USR}
308
309 ifeq (${DB_TYPE},SINGLE)
310 @rm -f ${LOCAL}/pgsql/data/pg_hba.conf \
311 && rm -f ${LOCAL}/pgsql/data/pg_ident.conf \
312 && cp ${CORE_SRC}/conf/pgsql/pg_hba.conf ${LOCAL}/pgsql/data/ \
313 && touch ${LOCAL}/pgsql/data/pg_ident.conf
314
315 @${call rewrite,${CORE_SRC}/conf/pgsql/postgresql.conf.proto, \
316 ${LOCAL}/pgsql/data/postgresql.conf}
317 endif
318
319 @echo $@ done
320
321
322 ###################
323 # project_* targets
324 ###################
325
326 # check project sources via repository
327 pst: project_status ;
328 project_status:: check_project
329 650 ahitrov ifeq (${VCS_TYPE},git)
330 @cd ${PROJ_SRC}/${PROJECT} && git status
331 else
332 8 ahitrov@rambler.ru @svn st -u ${PROJ_SRC}/${PROJECT}
333 650 ahitrov endif
334 8 ahitrov@rambler.ru @echo $@ done
335
336 650 ahitrov # pretty formatted project info (svn only)
337 8 ahitrov@rambler.ru pinfo: project_info ;
338 project_info:: check_project
339 @REPOS=`svn info ${PROJ_SRC}/${PROJECT} | grep -E '^URL' | sed -E 's/URL: //'`; \
340 PL=$$(($${#PROJECT}+2)); [ $${PL} -lt 9 ] && PL=9; RL=$$(($${#REPOS}+2)); \
341 printf "%-$${PL}s %-$${RL}s %-10s %s\n" PROJECT REPOSITORY REVISION PLUGINS; \
342 printf "%-$${PL}s %-$${RL}s %-10s ${PLUGINS}\n" ${PROJECT} $${REPOS} ${PROJECT_VERSION}
343 @echo $@ done
344
345 # update project sources from repository
346 pup: project_update ;
347 project_update:: check_project
348 650 ahitrov ifeq (${VCS_TYPE},git)
349 @if [ -d ${PROJ_USR}/${PROJECT} ]; then \
350 cd ${PROJ_SRC}/${PROJECT} \
351 && echo ">>>> git pull" \
352 && git pull; \
353 fi;
354 8 ahitrov@rambler.ru else
355 650 ahitrov @if [ -n "${REV}" ]; then \
356 svn up -r ${REV} ${PROJ_SRC}/${PROJECT}; \
357 else \
358 svn up ${PROJ_SRC}/${PROJECT}; \
359 fi;
360 8 ahitrov@rambler.ru endif
361 @echo $@ done
362
363 # commit project changes to repository
364 pci: project_commit ;
365 project_commit:: check_project
366 650 ahitrov ifeq (${VCS_TYPE},git)
367 @cd ${PROJ_SRC}/${PROJECT} && git commit -a
368 else
369 8 ahitrov@rambler.ru @svn ci ${PROJ_SRC}/${PROJECT}
370 650 ahitrov endif
371 8 ahitrov@rambler.ru @echo $@ done
372
373 650 ahitrov # project git checkout and branch switcher
374 pco: project_checkout ;
375 project_checkout:: check_project
376 @if [ -d ${PROJ_USR}/${PROJECT} ]; then \
377 cd ${PROJ_SRC}/${PROJECT} \
378 && echo ">>>> git checkout ${BRANCH}" \
379 && git checkout ${BRANCH}; \
380 fi;
381 @echo $@ done
382
383 # project git branch workaround.
384 # Uses NAME as branch name for creation, FROM for branch source and DELETE=1 for branch delete
385 branch: project_branch ;
386 pbranch: project_branch ;
387 project_branch:: check_project
388 @if [ -n "${NAME}" -a -n "${FROM}" ]; then \
389 cd ${PROJ_SRC}/${PROJECT} \
390 && echo ">>>> git checkout -b ${NAME} ${FROM}" \
391 && git checkout -b ${NAME} ${FROM}; \
392 elif [ -n "${NAME}" -a -n "${DELETE}" ]; then \
393 cd ${PROJ_SRC}/${PROJECT} \
394 && echo ">>>> git branch -d ${NAME}" \
395 && git branch -d ${NAME}; \
396 elif [ -n "${NAME}" ]; then \
397 cd ${PROJ_SRC}/${PROJECT} \
398 && echo ">>>> git checkout -b ${NAME}" \
399 && git checkout -b ${NAME}; \
400 else \
401 cd ${PROJ_SRC}/${PROJECT} \
402 && git branch -v; \
403 fi;
404 @echo $@ done
405
406 # project git merge
407 merge: project_merge ;
408 pmerge: project_merge ;
409 project_merge:: check_project
410 @if [ -d ${PROJ_USR}/${PROJECT} -a -n "${BRANCH}" ]; then \
411 cd ${PROJ_SRC}/${PROJECT} \
412 && echo ">>>> git merge --no-ff ${BRANCH}" \
413 && git merge --no-ff ${BRANCH}; \
414 else \
415 echo "Don't know what branch merge to current. Usage: make merge BRANCH=branch-to-merge"; \
416 fi;
417 @echo $@ done
418
419 # project git push
420 push: project_push ;
421 ppush: project_push ;
422 project_push:: check_project
423 @if [ -d ${PROJ_USR}/${PROJECT} ]; then \
424 cd ${PROJ_SRC}/${PROJECT} \
425 && echo ">>>> git push" \
426 && git push; \
427 fi;
428 @echo $@ done
429
430 # project git pull
431 pull: project_pull ;
432 ppull: project_pull ;
433 project_pull:: check_project
434 @if [ -d ${PROJ_USR}/${PROJECT} ]; then \
435 cd ${PROJ_SRC}/${PROJECT} \
436 && echo ">>>> git pull" \
437 && git pull; \
438 fi;
439 @echo $@ done
440
441 8 ahitrov@rambler.ru # install project into work directory
442 pin: project_install ;
443 project_install:: check_core_installed check_project
444 @for PORT in ${PROJECT_REQUIRED}; do \
445 ${MAKE} -s port_install PORT=$${PORT} \
446 || exit 1; \
447 done;
448
449 @if [ -d ${PROJ_USR}/${PROJECT} ]; then \
450 chmod -R u+w ${PROJ_USR}/${PROJECT}; \
451 fi;
452
453 @if [ -n "${RSYNC_COMMAND}" ]; then \
454 ${RSYNC_COMMAND} -a --delete --delete-excluded --include='tags' --include '*.exe' --cvs-exclude --exclude '*.proto' ${PROJ_SRC}/${PROJECT}/* ${PROJ_USR}/${PROJECT}; \
455 else \
456 650 ahitrov if [ -d ${PROJ_USR}/${PROJECT} ]; then \
457 rm -Rf ${PROJ_USR}/${PROJECT}; \
458 fi; \
459 mkdir ${PROJ_USR}/${PROJECT} \
460 && cp ${PROJ_SRC}/${PROJECT}/config.mk ${PROJ_USR}/${PROJECT}/ \
461 && cp -R ${PROJ_SRC}/${PROJECT}/comps ${PROJ_USR}/${PROJECT}/ \
462 && cp -R ${PROJ_SRC}/${PROJECT}/conf ${PROJ_USR}/${PROJECT}/ \
463 && cp -R ${PROJ_SRC}/${PROJECT}/lib ${PROJ_USR}/${PROJECT}/ \
464 && cp -R ${PROJ_SRC}/${PROJECT}/services ${PROJ_USR}/${PROJECT}/ \
465 && find ${PROJ_USR}/${PROJECT}/ -depth -type d -name .svn -exec rm -Rf {} \; \
466 8 ahitrov@rambler.ru && find ${PROJ_USR}/${PROJECT}/ -depth -type f -name '*.proto' -exec rm -f {} \; ; \
467 fi
468
469 @if [ \! -e ${PROJ_USR}/${PROJECT}/lib/Contenido ]; then \
470 mkdir ${PROJ_USR}/${PROJECT}/lib/Contenido; \
471 fi;
472
473 @test -d ${PROJ_USR}/${PROJECT}/conf \
474 && rm -Rf ${PROJ_USR}/${PROJECT}/conf \
475 || true
476
477 @if [ \! -e ${CORE_USR}/lib/${PROJECT} ]; then \
478 chmod u+w ${CORE_USR}/lib \
479 && ln -s ${PROJ_USR}/${PROJECT}/lib/${PROJECT} \
480 650 ahitrov ${CORE_USR}/lib/${PROJECT} \
481 8 ahitrov@rambler.ru && chmod u-w ${CORE_USR}/lib; \
482 fi;
483
484 @chmod -R a-w ${PROJ_USR}/${PROJECT}
485
486 @for D in ${PROJ_TMP}/${PROJECT} \
487 ${PROJ_VAR}/${PROJECT}/log \
488 ${PROJ_VAR}/${PROJECT}/mason \
489 ${PROJ_VAR}/${PROJECT}/run; do \
490 test -d $${D} || mkdir -p $${D}; \
491 done;
492
493 @echo $@ done
494
495 # deinstall project from work directory
496 pdi: project_deinstall ;
497 project_deinstall:: check_project_installed project_stop
498 @if [ -d ${PROJ_USR}/${PROJECT} ]; then \
499 chmod -R u+w ${PROJ_USR}/${PROJECT} \
500 && rm -Rf ${PROJ_USR}/${PROJECT}; \
501 fi;
502 @if [ -d ${PROJ_TMP}/${PROJECT} ]; then \
503 rm -Rf ${PROJ_TMP}/${PROJECT}; \
504 fi
505 @if [ -d ${PROJ_VAR}/${PROJECT} ]; then \
506 rm -Rf ${PROJ_VAR}/${PROJECT}; \
507 fi
508 @echo $@ done
509
510 # commit plugins changes
511 plci: plugins_commit ;
512 plugins_commit:
513 ifdef PLUGIN
514 @${MAKE} -s plugin_commit_${PLUGIN}
515 else
516 @for P in ${PLUGINS}; do \
517 ${MAKE} -s plugin_commit_$${P}; \
518 done;
519 endif
520 @echo $@ done
521
522 # commit plugin changes
523 plugin_commit_%:
524 650 ahitrov ifeq (${VCS_TYPE},git)
525 @cd ${PLUG_SRC}/${*} && git commit -a
526 else
527 8 ahitrov@rambler.ru @svn ci ${PLUG_SRC}/${*}
528 650 ahitrov endif
529 8 ahitrov@rambler.ru @echo $@ done
530
531 # status of plugins sources via repository
532 plst: plugins_status ;
533 plugins_status:
534 ifdef PLUGIN
535 @${MAKE} -s plugin_status_${PLUGIN}
536 else
537 @for P in ${PLUGINS}; do \
538 ${MAKE} -s plugin_status_$${P}; \
539 done;
540 endif
541 @echo $@ done
542
543 # status of plugin sources from repository
544 plugin_status_%:
545 650 ahitrov ifeq (${VCS_TYPE},git)
546 @cd ${PLUG_SRC}/${*} && git status
547 else
548 8 ahitrov@rambler.ru @svn st -u ${PLUG_SRC}/${*}
549 650 ahitrov endif
550 8 ahitrov@rambler.ru @echo $@ done
551
552 # update plugins sources from repository
553 plup: plugins_update ;
554 plugins_update:
555 ifdef PLUGIN
556 @${MAKE} -s plugin_update_${PLUGIN}
557 else
558 @for P in ${PLUGINS}; do \
559 ${MAKE} -s plugin_update_$${P}; \
560 done;
561 endif
562 @echo $@ done
563
564 # update plugin sources from repository
565 plugin_update_%:
566 650 ahitrov ifeq (${VCS_TYPE},git)
567 @cd ${PLUG_SRC}/${*} && git pull
568 else
569 8 ahitrov@rambler.ru @svn up ${PLUG_SRC}/${*}
570 650 ahitrov endif
571 8 ahitrov@rambler.ru @echo $@ done
572
573 650 ahitrov # plugins git checkout and branch switcher
574 plco: plugins_checkout ;
575 plugins_checkout:
576 ifdef PLUGIN
577 @${MAKE} -s plugin_checkout_${PLUGIN}
578 else
579 @for P in ${PLUGINS}; do \
580 ${MAKE} -s plugin_checkout_$${P}; \
581 done;
582 endif
583 @echo $@ done
584
585 # plugin git checkout and branch switcher
586 plugin_checkout_%:
587 @cd ${PLUG_SRC}/${*} && git checkout ${BRANCH};
588 @echo $@ done
589
590 # plugins git branch workaround
591 plbranch: plugins_branch ;
592 plugins_branch:
593 ifdef PLUGIN
594 @${MAKE} -s plugin_branch_${PLUGIN}
595 else
596 @for P in ${PLUGINS}; do \
597 ${MAKE} -s plugin_branch_$${P}; \
598 done;
599 endif
600 @echo $@ done
601
602 # plugin git checkout and branch switcher
603 plugin_branch_%:
604 @if [ -n "${NAME}" -a -n "${FROM}" ]; then \
605 cd ${PLUG_SRC}/${*} \
606 && git checkout -b ${NAME} ${FROM}; \
607 elif [ -n "${NAME}" -a -n "${DELETE}" ]; then \
608 cd ${PLUG_SRC}/${*} \
609 && git branch -d ${NAME}; \
610 elif [ -n "${NAME}" ]; then \
611 cd ${PLUG_SRC}/${*} \
612 && git checkout -b ${NAME}; \
613 else \
614 cd ${PLUG_SRC}/${*} \
615 && git branch -v; \
616 fi;
617 @echo $@ done
618
619 # plugins git merge
620 plmerge: plugins_merge ;
621 plugins_merge:
622 ifdef PLUGIN
623 @${MAKE} -s plugin_merge_${PLUGIN}
624 else
625 @for P in ${PLUGINS}; do \
626 ${MAKE} -s plugin_merge_$${P}; \
627 done;
628 endif
629 @echo $@ done
630
631 # plugin git checkout and branch switcher
632 plugin_merge_%:
633 @cd ${PLUG_SRC}/${*} && git merge --no-ff ${BRANCH};
634 @echo $@ done
635
636 # plugins git push
637 plush: plugins_push ;
638 plpush: plugins_push ;
639 plugins_push:
640 ifdef PLUGIN
641 @${MAKE} -s plugin_push_${PLUGIN}
642 else
643 @for P in ${PLUGINS}; do \
644 ${MAKE} -s plugin_push_$${P}; \
645 done;
646 endif
647 @echo $@ done
648
649 # plugin git checkout and branch switcher
650 plugin_push_%:
651 @cd ${PLUG_SRC}/${*} && git push;
652 @echo $@ done
653
654 # plugins git pull
655 plull: plugins_pull ;
656 plpull: plugins_pull ;
657 plugins_pull:
658 ifdef PLUGIN
659 @${MAKE} -s plugin_pull_${PLUGIN}
660 else
661 @for P in ${PLUGINS}; do \
662 ${MAKE} -s plugin_pull_$${P}; \
663 done;
664 endif
665 @echo $@ done
666
667 # plugin git checkout and branch switcher
668 plugin_pull_%:
669 @cd ${PLUG_SRC}/${*} && git pull;
670 @echo $@ done
671
672
673 8 ahitrov@rambler.ru # install plugins into work directory
674 plin: plugins_install ;
675 plugins_install: check_project_installed
676 #XXX It's workaround only (for old instalaltions - without usr/plugins)
677 @test -d ${PLUG_USR} || mkdir ${PLUG_USR}
678 @for P in ${PLUGINS}; do \
679 ${MAKE} -s plugin_install_$${P}; \
680 done;
681 @echo $@ done
682
683 # install plugin
684 plugin_install_%:
685 @if [ -d ${PLUG_USR}/${*} ]; then \
686 chmod -R u+w ${PLUG_USR}/${*}; \
687 fi;
688 @if [ -n "${RSYNC_COMMAND}" ]; then \
689 ${RSYNC_COMMAND} -a --delete --delete-excluded \
690 --cvs-exclude --exclude '*.proto' \
691 ${PLUG_SRC}/${*}/ ${PLUG_USR}/${*}/; \
692 else \
693 if [ -d ${PLUG_USR}/${*} ]; then \
694 rm -Rf ${PLUG_USR}/${*}; \
695 fi; \
696 cp -R ${PLUG_SRC}/${*} ${PLUG_USR}/${*} \
697 && find ${PLUG_USR}/${*}/ -depth -type d -name .svn \
698 -exec rm -Rf {} \; \
699 && find ${PLUG_USR}/${*}/ -depth -type f -name '*.proto' \
700 -exec rm -f {} \; ; \
701 fi;
702 @chmod -R a-w ${PLUG_USR}/${*}
703 @echo $@ done
704
705 # deinstall plugins from work directory
706 pldi: plugins_deinstall ;
707 plugins_deinstall:
708 @for P in ${PLUGINS}; do \
709 ${MAKE} -s plugin_deinstall_$${P}; \
710 done;
711 @echo $@ done
712
713 # deinstall plugin
714 plugin_deinstall_%:
715 @if [ -d ${PLUG_USR}/${*} ]; then \
716 chmod -R u+w ${PLUG_USR}/${*} \
717 && rm -Rf ${PLUG_USR}/${*}; \
718 fi;
719 @echo $@ done
720
721 # create new plugin
722 plc: plugin_create ;
723 plugin_create: check_user
724 @if [ -z "${NAME}" ]; then \
725 echo "ERROR: NAME not defined"; \
726 echo "HINT: use 'make cmd NAME=xxx'"; \
727 exit 1; \
728 fi;
729 @if [ -e ${PLUG_SRC}/${NAME} ]; then \
730 echo "ERROR: plugin ${NAME} already exists in src/plugins"; \
731 echo "HINT: select other name for new plugin"; \
732 exit 1; \
733 fi;
734 @if [ -e ${PLUG_USR}/${NAME} ]; then \
735 echo "ERROR: plugin ${NAME} already exists in usr/plugins"; \
736 echo "HINT: select other name for new plugin"; \
737 exit 1; \
738 fi;
739
740 650 ahitrov @mkdir -p ${PLUG_SRC} \
741 8 ahitrov@rambler.ru && cp -Rp ${CORE_SRC}/skel/plugin ${PLUG_SRC}/${NAME} \
742 && find ${PLUG_SRC}/${NAME}/ -depth -type d -name .svn -exec rm -Rf {} \; \
743 && find ${PLUG_SRC}/${NAME}/ -depth -type f -name '*.proto' -and \
744 \! -path '*/conf/*' -exec rm -f {} \;
745
746 @${call rewrite_skel,${CORE_SRC}/skel/plugin/lib/plugin/Apache.pm.proto, \
747 ${PLUG_SRC}/${NAME}/lib/plugin/Apache.pm}
748 @${call rewrite_skel,${CORE_SRC}/skel/plugin/lib/plugin/Init.pm.proto, \
749 ${PLUG_SRC}/${NAME}/lib/plugin/Init.pm}
750 @${call rewrite_skel,${CORE_SRC}/skel/plugin/lib/plugin/Keeper.pm.proto, \
751 ${PLUG_SRC}/${NAME}/lib/plugin/Keeper.pm}
752 @${call rewrite_skel,${CORE_SRC}/skel/plugin/lib/plugin/State.pm.proto, \
753 ${PLUG_SRC}/${NAME}/lib/plugin/State.pm.proto}
754 @${call rewrite_skel,${CORE_SRC}/skel/plugin/comps/contenido/plugin/dhandler, \
755 ${PLUG_SRC}/${NAME}/comps/contenido/plugin/dhandler}
756 @${call rewrite_skel,${CORE_SRC}/skel/plugin/comps/contenido/plugin/index.html, \
757 ${PLUG_SRC}/${NAME}/comps/contenido/plugin/index.html}
758
759 @mv ${PLUG_SRC}/${NAME}/lib/plugin ${PLUG_SRC}/${NAME}/lib/${NAME}
760 @mv ${PLUG_SRC}/${NAME}/comps/contenido/plugin ${PLUG_SRC}/${NAME}/comps/contenido/${NAME}
761
762 @echo $@ done
763
764
765 # install configs into work directory
766 conf: project_conf ;
767 project_conf:: check_plugins_installed
768 @chmod -R u+w ${PROJ_USR}/${PROJECT}
769
770 @if [ -d ${PROJ_USR}/${PROJECT}/conf ]; then \
771 rm -Rf ${PROJ_USR}/${PROJECT}/conf; \
772 fi
773 @mkdir -p ${PROJ_USR}/${PROJECT}/conf/apache \
774 && mkdir -p ${PROJ_USR}/${PROJECT}/conf/etc \
775 && mkdir -p ${PROJ_USR}/${PROJECT}/conf/mason \
776 && mkdir -p ${PROJ_USR}/${PROJECT}/conf/mod_perl
777
778 @cp ${CORE_SRC}/conf/apache/mime.conf \
779 ${CORE_SRC}/conf/apache/mime.types \
780 ${PROJ_USR}/${PROJECT}/conf/apache/
781
782 @${call rewrite,${CORE_SRC}/conf/apache/httpd.conf.proto, \
783 ${PROJ_USR}/${PROJECT}/conf/apache/httpd.conf}
784 @${call rewrite,${PROJ_SRC}/${PROJECT}/conf/apache/httpd.conf.proto, \
785 ${PROJ_USR}/${PROJECT}/conf/apache/httpd_project.conf}
786
787 ifeq (${CRON_ENABLE},YES)
788 @if [ -d ${PROJ_SRC}/${PROJECT}/conf/etc ]; then \
789 cd ${PROJ_SRC}/${PROJECT}/conf/etc && \
790 for CTPROTO in crontab.`hostname`.proto crontab.proto; do \
791 if [ -f $$CTPROTO ]; then \
792 ${call rewrite,$$CTPROTO, \
793 ${PROJ_USR}/${PROJECT}/conf/etc/crontab}; \
794 break; \
795 fi; \
796 done; \
797 fi
798 endif
799
800 @${call rewrite,${CORE_SRC}/conf/mason/handler.pl.proto, \
801 ${PROJ_USR}/${PROJECT}/conf/mason/handler.pl}
802 @${call rewrite,${PROJ_SRC}/${PROJECT}/conf/mason/handler.pl.proto, \
803 ${PROJ_USR}/${PROJECT}/conf/mason/handler_project.pl}
804
805 @${call rewrite,${CORE_SRC}/conf/mod_perl/startup.pl.proto, \
806 ${PROJ_USR}/${PROJECT}/conf/mod_perl/startup.pl}
807 @${call rewrite,${PROJ_SRC}/${PROJECT}/conf/mod_perl/startup.pl.proto, \
808 ${PROJ_USR}/${PROJECT}/conf/mod_perl/startup_project.pl}
809
810 @${call rewrite,${CORE_SRC}/conf/mason/Config.pm.proto, \
811 ${PROJ_USR}/${PROJECT}/conf/mason/Config.pm}
812 @${call rewrite,${CORE_SRC}/lib/Contenido/State.pm.proto, \
813 ${PROJ_USR}/${PROJECT}/lib/Contenido/State.pm}
814 @${call rewrite,${CORE_SRC}/lib/Modules.pm.proto, \
815 ${PROJ_USR}/${PROJECT}/lib/Modules.pm}
816
817 @${call rewrite,${PROJ_SRC}/${PROJECT}/lib/${PROJECT}/State.pm.proto, \
818 ${PROJ_USR}/${PROJECT}/lib/${PROJECT}/State.pm}
819
820 @chmod -R u+w ${CORE_USR}/lib ${CORE_USR}/services
821
822 @${call rewrite,${CORE_SRC}/services/inc.pl.proto, \
823 ${CORE_USR}/services/inc.pl}
824
825 @chmod -R a-w ${CORE_USR}/lib ${CORE_USR}/services
826
827 @for P in ${PLUGINS}; do \
828 chmod -R u+w ${PLUG_USR}/$${P}; \
829 ${call rewrite,${PLUG_SRC}/$${P}/lib/$${P}/State.pm.proto, \
830 ${PLUG_USR}/$${P}/lib/$${P}/State.pm}; \
831 chmod -R u-w ${PLUG_USR}/$${P}; \
832 done;
833
834 @if [ $$((`perl -e 'print "".(lc "${DEVELOPMENT}" eq "yes" ? 1 : 0);'`)) -ne 1 ]; then \
835 ${CORE_USR}/services/pregen \
836 ${PROJ_SRC} ${PROJ_USR} ${PROJECT} '${PREGEN_GLOB}' ${PREGEN_LIST}; \
837 fi
838
839 @chmod -R a-w ${PROJ_USR}/${PROJECT}
840
841
842 ifeq (${DISABLE},YES)
843 650 ahitrov @crontab -l | sed 's/^#*/#/' | crontab -; \
844 8 ahitrov@rambler.ru echo "Disabled crontab"
845 else
846 @if [ -f ${PROJ_USR}/${PROJECT}/conf/etc/crontab ]; then \
847 crontab ${PROJ_USR}/${PROJECT}/conf/etc/crontab; \
848 echo "Installed crontab from: ${PROJ_USR}/${PROJECT}/conf/etc/crontab"; \
849 fi
850 endif
851
852 @echo $@ done
853
854 # rsync project static files directly to frontend
855 prs: project_rsync ;
856 project_rsync:: check_project
857 @for D in ${RSYNC_DIRS}; do \
858 if [ -d ${RSYNC_ROOT}/$${D} ]; then \
859 D=$${D}/; \
860 elif [ \! -f ${RSYNC_ROOT}/$${D} ]; then \
861 echo "ERROR: no such dir or file: ${RSYNC_ROOT}/$${D}"; \
862 exit 1; \
863 fi; \
864 for S in ${RSYNC_SERVERS}; do \
865 echo "#######################################"; \
866 echo "# rsync $${D} to $${S}"; \
867 echo "#######################################"; \
868 cd ${RSYNC_ROOT} && ${RSYNC} -rtRv \
869 --delete --delete-excluded --exclude .svn --chmod=u+w \
870 $${D} $${S}; \
871 echo -e "done\n"; \
872 done; \
873 done;
874 @echo $@ done
875
876 614 ahitrov # rsync core static files directly to frontend
877 crs: core_rsync ;
878 core_rsync:: check_core_installed
879 @for D in ${RSYNC_CORE_DIRS}; do \
880 if [ -d ${RSYNC_CORE_ROOT}/$${D} ]; then \
881 D=$${D}/; \
882 elif [ \! -f ${RSYNC_CORE_ROOT}/$${D} ]; then \
883 echo "ERROR: no such dir or file: ${RSYNC_CORE_ROOT}/$${D}"; \
884 exit 1; \
885 fi; \
886 for S in ${RSYNC_SERVERS}; do \
887 echo "#######################################"; \
888 echo "# rsync $${D} to $${S}"; \
889 echo "#######################################"; \
890 cd ${RSYNC_CORE_ROOT} && ${RSYNC} -rtRv \
891 --delete --delete-excluded --exclude .svn --chmod=u+w \
892 $${D} $${S}; \
893 echo -e "done\n"; \
894 done; \
895 done;
896 @echo $@ done
897
898 assets: project_assets ;
899 project_assets:: check_project
900 @rm -rf ${ASSETS_ROOT}/assets;
901 @cd ${PROJ_SRC}/${PROJECT} && echo ${PROJ_SRC}/${PROJECT} && \
902 npm install;
903 @cd ${PROJ_SRC}/${PROJECT} && npm run build;
904 @if [ -d ${ASSETS_ROOT}/assets ]; then \
905 echo "Assets generated in ${ASSETS_ROOT}/assets"; \
906 fi;
907 @echo $@ done
908
909 assdev: project_assets_dev ;
910 project_assets_dev:: check_project
911 @rm -rf ${ASSETS_ROOT}/assets;
912 @cd ${PROJ_SRC}/${PROJECT} && echo ${PROJ_SRC}/${PROJECT} && \
913 npm install;
914 @cd ${PROJ_SRC}/${PROJECT} && npm run dev;
915
916 # rsync project assets directly to frontend
917 ars: project_assets_rsync ;
918 project_assets_rsync:: check_project
919 @if [ -d ${ASSETS_ROOT}/assets ]; then \
920 echo "Found assets in ${ASSETS_ROOT}/assets"; \
921 for S in ${RSYNC_SERVERS}; do \
922 echo "#######################################################"; \
923 echo "# rsync ${ASSETS_ROOT}/assets to $${S}"; \
924 echo "#######################################################"; \
925 cd ${ASSETS_ROOT} && ${RSYNC} -rtRv \
926 --delete --delete-excluded --exclude .svn --chmod=u+w \
927 assets $${S}; \
928 echo -e "done\n"; \
929 done; \
930 elif [ \! -f ${ASSETS_ROOT} ]; then \
931 echo "ERROR: no such dir or file: ${ASSETS_ROOT}"; \
932 exit 1; \
933 fi;
934 @echo $@ done
935
936 8 ahitrov@rambler.ru # start project
937 start: project_start ;
938 ifneq (${DISABLE},YES)
939 ifeq (${DB_TYPE},SINGLE)
940 project_start:: pgsql_start apache_start
941 @echo $@ done
942 else
943 project_start:: apache_start
944 @echo $@ done
945 endif
946 else
947 project_start::
948 @for M in `cd ${PROJ_VAR}/${PROJECT} && ls -d mason.* 2>/dev/null`; do \
949 echo "cleaning old mason files: $$M"; \
950 rm -Rf ${PROJ_VAR}/${PROJECT}/$$M; \
951 done;
952 @echo $@ disabled
953 endif
954
955 # stop project
956 stop: project_stop ;
957 project_stop:: apache_stop
958 @echo $@ done
959
960 # full reinstall & restart core & project
961 full: project_fullreload ;
962 project_fullreload:: project_stop mason_clean core_update core_install \
963 project_update project_install plugins_update plugins_install \
964 project_conf project_start
965 @echo $@ done
966
967 740 ahitrov # full reinstall & restart core & project
968 giga: project_fullrewind ;
969 project_fullrewind:: project_stop mason_clean \
970 core_install project_install plugins_install \
971 project_conf project_start
972 @echo $@ done
973
974 8 ahitrov@rambler.ru # full reinstall & restart project
975 reload: project_reload ;
976 project_reload:: project_stop mason_clean project_update project_install \
977 plugins_update plugins_install project_conf project_start
978 @echo $@ done
979
980 # restart project without svn update
981 nano: project_rewind ;
982 rewind: project_rewind ;
983 project_rewind:: project_stop mason_clean project_install plugins_install \
984 project_conf project_start
985 @echo $@ done
986
987 # clean all mason temporaries & restart project
988 refresh: project_refresh ;
989 project_refresh:: project_stop mason_clean project_start
990 @echo $@ done
991
992 # create new project
993 create: project_create ;
994 project_create: check_user
995 @if [ -z "${NAME}" ]; then \
996 echo "ERROR: NAME not defined"; \
997 echo "HINT: use 'make cmd NAME=xxx'"; \
998 exit 1; \
999 fi;
1000 @if [ -e ${PROJ_SRC}/${NAME} ]; then \
1001 echo "ERROR: project ${NAME} already exists in src/projects"; \
1002 echo "HINT: select other name for new project"; \
1003 exit 1; \
1004 fi;
1005 @if [ -e ${PROJ_USR}/${NAME} ]; then \
1006 echo "ERROR: project ${NAME} already exists in usr/projects"; \
1007 echo "HINT: select other name for new project"; \
1008 exit 1; \
1009 fi;
1010
1011 @cp -Rp ${CORE_SRC}/skel/project ${PROJ_SRC}/${NAME} \
1012 && find ${PROJ_SRC}/${NAME}/ -depth -type d -name .svn -exec rm -Rf {} \; \
1013 && find ${PROJ_SRC}/${NAME}/ -depth -type f -name '*.proto' -and \
1014 \! -path '*/conf/*' -exec rm -f {} \;
1015
1016 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/Apache.pm.proto, \
1017 ${PROJ_SRC}/${NAME}/lib/project/Apache.pm}
1018 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/Init.pm.proto, \
1019 ${PROJ_SRC}/${NAME}/lib/project/Init.pm}
1020 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/Keeper.pm.proto, \
1021 ${PROJ_SRC}/${NAME}/lib/project/Keeper.pm}
1022 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/SampleCustomDocument.pm.proto, \
1023 ${PROJ_SRC}/${NAME}/lib/project/SampleCustomDocument.pm}
1024 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/SampleDefaultDocument.pm.proto, \
1025 ${PROJ_SRC}/${NAME}/lib/project/SampleDefaultDocument.pm}
1026 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/State.pm.proto, \
1027 ${PROJ_SRC}/${NAME}/lib/project/State.pm.proto}
1028 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/SQL/SampleTable.pm.proto, \
1029 ${PROJ_SRC}/${NAME}/lib/project/SQL/SampleTable.pm}
1030 @${call rewrite_skel,${CORE_SRC}/skel/project/lib/project/SQL/SampleTable.pm.proto, \
1031 ${PROJ_SRC}/${NAME}/lib/project/SQL/SampleTable.pm}
1032 @${call rewrite_skel,${CORE_SRC}/skel/project/comps/www/index.html.proto, \
1033 ${PROJ_SRC}/${NAME}/comps/www/index.html}
1034 @${call rewrite_skel,${CORE_SRC}/skel/project/conf/etc/crontab.tmpl.proto, \
1035 ${PROJ_SRC}/${NAME}/conf/etc/crontab.tmpl.proto}
1036 @${call rewrite_skel,${CORE_SRC}/skel/project/config.mk.proto, \
1037 ${PROJ_SRC}/${NAME}/config.mk}
1038
1039 @mv ${PROJ_SRC}/${NAME}/lib/project ${PROJ_SRC}/${NAME}/lib/${NAME}
1040
1041 @echo $@ done
1042
1043
1044 # change active project
1045 swi: project_switch ;
1046 switch: project_switch ;
1047 project_switch:
1048 @if [ -z "${NAME}" ]; then \
1049 echo "ERROR: NAME not defined"; \
1050 echo "HINT: use 'make cmd NAME=xxx'"; \
1051 exit 1; \
1052 fi;
1053 @if [ "${NAME}" = "${PROJECT}" ]; then \
1054 echo "ERROR: project ${NAME} is already active"; \
1055 exit 1; \
1056 fi;
1057 @if [ \! -d ${PROJ_SRC}/${NAME} ]; then \
1058 echo "ERROR: project ${NAME} doesn't exists in src/projects"; \
1059 echo "HINT: checkout sources for project ${NAME}"; \
1060 exit 1; \
1061 fi;
1062 @${MAKE} -s project_stop
1063 @perl -pi.orig -e 's|^([[:space:]]*PROJECT[[:space:]]*\?*\=[[:space:]]*)[^[:space:]]+([[:space:]]*)$$|$$1${NAME}$$2|' ${ROOT_DIR}/config.mk
1064 @${MAKE} -s project_reload PROJECT=${NAME}
1065
1066 @echo $@ done
1067
1068 # backing-up project sources
1069 backup: project_backup ;
1070 project_backup:: check_project
1071 @echo "compressing ${PROJECT} sources => ${PROJ_VAR}/${PROJECT}/${PROJECT}.src.tgz"
1072 @tar -czf ${PROJ_VAR}/${PROJECT}/${PROJECT}.src.tgz -C ${PROJ_SRC} ${PROJECT}
1073 @echo $@ done
1074
1075 # import project sources into repository
1076 import: project_import ;
1077 project_import: check_project
1078 @if [ $$((`find ${PROJ_SRC}/${PROJECT} -type d -name .svn | wc -l`)) -ne 0 ]; then \
1079 echo "ERROR: project '${PROJECT}' seems as already imported"; \
1080 exit 1; \
1081 fi
1082 @if ! svn ls ${SVN_REPOSITORY}/${PROJECT}/trunk >&- 2>&-; then \
1083 echo "ERROR: no repository for project '${PROJECT}' found"; \
1084 echo "HINT: contact with respository administrators."; \
1085 exit 1; \
1086 fi
1087 @if [ $$((`svn ls ${SVN_REPOSITORY}/${PROJECT}/trunk | wc -l`)) -ne 0 ]; then \
1088 echo "ERROR: repository for project '${PROJECT}' isn't empty"; \
1089 echo "Please contact with respository administrators."; \
1090 exit 1; \
1091 fi
1092 @if svn import ${PROJ_SRC}/${PROJECT} ${SVN_REPOSITORY}/${PROJECT}/trunk \
1093 && mv ${PROJ_SRC}/${PROJECT} ${PROJ_SRC}/${PROJECT}.before-import \
1094 && svn checkout ${SVN_REPOSITORY}/${PROJECT}/trunk ${PROJ_SRC}/${PROJECT}; then \
1095 echo "Your project directory moved to '${PROJ_SRC}/${PROJECT}.before-import'"; \
1096 echo "Directory '${PROJ_SRC}/${PROJECT}' is now working copy"; \
1097 else \
1098 echo "ERROR: some errors occured during import/checkout project '${PROJECT}'"; \
1099 echo "HINT: contact with respository administrators."; \
1100 exit 1; \
1101 fi
1102 @echo $@ done
1103
1104 # create user (editors)
1105 user: project_user ;
1106 project_user: check_core_installed pgsql_template
1107 @export PGPASSWORD=${BASE_PASSWD} && ${CORE_USR}/services/createuser | \
1108 ${PSQL} -h '${BASE_HOST}' -p ${PGSQL_PORT} -U ${BASE_USER} ${PGSQL_BASE}
1109 @echo $@ done
1110
1111 ##################
1112 # apache_* targets
1113 ##################
1114
1115 286 ahitrov # _exp=`perl -e 'print $1 if "${LIMIT_VMEMORY_HTTPD}" =~ /.*(.)$/;'`;
1116 # _exp=`perl -e 'my $$e = ("${LIMIT_VMEMORY_HTTPD}"=~/.*(.)/)[0]; print $$e;'`; \
1117 # echo _exp=$${_exp}; \
1118
1119 8 ahitrov@rambler.ru apache_start: check_conf_installed
1120 @${call is_alive,${PROJ_VAR}/${PROJECT}/run/httpd.pid}; \
1121 FLAGS=`perl -e 'print " -DDEVELOPMENT" if lc "${DEVELOPMENT}" eq "yes";'`; \
1122 662 ahitrov FLAGS=$$FLAGS`perl -e 'print " -F" if lc "${FOREGROUND}" eq "yes";'`; \
1123 8 ahitrov@rambler.ru FLAGS=$$FLAGS`perl -e ' \
1124 if (lc "${RSYSLOG_ENABLE}" eq "yes") { print " -DRSYSLOG"; } \
1125 elsif (lc "${CRONOLOG_ENABLE}" eq "yes") { print " -DCRONOLOG"; } \
1126 else { print " -DFILELOG"; }'`; \
1127 if [ "${LIMIT_VMEMORY_HTTPD}" ]; then \
1128 286 ahitrov if [ x`uname` = x"FreeBSD" ]; then \
1129 LIMITS="${LIMIT_CMD} -v ${LIMIT_VMEMORY_HTTPD}"; \
1130 else \
1131 # echo "LIMIT_VMEMORY_HTTPD=${LIMIT_VMEMORY_HTTPD}"; \
1132 _exp=`expr "${LIMIT_VMEMORY_HTTPD}" : '.*\(.\)'`; \
1133 # echo _exp=$${_exp}; \
1134 _value=`expr "${LIMIT_VMEMORY_HTTPD}" : '\(.*\).'`; \
1135 # echo _value=$${_value}; \
1136 if [ "$${_exp}" = "m" ]; then \
1137 _value=`expr $$_value \* 1024 `; \
1138 fi; \
1139 # echo _value=$${_value}; \
1140 LIMITS="ulimit -S -v $${_value}"; \
1141 echo "DEBUG: running on Linux, LIMITS='$${LIMITS}'"; \
1142 fi; \
1143 8 ahitrov@rambler.ru fi; \
1144 if [ "$${ALIVE}" = "YES" ]; then \
1145 echo "WARNING: apache for project '${PROJECT}' already running"; \
1146 else \
1147 286 ahitrov [ x`uname` = x"Linux" ] && $${LIMITS} && LIMITS=""; \
1148 8 ahitrov@rambler.ru if $${LIMITS} ${LOCAL}/apache/bin/httpd $${FLAGS} \
1149 -d ${PROJ_USR}/${PROJECT}/ \
1150 -f ${PROJ_USR}/${PROJECT}/conf/apache/httpd.conf; then \
1151 echo -n "apache for project '${PROJECT}' started"; \
1152 if [ "${LIMIT_VMEMORY_HTTPD}" ]; then \
1153 echo " (with vmem limit: ${LIMIT_VMEMORY_HTTPD})"; \
1154 else \
1155 echo; \
1156 fi; \
1157 else \
1158 echo "ERROR: can't start apache for project '${PROJECT}'"; \
1159 exit 1; \
1160 fi; \
1161 fi;
1162 @for M in `cd ${PROJ_VAR}/${PROJECT} && ls -d mason.*`; do \
1163 echo "cleaning old mason files: $$M"; \
1164 rm -Rf ${PROJ_VAR}/${PROJECT}/$$M; \
1165 done;
1166 @echo $@ done
1167
1168 apache_stop: check_conf_installed
1169 @${call is_alive,${PROJ_VAR}/${PROJECT}/run/httpd.pid}; \
1170 if [ "$${ALIVE}" = "YES" ]; then \
1171 kill `head -n 1 ${PROJ_VAR}/${PROJECT}/run/httpd.pid`; \
1172 ${call wait_stop,${PROJ_VAR}/${PROJECT}/run/httpd.pid,apache}; \
1173 if [ $${STOPPED} != 'YES' ]; then \
1174 echo "ERROR: can't stop apache for project '${PROJECT}'"; \
1175 exit 1; \
1176 else \
1177 echo "apache for project '${PROJECT}' stopped"; \
1178 fi; \
1179 else \
1180 echo "WARNING: apache for project '${PROJECT}' isn't running"; \
1181 fi;
1182 @echo $@ done
1183
1184 alog: apache_access_log ;
1185 apache_access_log:
1186 @test -e ${PROJECT_LOG}/access_log || touch ${PROJECT_LOG}/access_log
1187 @tail -F ${PROJECT_LOG}/access_log
1188
1189 palog: apache_pager_access_log ;
1190 apache_pager_access_log:
1191 @test -e ${PROJECT_LOG}/access_log || touch ${PROJECT_LOG}/access_log
1192 @${PAGER} ${PROJECT_LOG}/access_log
1193
1194 elog: apache_error_log ;
1195 apache_error_log:
1196 @test -e ${PROJECT_LOG}/error_log || touch ${PROJECT_LOG}/error_log
1197 @tail -F ${PROJECT_LOG}/error_log
1198
1199 pelog: apache_pager_error_log ;
1200 apache_pager_error_log:
1201 @test -e ${PROJECT_LOG}/error_log || touch ${PROJECT_LOG}/error_log
1202 @${PAGER} ${PROJECT_LOG}/error_log
1203
1204 #################
1205 # pgsql_* targets
1206 #################
1207
1208 ifeq (${DB_TYPE},SINGLE)
1209
1210 pgsql_init: check_user
1211 @cd ${PORTSDIR}/all/postgresql \
1212 && ${MAKE} -s initdb PREFIX=${LOCAL} PORTSWRK=${PORTSWRK}
1213 @echo $@ done
1214
1215 pgsql_start: pgsql_init
1216 @${call is_alive,${LOCAL}/pgsql/data/postmaster.pid}; \
1217 if [ "$${ALIVE}" = "YES" ]; then \
1218 echo "WARNING: postgresql already running"; \
1219 else \
1220 if ${LOCAL}/pgsql/bin/pg_ctl -w -D ${LOCAL}/pgsql/data start; then \
1221 echo "postgresql started"; \
1222 else \
1223 echo "ERROR: can't start postgresql"; \
1224 exit 1; \
1225 fi; \
1226 fi;
1227 @echo $@ done
1228
1229 pgsql_stop: check_user
1230 @${call is_alive,${LOCAL}/pgsql/data/postmaster.pid}; \
1231 if [ "$${ALIVE}" = "YES" ]; then \
1232 ${LOCAL}/pgsql/bin/pg_ctl -w -m fast -D ${LOCAL}/pgsql/data stop; \
1233 ${call wait_stop,${LOCAL}/pgsql/data/postmaster.pid,postgresql}; \
1234 if [ $${STOPPED} != 'YES' ]; then \
1235 echo "ERROR: can't stop postgresql"; \
1236 exit 1; \
1237 else \
1238 echo "postgresql stopped"; \
1239 fi; \
1240 else \
1241 echo "WARNING: postgresql isn't running"; \
1242 fi;
1243 @echo $@ done
1244
1245 pgsql_create: pgsql_start
1246 @if [ $$((`${PSQL} -p ${PGSQL_PORT} -l | \
1247 perl -ne 'print $$_ if /^\s*${PGSQL_BASE}/' | wc -l`)) -eq 0 ]; then \
1248 ${LOCAL}/pgsql/bin/createuser -SdR -p ${PGSQL_PORT} ${BASE_USER} \
1249 || true; \
1250 ${LOCAL}/pgsql/bin/createdb -p ${PGSQL_PORT} -O ${BASE_USER} \
1251 ${PGSQL_BASE}; \
1252 echo "ALTER USER ${BASE_USER} PASSWORD '${BASE_PASSWD}';" | \
1253 ${PSQL} -p ${PGSQL_PORT} ${PGSQL_BASE}; \
1254 ${PSQL} -p ${PGSQL_PORT} ${PGSQL_BASE} < ${LOCAL}/pgsql/share/contrib/_int.sql; \
1255 else \
1256 echo "WARNING: database ${PGSQL_BASE} already exists"; \
1257 fi;
1258 @echo $@ done
1259
1260
1261 else
1262
1263 pgsql_init \
1264 pgsql_start \
1265 pgsql_stop \
1266 pgsql_create:
1267 @echo "ERROR: $@ not implemented for DB_TYPE: ${DB_TYPE}"; \
1268 echo "HINT: use 'make cmd DB_TYPE=xxx' or edit ${ROOT_DIR}/config.mk"; \
1269 exit 1
1270
1271 endif
1272
1273 ifeq (${DB_TYPE},SINGLE)
1274 pgsql_template: pgsql_create
1275 else
1276 pgsql_template: check_project
1277 endif
1278 @if [ $$((`export PGPASSWORD=${BASE_PASSWD} && ${PSQL} -h '${BASE_HOST}' \
1279 -p ${PGSQL_PORT} -U ${BASE_USER} -c '\d' ${PGSQL_BASE} | \
1280 grep documents | wc -l`)) -lt 1 ]; then \
1281 export PGPASSWORD=${BASE_PASSWD} && ${PSQL} -h '${BASE_HOST}' \
1282 -p ${PGSQL_PORT} -U ${BASE_USER} ${PGSQL_BASE} < \
1283 ${CORE_SRC}/sql/${STORE_METHOD}/contenido.sql; \
1284 else \
1285 echo "WARNING: template already loaded into database ${PGSQL_BASE}"; \
1286 fi;
1287
1288 @echo $@ done
1289
1290 psql: pgsql_psql ;
1291 ifeq (${DB_TYPE},SINGLE)
1292 pgsql_psql: pgsql_create
1293 else
1294 pgsql_psql: check_project
1295 endif
1296 @(export PGPASSWORD=${BASE_PASSWD} && cd ../.. && ${PSQL} -h '${BASE_HOST}' -p ${PGSQL_PORT} \
1297 -U ${BASE_USER} ${PGSQL_BASE})
1298
1299 # dump project database
1300 dump: pgsql_dump ;
1301 ifeq (${DB_TYPE},NONE)
1302 pgsql_dump:
1303 @echo "project ${PROJECT} hasn't database"; exit 1
1304 else
1305 ifeq (${DB_TYPE},SINGLE)
1306 pgsql_dump: pgsql_create
1307 else
1308 pgsql_dump: check_project
1309 endif
1310 @echo "dumping ${BASE_HOST}:${PGSQL_PORT}/${PGSQL_BASE} => ${PROJ_VAR}/${PROJECT}/${PGSQL_BASE}.sql"
1311 @export PGPASSWORD=${BASE_PASSWD} && ${PGDUMP} -Ox -h '${BASE_HOST}' -p ${PGSQL_PORT} \
1312 -U ${BASE_USER} ${PGSQL_BASE} > ${PROJ_VAR}/${PROJECT}/${PGSQL_BASE}.sql
1313 @echo $@ done
1314 endif
1315
1316 # dump project database (gzip)
1317 dumpz: pgsql_dumpz ;
1318 ifeq (${DB_TYPE},NONE)
1319 pgsql_dumpz:
1320 @echo "project ${PROJECT} hasn't database"; exit 1
1321 else
1322 ifeq (${DB_TYPE},SINGLE)
1323 pgsql_dumpz: pgsql_create
1324 else
1325 pgsql_dumpz: check_project
1326 endif
1327 @echo "dumping ${BASE_HOST}:${PGSQL_PORT}/${PGSQL_BASE} => ${PROJ_VAR}/${PROJECT}/${PGSQL_BASE}.sql.gz"
1328 @export PGPASSWORD=${BASE_PASSWD} && ${PGDUMP} -Ox -h '${BASE_HOST}' -p ${PGSQL_PORT} \
1329 -U ${BASE_USER} ${PGSQL_BASE} | gzip > ${PROJ_VAR}/${PROJECT}/${PGSQL_BASE}.sql.gz
1330 @echo $@ done
1331 endif
1332
1333
1334 ########################
1335 # internal targets
1336 # (not for direct usage)
1337 ########################
1338
1339 mason_clean:
1340 @mv -f ${PROJ_VAR}/${PROJECT}/mason \
1341 ${PROJ_VAR}/${PROJECT}/mason.`date +%Y-%m-%d.%H:%M:%S` \
1342 && mkdir ${PROJ_VAR}/${PROJECT}/mason;
1343 @echo $@ done
1344
1345
1346 #################
1347 # check_* targets
1348 #################
1349
1350 # it's required
1351 check_user: check_owner ;
1352
1353 # if user is installation owner?
1354 check_owner:
1355 @if [ `whoami` != ${OWNER} ]; then \
1356 echo "ERROR: please run as OWNER: ${OWNER}"; \
1357 echo "HINT: use 'sudo -u ${OWNER} -H bash' or 'sudo -i -u ${OWNER}'"; \
1358 exit 1; \
1359 fi;
1360
1361 # check if core installed
1362 check_core_installed: check_user
1363 @if [ $$((`ls -1A ${CORE_USR}/ | wc -l`)) -eq 0 ]; then \
1364 echo "ERROR: core not installed"; \
1365 echo "HINT: use 'make core_install' or 'make cin'"; \
1366 exit 1; \
1367 fi;
1368
1369 # check for existing project (see include near line ~30)
1370 check_project: check_user
1371 @if [ -z "${PROJECT}" ]; then \
1372 echo "ERROR: project not defined"; \
1373 echo "HINT: use 'make cmd PROJECT=xxx' or edit ${ROOT_DIR}/config.mk"; \
1374 exit 1; \
1375 fi;
1376
1377 # check if project installed
1378 check_project_installed: check_project
1379 @if [ \! -d ${PROJ_USR}/${PROJECT} ]; then \
1380 echo "ERROR: project '${PROJECT}' not installed"; \
1381 echo "HINT: use 'make project_install' or 'make pin'"; \
1382 exit 1; \
1383 fi;
1384 @if [ $$((`ls -1A ${PROJ_USR}/${PROJECT} | wc -l`)) -eq 0 ]; then \
1385 echo "ERROR: project '${PROJECT}' not installed"; \
1386 echo "HINT: use 'make project_install' or 'make pin'"; \
1387 exit 1; \
1388 fi;
1389
1390 # check if plugins installed
1391 check_plugins_installed: check_project_installed
1392 @for P in ${PLUGINS}; do \
1393 if [ \! -d ${PLUG_USR}/$${P} ]; then \
1394 echo "ERROR: plugin '$${P}' not installed"; \
1395 echo "HINT: use 'make plugins_install' or 'make plin'"; \
1396 exit 1; \
1397 fi; \
1398 done;
1399
1400 # check if configs installed
1401 check_conf_installed: check_project_installed
1402 @if [ \! -d ${PROJ_USR}/${PROJECT}/conf ]; then \
1403 echo "ERROR: configs for project '${PROJECT}' not installed"; \
1404 echo "HINT: use 'make project_conf' or 'make conf'"; \
1405 exit 1; \
1406 fi;
1407
1408
1409 ##########################
1410 # port_* & ports_* targets
1411 ##########################
1412
1413 # single port sub-commands
1414 port_%: check_user
1415 ifdef PORT
1416 @cd ${PORTSDIR}/all/${PORT} \
1417 && ${MAKE} -s $* PREFIX=${LOCAL} PORTSWRK=${PORTSWRK}
1418 ifndef DRY_RUN
1419 @echo $@ done
1420 endif
1421 else
1422 @echo "ERROR: no PORT defined"; \
1423 echo "HINT: use 'make cmd PORT=name'"; \
1424 exit 1;
1425 endif
1426
1427 # multiple ports sub-commands
1428 ports_%: check_user
1429 @cd ${PORTSDIR} \
1430 && ${MAKE} -s $* PREFIX=${LOCAL} PORTSWRK=${PORTSWRK}
1431 @echo $@ done
1432
1433
1434 ########
1435 # macros
1436 ########
1437 define is_alive
1438 if [ \! -f ${1} ]; then \
1439 ALIVE='NO'; \
1440 else \
1441 if kill -0 `head -n 1 ${1}` 2>/dev/null; then \
1442 ALIVE='YES'; \
1443 else \
1444 rm -f ${1}; \
1445 ALIVE='NO'; \
1446 fi; \
1447 fi
1448 endef
1449
1450 define wait_stop
1451 TRYMAX=`test -z "${3}" && echo 10 || echo ${3}`; \
1452 TRYCUR=1; \
1453 STOPPED='NO'; \
1454 echo -n "Waiting for ${2} stopped, tries: $${TRYCUR}"; \
1455 ${call is_alive,${1}}; \
1456 while [ "$${ALIVE}" = "YES" -a $$(($${TRYCUR})) -lt $$(($${TRYMAX})) ]; do \
1457 sleep 1; \
1458 TRYCUR=$$(($${TRYCUR}+1)); \
1459 echo -n " $${TRYCUR}"; \
1460 ${call is_alive,${1}}; \
1461 done; \
1462 echo ""; \
1463 if [ "$${ALIVE}" = "NO" ]; then \
1464 STOPPED='YES'; \
1465 fi
1466 endef
1467
1468 ifeq (${USE_MTT},YES)
1469 define rewrite
1470 $(foreach R, ${REWRITE}, MTT_${R}="${${R}}") \
1471 ${CORE_SRC}/services/mttbfr > ${PROJ_TMP}/${PROJECT}/mtt.conf && \
1472 ${CORE_SRC}/services/mttcomp < ${1} | \
1473 ${LOCAL}/bin/mtt -b ${PROJ_TMP}/${PROJECT}/mtt.conf - ${2} \
1474 && echo "created ${2} (mtt)"
1475 endef
1476 else
1477 define rewrite
1478 $(foreach R, ${REWRITE}, ${R}="${${R}}") \
1479 perl -pe 's/@([A-Z_]+)@/$$ENV{$$1}/ge' < ${1} > ${2} \
1480 && echo "created ${2} (rewrite)"
1481 endef
1482 endif
1483
1484 define rewrite_skel
1485 NAME=${NAME} \
1486 LOCAL=@LOCAL@ \
1487 CORE_USR=@CORE_USR@ \
1488 PROJ_USR=@PROJ_USR@ \
1489 PROJECT_VAR=@PROJECT_VAR@ \
1490 perl -pe 's/@([A-Z_]+)@/$$ENV{$$1}/ge' < ${1} > ${2} \
1491 && echo "created ${2}"
1492 endef
1493
1494 # rewrites values
1495 PREFIX = ${LOCAL}
1496 ROOT_LOG = ${ROOT_DIR}/var/log
1497 PGSQL_REDIRECT = ${shell perl -e 'print lc("${PGSQL_LOGGING}") eq "yes" && "on" || "off"'}
1498 ifdef PROJECT
1499 PROJECT_USR = ${PROJ_USR}/${PROJECT}
1500 PROJECT_TMP = ${PROJ_TMP}/${PROJECT}
1501 PROJECT_VAR = ${PROJ_VAR}/${PROJECT}
1502 PROJECT_LOG = ${PROJ_VAR}/${PROJECT}/log
1503 PROJECT_RUN = ${PROJ_VAR}/${PROJECT}/run
1504 endif
1505
1506 # rewrites definitions
1507 REWRITE += \
1508 AUTH_COOKIE \
1509 AUTH_MEMCACHED_BUSY_LOCK \
1510 AUTH_MEMCACHED_ENABLE \
1511 AUTH_MEMCACHED_SERVERS \
1512 BASE_HOST \
1513 BASE_PASSWD \
1514 BASE_USER \
1515 BINARY \
1516 CASCADE \
1517 COMP_CACHE_ENABLED \
1518 COMP_TIMINGS_DISABLE \
1519 365 ahitrov COMPOSITE \
1520 8 ahitrov@rambler.ru CONF \
1521 CONTENIDO_VERSION \
1522 CONVERT \
1523 CORE_COMP \
1524 CORE_SRC \
1525 CORE_VERSION \
1526 CORE_USR \
1527 CRONOLOG_ENABLE \
1528 CRONOLOG_FORMAT \
1529 CROSSLINKS \
1530 DB_TYPE \
1531 DEBUG_FORMAT \
1532 DEBUG_MIN_LEVEL \
1533 DEBUG_MAX_LEVEL \
1534 DEBUG_STACK_TRACE \
1535 DEBUG \
1536 DEBUG_CORE \
1537 DEBUG_SQL \
1538 DEBUG_WORKTIME \
1539 DEFAULT_ESCAPE_FLAGS \
1540 DEFAULT_HANDLER \
1541 DEVELOPMENT \
1542 740 ahitrov EMAIL_ENABLE \
1543 EMAIL_MAILER \
1544 EMAIL_FROM \
1545 EMAIL_LOGIN \
1546 EMAIL_PASSWORD \
1547 EMAIL_SMTP_SERVER \
1548 EMAIL_SMTP_HELLO \
1549 EMAIL_SMTP_TIMEOUT \
1550 EMAIL_SMTP_SSL \
1551 EMAIL_SMTP_PORT \
1552 8 ahitrov@rambler.ru ERROR_MODE \
1553 FILES \
1554 203 ahitrov FILE_WEB_STORAGE \
1555 8 ahitrov@rambler.ru HOSTNAME \
1556 HTTPD_DOCS \
1557 HTTPD_ELOG_LEVEL \
1558 805 ahitrov HTTPD_HOST \
1559 8 ahitrov@rambler.ru HTTPD_PORT \
1560 805 ahitrov HTTPD_LISTEN \
1561 8 ahitrov@rambler.ru HTTPD_SERVER \
1562 IMAGES \
1563 LISTEN_BACK_LOG \
1564 LOCAL \
1565 LOCALE \
1566 LOGGER \
1567 MASON_CACHE_ENABLED \
1568 MASON_COMP \
1569 MASON_MEMCACHED_BACKEND \
1570 MASON_MEMCACHED_DEBUG \
1571 MASON_MEMCACHED_ENABLED \
1572 MASON_MEMCACHED_NAMESPACE \
1573 MASON_MEMCACHED_SERVERS \
1574 MASTER_BASE_HOST \
1575 MASTER_BASE_NAME \
1576 MASTER_BASE_PASSWD \
1577 MASTER_BASE_PORT \
1578 MASTER_BASE_USER \
1579 MAX_CLIENTS \
1580 MAX_PROCESS_SIZE \
1581 MAX_REQUESTS_PER_CHILD \
1582 MAX_SPARE_SERVERS \
1583 MEMCACHED_BACKEND \
1584 MEMCACHED_DELAYED \
1585 MEMCACHED_ENABLE \
1586 MEMCACHED_ENABLE_COMPRESS \
1587 MEMCACHED_SELECT_TIMEOUT \
1588 MEMCACHED_SERVERS \
1589 MEMCACHED_SET_MODE \
1590 MIN_SPARE_SERVERS \
1591 MODULES \
1592 MULTIDOMAIN \
1593 OPTIONS_EXPIRE \
1594 PERL_LEVEL \
1595 PERL_LIB \
1596 PERSISTENT_CONN \
1597 PGSQL_BASE \
1598 PGSQL_CLIENT_ENCODING \
1599 PGSQL_PORT \
1600 PGSQL_REAL_PREPARE \
1601 PGSQL_REDIRECT \
1602 PGSQL_CLIENT_ENCODING \
1603 PGSQL_ENCODE_DATA \
1604 PGSQL_DECODE_DATA \
1605 PGSQL_ENABLE_UTF \
1606 217 ahitrov SERIALIZE_WITH \
1607 8 ahitrov@rambler.ru PLUG_SRC \
1608 PLUGINS \
1609 PLUGIN_COMP \
1610 PREAMBLE_HANDLER \
1611 PREAMBLE_HANDLER_PATH \
1612 PREFIX \
1613 PRELOADS \
1614 PREVIEW \
1615 PROFILING_DBI \
1616 PROJECT \
1617 PROJECT_HOME \
1618 PROJECT_LC \
1619 PROJECT_NAME \
1620 PROJECT_LOG \
1621 PROJECT_RUN \
1622 PROJECT_TMP \
1623 PROJECT_USR \
1624 PROJECT_VAR \
1625 PROJECT_VERSION \
1626 PROJ_SRC \
1627 PROJ_USR \
1628 ROOT_LOG \
1629 READONLY \
1630 RSYSLOG_ENABLE \
1631 RSYSLOG_HOST \
1632 SERVER_ADMIN \
1633 SESSIONS \
1634 SPARE_REAPER_DELAY \
1635 SPARE_REAPER_DELAY_FAKEMOD \
1636 START_SERVERS \
1637 STATIC_SOURCE_ENABLE \
1638 STATIC_SOURCE_TOUCH_FILE \
1639 STORE_METHOD \
1640 650 ahitrov VCS_TYPE \
1641 8 ahitrov@rambler.ru
1642 #TODO: ElTexto compatibility only
1643 REWRITE += \
1644 COMMENTS_ON_PAGE \
1645 ELTEXTO_VERSION \
1646 MEMCACHED_EXPIRE \
1647 SYNC_WITH_GROUPS \
1648 TEXTS_ON_PAGE \
1649 TEXT_IDS_IN_CACHE \
1650
1651 #TODO: Rate compatibility only
1652 REWRITE += \
1653 RATE_CLASSES \
1654 RATE_COOKIE \
1655
1656 #TODO: Search plugin compatibility only
1657 REWRITE += \
1658 SEARCH_SERVER \
1659
1660 #TODO: Util Proxy image
1661 REWRITE += \
1662 PROXY_IMAGE_LOCATION \
1663 PROXY_IMAGE_SECRET \
1664