X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=Makefile;h=f469d5fe8614cf4dd7ff29190ed4fefe73d7da53;hp=3362ca832c88793ca8fd3a5445d879853c97cf2a;hb=ef10539fa94bf35ef913bab50030a7f9242c2f9e;hpb=07efe8b9d3726845228538df46fcfa2610f89eb8 diff --git a/Makefile b/Makefile index 3362ca832..f469d5fe8 100644 --- a/Makefile +++ b/Makefile @@ -6,31 +6,47 @@ DATASOURCE = DBI:Pg:dbname=freeside DB_USER = freeside DB_PASSWORD= -TEMPLATE = asp -#TEMPLATE = mason +#TEMPLATE = asp +TEMPLATE = mason ASP_GLOBAL = /usr/local/etc/freeside/asp-global +MASON_HANDLER = /usr/local/etc/freeside/handler.pl +MASONDATA = /usr/local/etc/freeside/masondata -#deb, others? +#deb FREESIDE_DOCUMENT_ROOT = /var/www/freeside +#redhat, fedora, mandrake +#FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside #freebsd #FREESIDE_DOCUMENT_ROOT = /usr/local/www/data/freeside - -#deb, others? +#openbsd +#FREESIDE_DOCUMENT_ROOT = /var/www/htdocs/freeside +#suse +#FREESIDE_DOCUMENT_ROOT = /srv/www/htdocs/freeside +#apache +#FREESIDE_DOCUMENT_ROOT = /usr/local/apache/htdocs/freeside + +#deb, redhat, fedora, mandrake, suse, others? INIT_FILE = /etc/init.d/freeside #freebsd #INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh -#deb, others? +#deb, suse HTTPD_RESTART = /etc/init.d/apache restart +#redhat, fedora, mandrake +#HTTPD_RESTART = /etc/init.d/httpd restart #freebsd #HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop; sleep 1; /usr/local/etc/rc.d/apache.sh start +#openbsd +#HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 1; /usr/sbin/httpd -u -DSSL +#apache +#HTTPD_RESTART = /usr/local/apache/bin/apachectl restart FREESIDE_RESTART = ${INIT_FILE} restart -#deb, others? +#deb, redhat, fedora, mandrake, suse, others? INSTALLGROUP = root -#freebsd +#freebsd, openbsd #INSTALLGROUP = wheel #edit the stuff below to have the daemons start @@ -40,24 +56,29 @@ QUEUED_USER=fs_queue #eventually this shouldn't be needed FREESIDE_PATH = `pwd` -PASSWD_USER = nostart -PASSWD_MACHINE = localhost +SELFSERVICE_USER = fs_selfservice +# SELFSERVICE_MACHINES = www.example.com +# SELFSERVICE_MACHINES = web1.example.com web2.example.com -SIGNUP_USER = nostart -SIGNUP_MACHINE = localhost -SIGNUP_AGENTNUM = 2 -SIGNUP_REFNUM = 2 +#user with sudo access on SELFSERVICE_MACHINES for automated self-service +#installation. +SELFSERVICE_INSTALL_USER = ivan -SELFSERVICE_USER = nostart -SELFSERVICE_MACHINE = localhost +RT_ENABLED = 0 +#RT_ENABLED = 1 +RT_DOMAIN = example.com +RT_TIMEZONE = US/Pacific; +#RT_TIMEZONE = US/Eastern; #--- #not changable yet FREESIDE_CONF = /usr/local/etc/freeside +#rt/config.layout.in +RT_PATH = /opt/rt3 -VERSION=1.5.0pre1 -TAG=freeside_1_5_0pre1 +VERSION=1.5.0pre4 +TAG=freeside_1_5_0pre4 help: @echo "supported targets: aspdocs masondocs alldocs docs install-docs" @@ -65,6 +86,7 @@ help: @echo " perl-modules install-perl-modules" @echo " install deploy" @echo " create-database" + @echo " configure-rt create-rt" @echo " clean" aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/* @@ -115,6 +137,18 @@ install-docs: docs [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true + [ "${TEMPLATE}" = "asp" ] && \ + perl -p -i -e "\ + s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \ + " ${ASP_GLOBAL}/global.asa || true + [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true + [ "${TEMPLATE}" = "mason" ] && \ + perl -p -i -e "\ + s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \ + s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \ + " ${MASON_HANDLER} || true + [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true + [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true perl-modules: cd FS; \ @@ -131,17 +165,17 @@ install-init: perl -p -i -e "\ s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\ s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\ - s/%%%PASSWD_USER%%%/${PASSWD_USER}/g;\ - s/%%%PASSWD_MACHINE%%%/${PASSWD_MACHINE}/g;\ - s/%%%SIGNUP_USER%%%/${SIGNUP_USER}/g;\ - s/%%%SIGNUP_MACHINE%%%/${SIGNUP_MACHINE}/g;\ - s/%%%SIGNUP_AGENTNUM%%%/${SIGNUP_AGENTNUM}/g;\ - s/%%%SIGNUP_REFNUM%%%/${SIGNUP_REFNUM}/g;\ s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\ - s/%%%SELFSERVICE_MACHINE%%%/${SELFSERVICE_MACHINE}/g;\ + s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\ " ${INIT_FILE} -install: install-perl-modules install-docs install-init +install-selfservice: + for MACHINE in ${SELFSERVICE_MACHINES}; do \ + scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@\$MACHINE:. + ssh ${SELFSERVICE_INSTALL_USER}@\$MACHINE "cd FS-SelfService; perl Makefile.PL && make" + ssh ${SELFSERVICE_INSTALL_USER}@\$MACHINE "cd FS-SelfService; sudo make install" + +install: install-perl-modules install-docs install-init install-rt deploy: install ${HTTPD_RESTART} @@ -152,8 +186,7 @@ create-database: create-config: install-perl-modules [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true - mkdir ${FREESIDE_CONF} - chown freeside ${FREESIDE_CONF} + install -d -o freeside ${FREESIDE_CONF} touch ${FREESIDE_CONF}/secrets chown freeside ${FREESIDE_CONF}/secrets @@ -165,7 +198,8 @@ create-config: install-perl-modules mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}" rm -rf conf/registries #old dirs just won't go away - cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}" + #cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}" + cp `ls -d conf/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}" chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}" mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}" @@ -177,6 +211,43 @@ create-config: install-perl-modules mkdir "${FREESIDE_CONF}/export.${DATASOURCE}" chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}" +configure-rt: + cd rt; \ + cp config.layout.in config.layout; \ + perl -p -i -e "\ + s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\ + s'%%%MASONDATA%%%'${MASONDATA}'g;\ + " config.layout; \ + ./configure --enable-layout=Freeside\ + --with-db-type=Pg \ + --with-db-dba=${DB_USER} \ + --with-db-database=freeside \ + --with-db-rt-user=${DB_USER} \ + --with-db-rt-pass=${DB_PASSWORD} \ + --with-web-user=freeside \ + --with-web-group=freeside \ + --with-rt-group=freeside + +create-rt: configure-rt + cd rt; make install + echo -e "${DB_PASSWORD}\n\\d sessions"\ + | psql -U ${DB_USER} -W freeside 2>&1\ + | grep '^Did not find'\ + && rt/sbin/rt-setup-database --dba '${DB_USER}' \ + --dba-password '${DB_PASSWORD}' \ + --action schema \ + || true + rt/sbin/rt-setup-database --action insert_initial \ + && rt/sbin/rt-setup-database --action insert --datafile ${RT_PATH}/etc/initialdata \ + || true + perl -p -i -e "\ + s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\ + s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\ + " ${RT_PATH}/etc/RT_SiteConfig.pm + +install-rt: + [ ${RT_ENABLED} -eq 1 ] && ( cd rt; make install ) || true + clean: rm -rf aspdocs masondocs cd FS; \ @@ -185,8 +256,8 @@ clean: #these are probably only useful if you're me... upload-docs: forcehtmlman - ssh cleanwhisker.420.am rm -rf /var/www/www.sisd.com/freeside/devdocs - scp -pr httemplate/docs cleanwhisker.420.am:/var/www/www.sisd.com/freeside/devdocs + ssh pouncequick.420.am rm -rf /var/www/www.sisd.com/freeside/devdocs + scp -pr httemplate/docs pouncequick.420.am:/var/www/www.sisd.com/freeside/devdocs release: upload-docs cd /home/ivan/freeside @@ -197,7 +268,7 @@ release: upload-docs cvs export -r ${TAG} -d freeside-${VERSION} freeside tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION} - scp freeside-${VERSION}.tar.gz ivan@cleanwhisker.420.am:/var/www/sisd.420.am/freeside/ + scp freeside-${VERSION}.tar.gz ivan@pouncequick.420.am:/var/www/sisd.420.am/freeside/ mv freeside-${VERSION} freeside-${VERSION}.tar.gz .. update-webdemo: