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_MACHINES = localhost
55 # SELFSERVICE_MACHINES = web1.example.com web2.example.com
60 FREESIDE_CONF = /usr/local/etc/freeside
63 TAG=freeside_1_5_0pre4
66 @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
68 @echo " perl-modules install-perl-modules"
69 @echo " install deploy"
70 @echo " create-database"
73 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
75 cp -pr httemplate aspdocs
77 s/%%%VERSION%%%/${VERSION}/g;\
82 masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
84 cp -pr httemplate masondocs
89 s/%%%VERSION%%%/${VERSION}/g;\
90 " masondocs/index.html
93 alldocs: aspdocs masondocs
99 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
100 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
101 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
102 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
103 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
105 [ -e DONT_REBUILD_DOCS ] || bin/pod2x
108 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
109 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
110 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
111 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
112 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
116 [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
117 cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
118 [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
119 [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
120 [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
121 [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true
122 [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
123 [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true
127 [ -e Makefile ] || perl Makefile.PL; \
130 install-perl-modules: perl-modules
132 make install UNINST=1
135 #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
136 install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
138 s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
139 s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
140 s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
141 s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
144 install: install-perl-modules install-docs install-init
151 perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
153 create-config: install-perl-modules
154 [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
155 install -d -o 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 cp `ls -d conf/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}"
169 chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
171 mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
172 chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
174 mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
175 chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
177 mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
178 chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
181 rm -rf aspdocs masondocs
185 #these are probably only useful if you're me...
187 upload-docs: forcehtmlman
188 ssh cleanwhisker.420.am rm -rf /var/www/www.sisd.com/freeside/devdocs
189 scp -pr httemplate/docs cleanwhisker.420.am:/var/www/www.sisd.com/freeside/devdocs
192 cd /home/ivan/freeside
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 -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 )'