Changeset 18851 for gsdl/trunk


Ignore:
Timestamp:
2009-03-31T19:07:59+13:00 (15 years ago)
Author:
ak19
Message:

GSI-Makefile is now split into a bash script and the old Makefile where the targets just call the functions in the bash script by passing the function names as arguments.

Location:
gsdl/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/GSI-Makefile

    r18816 r18851  
    2525###########################################################################
    2626
     27# execute as: make -f GSI-Makefile <command>
     28# where command is any of the following make targets
     29
    2730test-gsdlhome:
    28     @ if test -z "${GSDLHOME}" ; then \
    29       echo "" ; \
    30       echo "Environment variable GSDLHOME not set." ; \
    31       echo "  This needs to be set to run this Makefile target." ; \
    32           echo "  Have you run 'source setup.bash'?" ; \
    33       echo "" ; \
    34       exit 1; \
    35     else \
    36       echo "Using: " ; \
    37       echo "  GSDLHOME = ${GSDLHOME}" ; \
    38       echo "  GSDLOS   = ${GSDLOS}" ; \
    39     fi
     31    ./gsicontrol.sh test-gsdlhome:
    4032
    41 configure-cgi: test-gsdlhome
    42     @ if test ! -e ${GSDLHOME}/cgi-bin/gsdlsite.cfg ; then \
    43       echo "Configuring cgi-bin/gsdlsite.cfg" ; \
    44       sed "s@\*\*GSDLHOME\*\*@${GSDLHOME}@g" cgi-bin/gsdlsite.cfg.in > cgi-bin/gsdlsite.cfg ; \
    45     else \
    46       echo "WARNING: Nothing done for make configure-cgi." ; \
    47       echo "   If you wish to regenerate the file " ; \
    48       echo "   ${GSDLHOME}/cgi-bin/gsdlsite.cfg" ; \
    49       echo "   from scratch, delete the existing file first." ; \
    50     fi
     33configure-cgi:
     34    ./gsicontrol.sh configure-cgi
    5135
    52 configure-admin: test-gsdlhome
    53     @echo "" ;
    54     @echo "Configuring admin user password:" ;
    55     @ (encrypted_password=`getpw` ;  \
    56        if [ $$? = "0" ] ; then \
    57          echo -e "[admin]\n<enabled>true\n<groups>administrator,colbuilder,all-collections-editor\n<password>$$encrypted_password\n<username>admin" \
    58               | txt2db -append "${GSDLHOME}/etc/users.db" ; \
    59        else \
    60          echo "Did not set password" ; \
    61        fi)
    62     @echo ""
     36configure-admin:
     37    ./gsicontrol.sh configure-admin
    6338
    64 configure-port: test-gsdlhome
    65     @ echo "Enter port number to use:"
    66     @ ( read port ; \
    67         if test ! -z $$port ; then \
    68           echo "Port: $$port" ; \
    69           echo "Stopping web server (if running)" ; \
    70           make -f GSI-Makefile web-stop-tested ; \
    71           echo "Setting config file to use port $$port"; \
    72           cat "${GSDLHOME}/apache-httpd/${GSDLOS}/conf/httpd.conf.in" \
    73         | sed "s@\*\*PORT\*\*@$$port@g" \
    74         | sed "s@\*\*GSDLHOME\*\*@${GSDLHOME}@g" \
    75         | sed "s@\*\*APACHE_HOME_OS\*\*@${GSDLHOME}/apache-httpd/${GSDLOS}@g" \
    76         > "${GSDLHOME}/apache-httpd/${GSDLOS}/conf/httpd.conf" ; \
    77           if test -e Makefile ; then \
    78             echo "Type 'make web-start' to start the web server running on port $$port" ; \
    79           else \
    80         echo "Type 'make -f GSI-Makefile web-start' to start the web server running on port $$port" ; \
    81           fi ; \
    82         fi ; \
    83         echo "Done" ; )
     39configure-port:
     40    ./gsicontrol.sh configure-port
    8441
     42configure-apache:
     43    ./gsicontrol.sh configure-apache
    8544
     45configure-web:
     46    ./gsicontrol.sh configure-web
    8647
    87 MONITOR_SUCCESS="MAKE SUCCESSFUL"
    88 MONITOR_FAILED="MAKE FAILED"
    89 MONITOR_FINISHED="MAKE DONE"
     48web-status:
     49    ./gsicontrol.sh web-status
    9050
    91 configure-apache: test-gsdlhome
    92     @ echo "Configuring the apache webserver..." ;
    93     @ ( port=`egrep "^apache.port" ${GSDLHOME}/lib/java/build.properties | awk -F= '{print $$2}'` ; \
    94         echo $$port | make -f GSI-Makefile configure-port ; )
    95     @ if test -e "${GSDLHOME}/apache-httpd/${GSDLOS}/conf/httpd.conf" ; then \
    96       echo $(MONITOR_SUCCESS); \
    97     else \
    98       echo $(MONITOR_FAILED); \
    99     fi
    100     @ echo $(MONITOR_FINISHED)
     51web-start:
     52    ./gsicontrol.sh web-start
    10153
     54web-restart:
     55    ./gsicontrol.sh web-restart
    10256
    103 configure-web: configure-cgi configure-apache
     57web-graceful:
     58    ./gsicontrol.sh graceful
    10459
    105 web-status: test-gsdlhome
    106     ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl status
     60web-stop-tested:
     61    ./gsicontrol.sh web-stop-tested
    10762
    108 web-start: test-gsdlhome
    109     ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl start
    110     @ echo $(MONITOR_SUCCESS)
    111     @ echo $(MONITOR_FINISHED)
    112 
    113 web-restart: test-gsdlhome
    114     ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl restart
    115     @ echo $(MONITOR_SUCCESS)
    116     @ echo $(MONITOR_FINISHED)
    117 
    118 web-graceful: test-gsdlhome
    119     ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl graceful
    120     @ echo $(MONITOR_SUCCESS)
    121     @ echo $(MONITOR_FINISHED)
    122 
    123 web-stop-tested:
    124     @# This version runs without testing for GSDLHOME
    125     @# Useful to be run as a target when we know test-gsdlhome has already
    126     @# been done.  This avoids a unnecessary repetition of printing
    127     @# out the values of GSDLHOME and GSDLOS
    128     @ if test -e "${GSDLHOME}/apache-httpd/${GSDLOS}/conf/httpd.conf" ; then \
    129       ${GSDLHOME}/apache-httpd/${GSDLOS}/bin/apachectl stop ; \
    130     fi
    131 
    132 web-stop: test-gsdlhome web-stop-tested
    133     @ echo $(MONITOR_SUCCESS)
    134     @ echo $(MONITOR_FINISHED)
     63web-stop:
     64    ./gsicontrol.sh web-stop
Note: See TracChangeset for help on using the changeset viewer.