so Search.tsf and Search.rdf work
[freeside.git] / Makefile
index 2830fe1..79491e9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,17 +34,28 @@ INIT_FILE = /etc/init.d/freeside
 #freebsd
 #INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
 
+#deb
+INIT_INSTALL = /usr/sbin/update-rc.d freeside defaults 21 20
+#redhat, fedora
+#INIT_INSTALL = /sbin/chkconfig freeside on
+#not necessary (freebsd)
+#INIT_INSTALL = /usr/bin/true
+
 #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 10; /usr/local/etc/rc.d/apache.sh start
+#HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop || true; sleep 10; /usr/local/etc/rc.d/apache.sh start
 #openbsd
 #HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 10; /usr/sbin/httpd -u -DSSL
 #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)
+#deb (3.1+), 
+APACHE_CONF = /etc/apache/conf.d
+
 FREESIDE_RESTART = ${INIT_FILE} restart
 
 #deb, redhat, fedora, mandrake, suse, others?
@@ -71,11 +82,12 @@ SELFSERVICE_INSTALL_USER = ivan
 SELFSERVICE_INSTALL_USERADD = /usr/sbin/useradd
 #SELFSERVICE_INSTALL_USERADD = "/usr/sbin/pw useradd"
 
-#RT_ENABLED = 0
-RT_ENABLED = 1
+RT_ENABLED = 0
+#RT_ENABLED = 1
 RT_DOMAIN = example.com
 RT_TIMEZONE = US/Pacific;
 #RT_TIMEZONE = US/Eastern;
+FREESIDE_URL = "http://localhost/freeside/"
 
 #for now, same db as specified in DATASOURCE... eventually, otherwise?
 RT_DB_DATABASE = freeside
@@ -102,9 +114,6 @@ help:
 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
        rm -rf aspdocs
        cp -pr httemplate aspdocs
-       perl -p -i -e "\
-         s/%%%VERSION%%%/${VERSION}/g;\
-       " aspdocs/index.html
        touch aspdocs
 
 
@@ -114,9 +123,6 @@ masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*
        ( cd masondocs; \
          ../bin/masonize; \
        )
-       perl -p -i -e "\
-         s/%%%VERSION%%%/${VERSION}/g;\
-       " masondocs/index.html
        touch masondocs
 
 alldocs: aspdocs masondocs
@@ -163,7 +169,10 @@ install-docs: docs
 perl-modules:
        cd FS; \
        [ -e Makefile ] || perl Makefile.PL; \
-       make
+       make; \
+       perl -p -i -e "\
+         s/%%%VERSION%%%/${VERSION}/g;\
+       " blib/lib/FS.pm
 
 install-perl-modules: perl-modules
        cd FS; \
@@ -178,9 +187,19 @@ install-init:
          s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
          s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
        " ${INIT_FILE}
+       ${INIT_INSTALL}
+
+install-apache:
+       [ -d ${APACHE_CONF} ] && \
+         ( install -o root -m 755 htetc/freeside-base.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; \
+           " ${APACHE_CONF}/freeside-*.conf \
+         ) || true
 
 install-selfservice:
-       [ -e ~freeside/.ssh/id_dsa.pub ] || su -c 'ssh-keygen -t dsa' - freeside
+       [ -e ~freeside/.ssh/id_dsa.pub ] || su - freeside -c 'ssh-keygen -t dsa'
        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" ;\
@@ -197,7 +216,7 @@ update-selfservice:
          ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
        done
 
-install: install-perl-modules install-docs install-init install-rt
+install: install-perl-modules install-docs install-init install-apache install-rt
 
 deploy: install
        ${HTTPD_RESTART}
@@ -268,6 +287,7 @@ create-rt: configure-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: