license clarification for self-service code
[freeside.git] / Makefile
index 7ae5274..cf69f31 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,12 +3,14 @@
 #solaris and perhaps other very weirdass /bin/sh
 #SHELL="/bin/ksh"
 
-DATASOURCE = DBI:Pg:dbname=freeside
-#DATASOURCE=DBI:mysql:freeside
+DB_TYPE = Pg
+#DB_TYPE = mysql
 
 DB_USER = freeside
 DB_PASSWORD=
 
+DATASOURCE = DBI:${DB_TYPE}:dbname=freeside
+
 #changable now (some things which should go to the others still go to CONF)
 FREESIDE_CONF = /usr/local/etc/freeside
 FREESIDE_LOG = /usr/local/etc/freeside
@@ -19,8 +21,12 @@ FREESIDE_EXPORT = /usr/local/etc/freeside
 MASON_HANDLER = ${FREESIDE_CONF}/handler.pl
 MASONDATA = ${FREESIDE_CACHE}/masondata
 
-# only mason now
-TEMPLATE = mason
+#mod_perl v1
+#APACHE_VERSION = 1
+#mod_perl v2 prereleases up to and including 1.999_21
+#APACHE_VERSON = 1.99
+#mod_perl v2 proper and prereleases 1.999_22 and after
+APACHE_VERSION = 2
 
 #deb
 FREESIDE_DOCUMENT_ROOT = /var/www/freeside
@@ -48,7 +54,9 @@ INIT_INSTALL = /usr/sbin/update-rc.d freeside defaults 21 20
 #INIT_INSTALL = /usr/bin/true
 
 #deb, suse
-HTTPD_RESTART = /etc/init.d/apache restart
+#HTTPD_RESTART = /etc/init.d/apache restart
+#deb w/apache2
+HTTPD_RESTART = /etc/init.d/apache2 restart
 #redhat, fedora, mandrake
 #HTTPD_RESTART = /etc/init.d/httpd restart
 #freebsd
@@ -58,9 +66,9 @@ HTTPD_RESTART = /etc/init.d/apache restart
 #apache
 #HTTPD_RESTART = /usr/local/apache/bin/apachectl stop; sleep 10; /usr/local/apache/bin/apachectl startssl
 
-#(an include directory, not a file - "Include /etc/apache/conf.d" in httpd.conf)
+#(an include directory, not a file, "Include /etc/apachew/conf.d" in httpd.conf)
 #deb (3.1+), 
-APACHE_CONF = /etc/apache/conf.d
+APACHE_CONF = /etc/apache2/conf.d
 
 FREESIDE_RESTART = ${INIT_FILE} restart
 
@@ -105,8 +113,8 @@ RT_PATH = /opt/rt3
 FREESIDE_PATH = `pwd`
 PERL_INC_DEV_KLUDGE = /usr/local/share/perl/5.8.8/
 
-VERSION=1.7.1
-TAG=freeside_1_7_1
+VERSION=1.9.0cvs
+TAG=freeside_1_9_0
 
 help:
        @echo "supported targets:"
@@ -123,14 +131,13 @@ help:
        @echo "                   dev dev-docs dev-perl-modules"
        @echo
        @echo "                   masondocs alldocs docs"
-       @echo "                   htmlman forcehtmlman"
+       @echo "                   wikiman"
        @echo "                   perl-modules"
        #@echo
        #@echo "                   upload-docs release update-webdemo"
 
 
-#masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
-masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/*
+masondocs: httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/*
        rm -rf masondocs
        cp -pr httemplate masondocs
        touch masondocs
@@ -138,28 +145,15 @@ masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*
 alldocs: masondocs
 
 docs:
-       make ${TEMPLATE}docs
-
-htmlman:
-       [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
-       [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
-       [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
-       [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
-       [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
-       chmod a+rx bin/pod2x
-       [ -e DONT_REBUILD_DOCS ] || bin/pod2x
-
-forcehtmlman:
-       [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
-       [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
-       [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
-       [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
-       [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
-       bin/pod2x
+       make masondocs
+
+wikiman:
+       chmod a+rx ./bin/pod2x
+       ./bin/pod2x
 
 install-docs: docs
        [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
-       cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
+       cp -r masondocs ${FREESIDE_DOCUMENT_ROOT}
        chown -R freeside:freeside ${FREESIDE_DOCUMENT_ROOT}
        cp htetc/handler.pl ${MASON_HANDLER}
          perl -p -i -e "\
@@ -231,11 +225,13 @@ install-init:
        ${INIT_INSTALL}
 
 install-apache:
+       [ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
        [ -d ${APACHE_CONF} ] && \
-         ( install -o root -m 755 htetc/freeside-base.conf ${APACHE_CONF} && \
+         ( install -o root -m 755 htetc/freeside-base${APACHE_VERSION}.conf ${APACHE_CONF} && \
            ( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
            perl -p -i -e "\
              s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
+             s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
            " ${APACHE_CONF}/freeside-*.conf \
          ) || true
 
@@ -246,8 +242,7 @@ install-selfservice:
          ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\
          ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
          scp ~freeside/.ssh/id_dsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
-         ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo ${SELFSERVICE_INSTALL_USERADD} freeside; sudo install -d -o freeside -m 600 ~freeside/.ssh/" ;\
-         ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo ${SELFSERVICE_INSTALL_USERADD} freeside; sudo install -o freeside -m 600 ./id_dsa.pub ~freeside/.ssh/authorized_keys" ;\
+         ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo ${SELFSERVICE_INSTALL_USERADD} freeside; sudo install -d -o freeside -m 600 ~freeside/.ssh/; sudo install -o freeside -m 600 ./id_dsa.pub ~freeside/.ssh/authorized_keys" ;\
           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo install -o freeside -d /usr/local/freeside" ;\
        done
 
@@ -304,7 +299,7 @@ configure-rt:
          s'%%%MASONDATA%%%'${MASONDATA}'g;\
        " config.layout; \
        ./configure --enable-layout=Freeside\
-                   --with-db-type=Pg \
+                   --with-db-type=${DB_TYPE} \
                    --with-db-dba=${DB_USER} \
                    --with-db-database=${RT_DB_DATABASE} \
                    --with-db-rt-user=${DB_USER} \
@@ -318,23 +313,20 @@ create-rt: configure-rt
        [ -d /opt/rt3       ] || mkdir /opt/rt3       #
        [ -d /opt/rt3/share ] || mkdir /opt/rt3/share #
        cd rt; make install
-       echo -e "${DB_PASSWORD}\n\\d sessions"\
-        | psql -U ${DB_USER} -W ${RT_DB_DATABASE} 2>&1\
-        | grep '^Did not find'\
-        && rt/sbin/rt-setup-database --dba '${DB_USER}' \
-                                    --dba-password '${DB_PASSWORD}' \
-                                    --action schema \
+       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
+
+install-rt:
        perl -p -i -e "\
          s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
          s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
          s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
        " ${RT_PATH}/etc/RT_SiteConfig.pm
-
-install-rt:
        [ ${RT_ENABLED} -eq 1 ] && ( cd rt; make install ) || true
 
 clean:
@@ -349,10 +341,6 @@ clean:
 
 #these are probably only useful if you're me...
 
-upload-docs: forcehtmlman
-       ssh 420.am rm -rf /var/www/www.sisd.com/freeside/docs
-       scp -pr httemplate/docs 420.am:/var/www/www.sisd.com/freeside/docs
-
 #release: upload-docs
 release:
        cd /home/ivan/freeside