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 = www.example.com
61 # SELFSERVICE_MACHINES = web1.example.com web2.example.com
63 #user with sudo access on SELFSERVICE_MACHINES for automated self-service
65 SELFSERVICE_INSTALL_USER = ivan
66 SELFSERVICE_INSTALL_USERADD = useradd
67 #SELFSERVICE_INSTALL_USERADD = "pw useradd"
72 FREESIDE_CONF = /usr/local/etc/freeside
75 TAG=freeside_1_4_2beta1
78 @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
80 @echo " perl-modules install-perl-modules"
81 @echo " install deploy"
82 @echo " create-database"
85 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
87 cp -pr httemplate aspdocs
89 s/%%%VERSION%%%/${VERSION}/g;\
94 masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
96 cp -pr httemplate masondocs
101 s/%%%VERSION%%%/${VERSION}/g;\
102 " masondocs/index.html
105 alldocs: aspdocs masondocs
111 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
112 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
113 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
114 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
115 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
117 [ -e DONT_REBUILD_DOCS ] || bin/pod2x
120 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
121 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
122 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
123 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
124 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
128 [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
129 cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
130 [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
131 [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
132 [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
133 [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true
134 [ "${TEMPLATE}" = "mason" ] && \
136 s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
137 " ${MASON_HANDLER} || true
138 [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
139 [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true
143 [ -e Makefile ] || perl Makefile.PL; \
146 install-perl-modules: perl-modules
148 make install UNINST=1
151 #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
152 install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
154 s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
155 s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
156 s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
157 s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
161 [ -e ~freeside/.ssh/id_dsa.pub ] || su -c 'ssh-keygen -t dsa' - freeside
162 for MACHINE in ${SELFSERVICE_MACHINES}; do \
163 scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@$$MACHINE:.
164 ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make"
165 ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install"
166 scp ~freeside/.ssh/id_dsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:.
167 ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo $SELFSERVICE_INSTALL_USERADD freeside; sudo install -D -o freeside -m 600 ./id_dsa.pub ~freeside/.ssh/authorized_keys"
169 install: install-perl-modules install-docs install-init
176 perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
178 create-config: install-perl-modules
179 [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
180 install -d -o freeside ${FREESIDE_CONF}
182 touch ${FREESIDE_CONF}/secrets
183 chown freeside ${FREESIDE_CONF}/secrets
184 chmod 600 ${FREESIDE_CONF}/secrets
186 echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
187 chmod 600 ${FREESIDE_CONF}/secrets
188 chown freeside ${FREESIDE_CONF}/secrets
190 mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
191 rm -rf conf/registries #old dirs just won't go away
192 #cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
193 cp `ls -d conf/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}"
194 chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
196 mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
197 chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
199 mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
200 chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
202 mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
203 chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
206 rm -rf aspdocs masondocs
210 #these are probably only useful if you're me...
212 upload-docs: forcehtmlman
213 ssh pouncequick.420.am rm -rf /var/www/www.sisd.com/freeside/docs
214 scp -pr httemplate/docs pouncequick.420.am:/var/www/www.sisd.com/freeside/docs
216 #release: upload-docs update-webdemo
218 cd /home/ivan/freeside1.4
223 cvs export -r ${TAG} -d freeside-${VERSION} freeside
224 tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION}
226 scp freeside-${VERSION}.tar.gz ivan@pouncequick.420.am:/var/www/sisd.420.am/freeside/
227 mv freeside-${VERSION} freeside-${VERSION}.tar.gz ..
230 ssh ivan@pouncequick.420.am '( cd freeside; cvs update -r FREESIDE_1_4_BRANCH -d -P )'
231 #ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make clean; make deploy )'
232 ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make deploy )'