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

Небольшая справка по веткам

cnddist – контейнер, в котором хранятся все дистрибутивы всех библиотек и программных пакетов, которые использовались при построении различных версий Contenido. Если какой-то библиотеки в данном хранилище нет, инсталлятор сделает попытку "подтянуть" ее с веба (например, с CPAN). Если библиотека слишком старая, есть очень большая вероятность, что ее там уже нет. Поэтому мы храним весь хлам от всех сборок. Если какой-то дистрибутив вдруг отсутствует в cnddist - напишите нам, мы положим его туда.

koi8 – отмирающая ветка, чей код, выдача и все внутренние библиотеки заточены на кодировку KOI8-R. Вносятся только те дополнения, которые касаются внешнего вида и функционала админки, баги ядра, обязательные обновления портов и мелочи, которые легко скопипастить. В дальнейшем планируется полная остановка поддержки по данной ветке.

utf8 – актуальная ветка, заточенная под UTF-8.

Внутри каждой ветки: core – исходники ядра; install – скрипт установки инсталляции; plugins – плагины; samples – "готовые к употреблению" проекты, которые можно поставить, запустить и посмотреть, как они работают.