3 DATASOURCE = DBI:Pg:host=localhost;dbname=freeside
4 #DATASOURCE=DBI:mysql:freeside
12 ASP_GLOBAL = /usr/local/etc/freeside/asp-global
14 FREESIDE_DOCUMENT_ROOT = /var/www/freeside
16 INIT_FILE = /etc/init.d/freeside
18 HTTPD_RESTART = /etc/init.d/apache restart
19 FREESIDE_RESTART = /etc/init.d/freeside restart
23 #edit the stuff below to have the daemons start
27 #eventually this shouldn't be needed
31 PASSWD_MACHINE = localhost
34 SIGNUP_MACHINE = localhost
41 FREESIDE_CONF = /usr/local/etc/freeside
47 @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
49 @echo " perl-modules install-perl-modules"
50 @echo " install deploy"
51 @echo " create-database"
54 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
56 cp -pr httemplate aspdocs
59 masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
61 cp -pr httemplate masondocs
67 alldocs: aspdocs masondocs
73 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
74 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
75 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
76 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
77 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
78 [ -e DONT_REBUILD_DOCS ] || bin/pod2x
81 [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
82 [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
83 [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
84 [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
85 [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
89 [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
90 cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
91 [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
92 [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
93 [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
97 [ -e Makefile ] || perl Makefile.PL; \
100 install-perl-modules: perl-modules
102 make install UNINST=1
105 #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
106 install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
108 s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
109 s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
110 s/%%%PASSWD_USER%%%/${PASSWD_USER}/g;\
111 s/%%%PASSWD_MACHINE%%%/${PASSWD_MACHINE}/g;\
112 s/%%%SIGNUP_USER%%%/${SIGNUP_USER}/g;\
113 s/%%%SIGNUP_MACHINE%%%/${SIGNUP_MACHINE}/g;\
114 s/%%%SIGNUP_AGENTNUM%%%/${SIGNUP_AGENTNUM}/g;\
115 s/%%%SIGNUP_REFNUM%%%/${SIGNUP_REFNUM}/g;\
118 install: install-perl-modules install-docs install-init
125 perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
127 create-config: install-perl-modules
128 [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
129 mkdir ${FREESIDE_CONF}
130 chown freeside ${FREESIDE_CONF}
132 touch ${FREESIDE_CONF}/secrets
133 chown freeside ${FREESIDE_CONF}/secrets
134 chmod 600 ${FREESIDE_CONF}/secrets
136 echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
137 chmod 600 ${FREESIDE_CONF}/secrets
138 chown freeside ${FREESIDE_CONF}/secrets
140 mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
141 cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
142 chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
144 mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
145 chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
147 mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
148 chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
150 mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
151 chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
154 rm -rf aspdocs masondocs
158 #these are probably only useful if you're me...
160 upload-docs: forcehtmlman
161 ssh cleanwhisker.420.am rm -rf /var/www/www.sisd.com/freeside/devdocs
162 scp -pr httemplate/docs cleanwhisker.420.am:/var/www/www.sisd.com/freeside/devdocs
165 cd /home/ivan/freeside_current
170 cvs export -r ${TAG} -d freeside-${VERSION} freeside
171 tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION}
173 scp freeside-${VERSION}.tar.gz ivan@cleanwhisker.420.am:/var/www/sisd.420.am/freeside/
174 mv freeside-${VERSION} freeside-${VERSION}.tar.gz ..
177 ssh ivan@pouncequick.420.am '( cd freeside; cvs update -d -P )'
178 #ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make clean; make deploy )'
179 ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make deploy )'