3 DATASOURCE = DBI:Pg:dbname=freeside
4 #DATASOURCE=DBI:mysql:freeside
12 ASP_GLOBAL = /usr/local/etc/freeside/asp-global
13 MASON_HANDLER = /usr/local/etc/freeside/handler.pl
14 MASONDATA = /usr/local/etc/freeside/masondata
17 FREESIDE_DOCUMENT_ROOT = /var/www/freeside
19 #FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside
21 #FREESIDE_DOCUMENT_ROOT = /usr/local/www/data/freeside
23 #FREESIDE_DOCUMENT_ROOT = /var/www/htdocs/freeside
25 #deb, redhat, mandrake, others?
26 INIT_FILE = /etc/init.d/freeside
28 #INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
31 HTTPD_RESTART = /etc/init.d/apache restart
33 #HTTPD_RESTART = /etc/init.d/httpd restart
35 #HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop; sleep 1; /usr/local/etc/rc.d/apache.sh start
37 #HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 1; /usr/sbin/httpd -u -DSSL
39 FREESIDE_RESTART = ${INIT_FILE} restart
41 #deb, redhat, mandrake, others?
46 #edit the stuff below to have the daemons start
50 #eventually this shouldn't be needed
53 SELFSERVICE_USER = fs_selfservice
54 SELFSERVICE_MACHINE = localhost
59 FREESIDE_CONF = /usr/local/etc/freeside
62 TAG=freeside_1_4_2beta1
65 @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
67 @echo " perl-modules install-perl-modules"
68 @echo " install deploy"
69 @echo " create-database"
72 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
74 cp -pr httemplate aspdocs
76 s/%%%VERSION%%%/${VERSION}/g;\
81 masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
83 cp -pr httemplate masondocs
88 s/%%%VERSION%%%/${VERSION}/g;\
89 " masondocs/index.html
92 alldocs: aspdocs masondocs
98 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
99 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
100 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
101 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
102 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
104 [ -e DONT_REBUILD_DOCS ] || bin/pod2x
107 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
108 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
109 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
110 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
111 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
115 [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
116 cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
117 [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
118 [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
119 [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
120 [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true
121 [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
122 [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true
126 [ -e Makefile ] || perl Makefile.PL; \
129 install-perl-modules: perl-modules
131 make install UNINST=1
134 #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
135 install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
137 s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
138 s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
139 s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
140 s/%%%SELFSERVICE_MACHINE%%%/${SELFSERVICE_MACHINE}/g;\
143 install: install-perl-modules install-docs install-init
150 perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
152 create-config: install-perl-modules
153 [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
154 mkdir ${FREESIDE_CONF}
155 chown freeside ${FREESIDE_CONF}
157 touch ${FREESIDE_CONF}/secrets
158 chown freeside ${FREESIDE_CONF}/secrets
159 chmod 600 ${FREESIDE_CONF}/secrets
161 echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
162 chmod 600 ${FREESIDE_CONF}/secrets
163 chown freeside ${FREESIDE_CONF}/secrets
165 mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
166 rm -rf conf/registries #old dirs just won't go away
167 cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
168 chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
170 mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
171 chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
173 mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
174 chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
176 mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
177 chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
180 rm -rf aspdocs masondocs
184 #these are probably only useful if you're me...
186 upload-docs: forcehtmlman
187 ssh cleanwhisker.420.am rm -rf /var/www/www.sisd.com/freeside/docs
188 scp -pr httemplate/docs cleanwhisker.420.am:/var/www/www.sisd.com/freeside/docs
190 #release: upload-docs update-webdemo
192 cd /home/ivan/freeside1.4
197 cvs export -r ${TAG} -d freeside-${VERSION} freeside
198 tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION}
200 scp freeside-${VERSION}.tar.gz ivan@cleanwhisker.420.am:/var/www/sisd.420.am/freeside/
201 mv freeside-${VERSION} freeside-${VERSION}.tar.gz ..
204 ssh ivan@pouncequick.420.am '( cd freeside; cvs update -r FREESIDE_1_4_BRANCH -d -P )'
205 #ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make clean; make deploy )'
206 ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make deploy )'