################################################################################
#
# This makefile creates the web site by accessing the CVS.
#
# Written by Stefano Mazzocchi, Jon S. Stevens
# $Id: Makefile,v 1.1 1999/03/14 22:34:20 stefano Exp $
################################################################################

################################################################################
# Common definitions.  Edit these settings for your site.  
#
# CVS  : the CVS root where the modules are stored
# TOP  : the top level directory (use absolute path)
# TEMP : the temporary directory (use absolute path)
# PASS : the CVS passwork (use a read only CVS account since this file may leak)
################################################################################

CVS      = :pserver:jservpub@cvs.working-dogs.com:/products/cvs/master
TOP      = /www/apache.org/java
TEMP     = $(TOP)/temp
PASSWORD = jservpub

################################################################################
# Module names
################################################################################

# Site is the module that contains the web site top level
SITE = java_apache_org

# Modules is the list of modules inside your web site.
MODULES = jserv \
          jserv_ssi \
          james \
          framework \
          picoserver \
          cocoon \
          spfc \
          mod_java \

################################################################################
# You should not need to change anything below this line
################################################################################

# General methods

login: 
        echo "Logging into CVS.."
-->        cvs login -d $(CVS) < $(PASSWORD)
        
start:
        echo "Creating web site...
        mkdir $(TEMP)
        cd $(TEMP)

        echo " * Getting site module from CVS"
        cvs -z9 -Q -d $(CVS) checkout $(SITE)

        echo " * Getting project modules from CVS (this may take a while)"
-->        [for each MODULE in MODULES] cvs -z9 -Q -d $(CVS) checkout $(MODULE)/docs

directories: 
        echo " * Creating directories structure"
-->        [for each MODULE in MODULES] mkdir $(TOP)/$(MODULE)

copy:
        echo " * Copying documents to appropriate places"
        cp -R $(TEMP)/$(SITE)/* ${TOP}
-->        [for each MODULE in MODULES] cp -R $(TEMP)/$(MODULE)/docs/* ${TOP}/$(MODULE)

permissions:
        cd $(TOP)
        echo "* Setting permissions"
        find . -type file -exec chmod 664 \{\} \;
        find . -type dir -exec chmod 775 \{\} \;

done:
        echo "* Removing temporary directory"
        rm -R $(TEMP)
        
        echo "* Setting last update"
-->        [if $(TOP)/LAST_UPDATE not found] echo "" > $(TOP)/LAST_UPDATE
        touch $(TOP)/LAST_UPDATE

        echo "Done!"
        
test:   
        @echo CVS root: $(CVS)
        @echo Top directory: $(TOP)
        @echo Temp directory: $(TEMP)
        @echo CVS password: $(PASSWORD)

# Global methods
        
all: start copy done

new: login start directories copy permissions done
        