add init script enable command in deb and redhat
[freeside.git] / Makefile
index c339477..de22d42 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,13 @@ 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"
+#not necessary (freebsd)
+#INIT_INSTALL = "/bin/true"
+
 #deb, suse
 HTTPD_RESTART = /etc/init.d/apache restart
 #redhat, fedora, mandrake
@@ -102,9 +109,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 +118,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 +164,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,6 +182,7 @@ install-init:
          s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
          s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
        " ${INIT_FILE}
+       ${INIT_INSTALL}
 
 install-selfservice:
        [ -e ~freeside/.ssh/id_dsa.pub ] || su -c 'ssh-keygen -t dsa' - freeside