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 #FREESIDE_DOCUMENT_ROOT = /srv/www/htdocs/freeside
27 #deb, redhat, mandrake, suse, others?
28 INIT_FILE = /etc/init.d/freeside
30 #INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
33 HTTPD_RESTART = /etc/init.d/apache restart
35 #HTTPD_RESTART = /etc/init.d/httpd restart
37 #HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop; sleep 1; /usr/local/etc/rc.d/apache.sh start
39 #HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 1; /usr/sbin/httpd -u -DSSL
41 FREESIDE_RESTART = ${INIT_FILE} restart
43 #deb, redhat, mandrake, suse, others?
48 #edit the stuff below to have the daemons start
52 #eventually this shouldn't be needed
55 SELFSERVICE_USER = fs_selfservice
56 SELFSERVICE_MACHINES = localhost
57 # SELFSERVICE_MACHINES = web1.example.com web2.example.com
62 FREESIDE_CONF = /usr/local/etc/freeside
65 TAG=freeside_1_4_2beta1
68 @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
70 @echo " perl-modules install-perl-modules"
71 @echo " install deploy"
72 @echo " create-database"
75 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
77 cp -pr httemplate aspdocs
79 s/%%%VERSION%%%/${VERSION}/g;\
84 masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
86 cp -pr httemplate masondocs
91 s/%%%VERSION%%%/${VERSION}/g;\
92 " masondocs/index.html
95 alldocs: aspdocs masondocs
101 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
102 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
103 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
104 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
105 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
107 [ -e DONT_REBUILD_DOCS ] || bin/pod2x
110 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
111 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
112 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
113 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
114 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
118 [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
119 cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
120 [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
121 [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
122 [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
123 [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true
124 [ "${TEMPLATE}" = "mason" ] && \
126 s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
127 " ${MASON_HANDLER} || true
128 [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
129 [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true
133 [ -e Makefile ] || perl Makefile.PL; \
136 install-perl-modules: perl-modules
138 make install UNINST=1
141 #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
142 install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
144 s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
145 s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
146 s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
147 s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
150 install: install-perl-modules install-docs install-init
157 perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
159 create-config: install-perl-modules
160 [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
161 install -d -o freeside ${FREESIDE_CONF}
163 touch ${FREESIDE_CONF}/secrets
164 chown freeside ${FREESIDE_CONF}/secrets
165 chmod 600 ${FREESIDE_CONF}/secrets
167 echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
168 chmod 600 ${FREESIDE_CONF}/secrets
169 chown freeside ${FREESIDE_CONF}/secrets
171 mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
172 rm -rf conf/registries #old dirs just won't go away
173 #cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
174 cp `ls -d conf/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}"
175 chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
177 mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
178 chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
180 mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
181 chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
183 mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
184 chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
187 rm -rf aspdocs masondocs
191 #these are probably only useful if you're me...
193 upload-docs: forcehtmlman
194 ssh pouncequick.420.am rm -rf /var/www/www.sisd.com/freeside/docs
195 scp -pr httemplate/docs pouncequick.420.am:/var/www/www.sisd.com/freeside/docs
197 #release: upload-docs update-webdemo
199 cd /home/ivan/freeside1.4
204 cvs export -r ${TAG} -d freeside-${VERSION} freeside
205 tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION}
207 scp freeside-${VERSION}.tar.gz ivan@pouncequick.420.am:/var/www/sisd.420.am/freeside/
208 mv freeside-${VERSION} freeside-${VERSION}.tar.gz ..
211 ssh ivan@pouncequick.420.am '( cd freeside; cvs update -r FREESIDE_1_4_BRANCH -d -P )'
212 #ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make clean; make deploy )'
213 ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make deploy )'