1 |
8 |
ahitrov@rambler.ru |
############################################################################## |
2 |
|
|
# $HeadURL$ |
3 |
|
|
# $Id$ |
4 |
|
|
# |
5 |
|
|
# Project default & calculated settings |
6 |
|
|
############################################################################### |
7 |
|
|
|
8 |
|
|
|
9 |
|
|
# it must! |
10 |
|
|
PROJECT_NAME ?= $(error "ERROR: PROJECT_NAME not defined") |
11 |
|
|
|
12 |
|
|
ifeq (${DB_TYPE},NONE) |
13 |
|
|
PGSQL_PORT = |
14 |
|
|
PGSQL_BASE = |
15 |
|
|
|
16 |
|
|
BASE_HOST = |
17 |
|
|
BASE_USER = |
18 |
|
|
BASE_PASSWD = |
19 |
|
|
else |
20 |
|
|
PGSQL_PORT ?= $(error "ERROR: PGSQL_PORT not defined") |
21 |
|
|
PGSQL_BASE ?= $(error "ERROR: PGSQL_BASE not defined") |
22 |
|
|
|
23 |
|
|
BASE_HOST ?= $(error "ERROR: BASE_HOST not defined") |
24 |
|
|
BASE_USER ?= $(error "ERROR: BASE_USER not defined") |
25 |
|
|
BASE_PASSWD ?= $(error "ERROR: BASE_PASSWD not defined") |
26 |
|
|
endif |
27 |
|
|
|
28 |
|
|
# additional DB for replications |
29 |
|
|
MASTER_BASE_HOST ?= ${BASE_HOST} |
30 |
|
|
MASTER_BASE_NAME ?= ${PGSQL_BASE} |
31 |
|
|
MASTER_BASE_PASSWD ?= ${BASE_PASSWD} |
32 |
|
|
MASTER_BASE_PORT ?= ${PGSQL_PORT} |
33 |
|
|
MASTER_BASE_USER ?= ${BASE_USER} |
34 |
|
|
|
35 |
|
|
# additional ports if any |
36 |
|
|
PROJECT_REQUIRED ?= |
37 |
|
|
|
38 |
|
|
# defaults |
39 |
|
|
PRELOADS ?= |
40 |
|
|
PERSISTENT_CONN ?= YES |
41 |
|
|
PGSQL_REAL_PREPARE ?= YES |
42 |
|
|
|
43 |
|
|
MEMCACHED_BACKEND ?= Cache::Memcached |
44 |
|
|
MEMCACHED_ENABLE ?= NO |
45 |
|
|
MEMCACHED_SELECT_TIMEOUT ?= 0.5 |
46 |
|
|
MEMCACHED_SERVERS ?= |
47 |
|
|
MEMCACHED_ENABLE_COMPRESS ?= YES |
48 |
|
|
MEMCACHED_DELAYED ?= NO |
49 |
|
|
MEMCACHED_SET_MODE ?= SET |
50 |
|
|
|
51 |
|
|
STORE_METHOD ?= TOAST |
52 |
|
|
CASCADE ?= YES |
53 |
|
|
|
54 |
|
|
# TODO drop PREVIEW! |
55 |
|
|
PREVIEW ?= 150x150 |
56 |
|
|
AUTH_COOKIE ?= rsid |
57 |
|
|
|
58 |
|
|
DEFAULT_HANDLER ?= HTML::Mason::ApacheHandler |
59 |
|
|
DEFAULT_ESCAPE_FLAGS ?= |
60 |
|
|
|
61 |
|
|
# main preamble hanler |
62 |
|
|
PREAMBLE_HANDLER ?= |
63 |
|
|
# extra preamble handlers relative path |
64 |
|
|
PREAMBLE_HANDLER_PATH ?= |
65 |
|
|
|
66 |
|
|
RSYNC_DIRS ?= |
67 |
|
|
|
68 |
|
|
# apache pool |
69 |
|
|
${PROJECT_LC}_START_SERVERS ?= 1 |
70 |
|
|
START_SERVERS ?= ${${PROJECT_LC}_START_SERVERS} |
71 |
|
|
|
72 |
|
|
${PROJECT_LC}_MAX_CLIENTS ?= 3 |
73 |
|
|
MAX_CLIENTS ?= ${${PROJECT_LC}_MAX_CLIENTS} |
74 |
|
|
|
75 |
|
|
${PROJECT_LC}_MIN_SPARE_SERVERS ?= 1 |
76 |
|
|
MIN_SPARE_SERVERS ?= ${${PROJECT_LC}_MIN_SPARE_SERVERS} |
77 |
|
|
|
78 |
|
|
${PROJECT_LC}_MAX_SPARE_SERVERS ?= ${shell perl -e 'print ${MIN_SPARE_SERVERS}+1'} |
79 |
|
|
MAX_SPARE_SERVERS ?= ${${PROJECT_LC}_MAX_SPARE_SERVERS} |
80 |
|
|
|
81 |
|
|
${PROJECT_LC}_SPARE_REAPER_DELAY ?= 0 |
82 |
|
|
SPARE_REAPER_DELAY ?= ${${PROJECT_LC}_SPARE_REAPER_DELAY} |
83 |
|
|
|
84 |
|
|
SPARE_REAPER_DELAY_FAKEMOD ?= ${shell perl -e 'print ${SPARE_REAPER_DELAY} ? "http_core" : "nonexistent"'} |
85 |
|
|
|
86 |
|
|
# logging |
87 |
|
|
${PROJECT_LC}_HTTPD_ELOG_LEVEL ?= info |
88 |
|
|
HTTPD_ELOG_LEVEL ?= ${${PROJECT_LC}_HTTPD_ELOG_LEVEL} |
89 |
|
|
|
90 |
|
|
# kinds of limits |
91 |
|
|
MAX_PROCESS_SIZE ?= 65535 |
92 |
|
|
LIMIT_CMD ?= /usr/bin/limits |
93 |
|
|
LIMIT_VMEMORY_HTTPD ?= 256m |
94 |
|
|
LISTEN_BACK_LOG_PERCHILD ?= 5 |
95 |
|
|
LISTEN_BACK_LOG ?= ${shell perl -e 'print ${LISTEN_BACK_LOG_PERCHILD}*${MAX_CLIENTS}'} |
96 |
|
|
|
97 |
|
|
# logging options |
98 |
|
|
RSYSLOG_ENABLE ?= NO |
99 |
|
|
RSYSLOG_HOST ?= lc.park.rambler.ru |
100 |
|
|
LOGGER ?= ${LOCAL}/bin/clogger |
101 |
|
|
|
102 |
|
|
# disable 'start' command |
103 |
|
|
DISABLE ?= ${${PROJECT_LC}_DISABLE} |
104 |
|
|
|
105 |
|
|
# cronolog options |
106 |
|
|
CRONOLOG_ENABLE ?= NO |
107 |
|
|
CRONOLOG_FORMAT ?= %Y/%m/%d/ |
108 |
|
|
|
109 |
|
|
# load cron tab |
110 |
|
|
CRON_ENABLE ?= NO |
111 |
|
|
|
112 |
|
|
LOCALE ?= ru_RU.UTF-8 |
113 |
|
|
|
114 |
|
|
# use mtt or old rewrite? |
115 |
|
|
USE_MTT ?= NO |
116 |
|
|
|
117 |
|
|
# use READONLY mode |
118 |
|
|
READONLY ?= NO |
119 |
|
|
|
120 |
|
|
# later captcha setting |
121 |
|
|
USE_CAPTCHA ?= NO |
122 |
|
|
ifeq (${USE_CAPTCHA},YES) |
123 |
|
|
CORE_REQUIRED += Authen-Captcha |
124 |
|
|
endif |
125 |
|
|
|
126 |
|
|
# Calculated |
127 |
|
|
MODULES = |
128 |
|
|
ifeq (${shell perl -e 'print lc "${DEVELOPMENT}"'},yes) |
129 |
|
|
MODULES = ${PROJ_SRC}/${PROJECT}/lib |
130 |
|
|
endif |
131 |
|
|
MODULES += ${PROJ_USR}/${PROJECT}/lib |
132 |
|
|
ifneq (${PLUGINS},) |
133 |
|
|
MODULES += ${addprefix ${PLUG_USR}/,${addsuffix /lib,${PLUGINS}}} |
134 |
|
|
endif |
135 |
|
|
MODULES += ${CORE_USR}/lib |
136 |
|
|
|
137 |
|
|
PLUGIN_COMP ?= ${shell perl -e 'print lc "${DEVELOPMENT}" eq "yes" ? "${PLUG_SRC}" : "${PLUG_USR}"'} |
138 |
|
|
MASON_COMP ?= ${shell perl -e 'print lc "${DEVELOPMENT}" eq "yes" ? "${PROJ_SRC}" : "${PROJ_USR}"'}/${PROJECT}/comps |
139 |
|
|
CORE_COMP ?= ${shell perl -e 'print lc "${DEVELOPMENT}" eq "yes" ? "${CORE_SRC}" : "${CORE_USR}"'}/comps |
140 |
|
|
RSYNC_ROOT ?= ${PROJ_USR}/${PROJECT}/comps |
141 |
|
|
BINARY ?= ${MASON_COMP}/binary |
142 |
|
|
ifdef FRONTENDS |
143 |
|
|
FILES ?= ${addprefix http://, ${addsuffix /dav/${PROJECT_LC}, ${FRONTENDS}}} |
144 |
|
|
else |
145 |
|
|
FILES ?= ${MASON_COMP}/files |
146 |
|
|
endif |
147 |
|
|
IMAGES ?= ${MASON_COMP}/images |
148 |
|
|
STATIC_SOURCE_TOUCH_FILE ?= ${MASON_COMP}/.touch |
149 |
|
|
|
150 |
203 |
ahitrov |
# Files are stored in NFS (=Common) or independently on each front (=Separate) |
151 |
|
|
FILE_WEB_STORAGE ?= Separate |
152 |
|
|
|
153 |
8 |
ahitrov@rambler.ru |
HTTPD_DOCS ?= ${MASON_COMP}/www |
154 |
|
|
CONF ?= ${PROJ_USR}/${PROJECT}/conf |
155 |
|
|
|
156 |
|
|
# pregenerate static |
157 |
|
|
PREGEN_GLOB ?= keeper project state |
158 |
|
|
PREGEN_LIST ?= |
159 |
|
|
|
160 |
|
|
# Mason caching |
161 |
|
|
MASON_CACHE_ENABLED ?= YES |
162 |
|
|
|
163 |
|
|
# Mason caching via Memcached |
164 |
|
|
MASON_MEMCACHED_BACKEND ?= ${MEMCACHED_BACKEND} |
165 |
|
|
MASON_MEMCACHED_DEBUG ?= NO |
166 |
|
|
MASON_MEMCACHED_ENABLED ?= NO |
167 |
|
|
MASON_MEMCACHED_NAMESPACE ?= ${PROJECT}:${PROJECT_VERSION} |
168 |
|
|
MASON_MEMCACHED_SERVERS ?= |
169 |
|
|
|
170 |
|
|
# overrides |
171 |
|
|
ifeq (${DB_TYPE},SINGLE) |
172 |
|
|
BASE_HOST = |
173 |
|
|
endif |
174 |
|
|
|
175 |
|
|
# psql wrappers |
176 |
|
|
PSQL ?= ${shell export PATH=${LOCAL}/pgsql/bin:$${PATH}; \ |
177 |
|
|
PSQL=`which psql`; \ |
178 |
|
|
if [ -x "$${PSQL}" ]; then \ |
179 |
|
|
echo $${PSQL}; \ |
180 |
|
|
else \ |
181 |
|
|
echo 'echo "ERROR: No executable psql found";'; \ |
182 |
|
|
echo 'echo "HINT: Add path to psql to your environment PATH";'; \ |
183 |
|
|
echo 'exit 1;'; \ |
184 |
|
|
fi;} |
185 |
|
|
|
186 |
|
|
PGDUMP ?= ${shell export PATH=${LOCAL}/pgsql/bin:$${PATH}; \ |
187 |
|
|
PGDUMP=`which pg_dump`; \ |
188 |
|
|
if [ -x "$${PGDUMP}" ]; then \ |
189 |
|
|
echo $${PGDUMP}; \ |
190 |
|
|
else \ |
191 |
|
|
echo 'echo "ERROR: No executable pg_dump found";'; \ |
192 |
|
|
echo 'echo "HINT: Add path to pg_dump to your environment PATH";'; \ |
193 |
|
|
echo 'exit 1;'; \ |
194 |
|
|
fi;} |
195 |
|
|
|
196 |
|
|
# rsync wrappers |
197 |
|
|
RSYNC = ${shell export PATH=${LOCAL}/bin:$${PATH}; \ |
198 |
|
|
RSYNC=`which rsync`; \ |
199 |
|
|
if [ -x "$${RSYNC}" ]; then \ |
200 |
|
|
echo $${RSYNC}; \ |
201 |
|
|
else \ |
202 |
|
|
echo 'echo "ERROR: No executable rsync found";'; \ |
203 |
|
|
echo 'echo "HINT: Add path to rsync to your environment PATH,";'; \ |
204 |
|
|
echo 'echo " or install with: make port_install PORT=rsync``";'; \ |
205 |
|
|
echo 'exit 1;'; \ |
206 |
|
|
fi;} |
207 |
|
|
|
208 |
|
|
CONVERT = ${shell export PATH=${LOCAL}/bin:$${PATH}; which convert} |
209 |
|
|
ifeq (${CONVERT},) |
210 |
|
|
${error ERROR: No executable convert found, you need to install ImageMagick first} |
211 |
|
|
endif |