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
18 #redhat, fedora, mandrake
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 #FREESIDE_DOCUMENT_ROOT = /usr/local/apache/htdocs/freeside
29 #deb, redhat, fedora, mandrake, suse, others?
30 INIT_FILE = /etc/init.d/freeside
32 #INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
35 HTTPD_RESTART = /etc/init.d/apache restart
36 #redhat, fedora, mandrake
37 #HTTPD_RESTART = /etc/init.d/httpd restart
39 #HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop; sleep 1; /usr/local/etc/rc.d/apache.sh start
41 #HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 1; /usr/sbin/httpd -u -DSSL
43 #HTTPD_RESTART = /usr/local/apache/bin/apachectl restart
45 FREESIDE_RESTART = ${INIT_FILE} restart
47 #deb, redhat, fedora, mandrake, suse, others?
52 #edit the stuff below to have the daemons start
56 #eventually this shouldn't be needed
59 SELFSERVICE_USER = fs_selfservice
60 SELFSERVICE_MACHINES = localhost
61 # SELFSERVICE_MACHINES = web1.example.com web2.example.com
66 FREESIDE_CONF = /usr/local/etc/freeside
69 TAG=freeside_1_4_2beta1
72 @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
74 @echo " perl-modules install-perl-modules"
75 @echo " install deploy"
76 @echo " create-database"
79 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
81 cp -pr httemplate aspdocs
83 s/%%%VERSION%%%/${VERSION}/g;\
88 masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
90 cp -pr httemplate masondocs
95 s/%%%VERSION%%%/${VERSION}/g;\
96 " masondocs/index.html
99 alldocs: aspdocs masondocs
105 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
106 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
107 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
108 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
109 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
111 [ -e DONT_REBUILD_DOCS ] || bin/pod2x
114 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
115 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
116 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
117 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
118 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
122 [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
123 cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
124 [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
125 [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
126 [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
127 [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true
128 [ "${TEMPLATE}" = "mason" ] && \
130 s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
131 " ${MASON_HANDLER} || true
132 [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
133 [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true
137 [ -e Makefile ] || perl Makefile.PL; \
140 install-perl-modules: perl-modules
142 make install UNINST=1
145 #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
146 install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
148 s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
149 s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
150 s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
151 s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
154 install: install-perl-modules install-docs install-init
161 perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
163 create-config: install-perl-modules
164 [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
165 install -d -o freeside ${FREESIDE_CONF}
167 touch ${FREESIDE_CONF}/secrets
168 chown freeside ${FREESIDE_CONF}/secrets
169 chmod 600 ${FREESIDE_CONF}/secrets
171 echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
172 chmod 600 ${FREESIDE_CONF}/secrets
173 chown freeside ${FREESIDE_CONF}/secrets
175 mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
176 rm -rf conf/registries #old dirs just won't go away
177 #cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
178 cp `ls -d conf/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}"
179 chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
181 mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
182 chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
184 mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
185 chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
187 mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
188 chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
191 rm -rf aspdocs masondocs
195 #these are probably only useful if you're me...
197 upload-docs: forcehtmlman
198 ssh pouncequick.420.am rm -rf /var/www/www.sisd.com/freeside/docs
199 scp -pr httemplate/docs pouncequick.420.am:/var/www/www.sisd.com/freeside/docs
201 #release: upload-docs update-webdemo
203 cd /home/ivan/freeside1.4
208 cvs export -r ${TAG} -d freeside-${VERSION} freeside
209 tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION}
211 scp freeside-${VERSION}.tar.gz ivan@pouncequick.420.am:/var/www/sisd.420.am/freeside/
212 mv freeside-${VERSION} freeside-${VERSION}.tar.gz ..
215 ssh ivan@pouncequick.420.am '( cd freeside; cvs update -r FREESIDE_1_4_BRANCH -d -P )'
216 #ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make clean; make deploy )'
217 ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make deploy )'