Changeset 9766


Ignore:
Timestamp:
Dec 14, 2004, 10:36:33 PM (15 years ago)
Author:
jberry
Message:

Deploy blojsom to tomcat as a directory, rather than a .war file, so that upgrades work better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/java/blojsom/Portfile

    r9760 r9766  
    1 # $Id: Portfile,v 1.1 2004/12/14 04:51:18 jberry Exp $
     1# $Id: Portfile,v 1.2 2004/12/14 22:36:33 jberry Exp $
    22
    33PortSystem 1.0
     
    55name                            blojsom
    66version                         2.21
     7revision                        1
    78
    89categories                      java www
     
    2829depends_lib                     bin:java:kaffe
    2930
     31set blog_home           ${prefix}/var/db/${name}
     32set blojsom_user        www
     33set blojsom_group       www
     34
    3035default_variants        +tomcat5
    3136
     
    3843        file mkdir "${worksrcpath}"
    3944}
     45
     46post-patch {
     47        set webInf ${worksrcpath}/war/WEB-INF
     48        reinplace s|blojsom-blog-home=|blojsom-blog-home=${blog_home}| ${webInf}/blojsom.properties
     49}
    4050                               
    4151build.cmd                       ant
     
    4454destroot        {
    4555        # Ensure needed directories
    46         xinstall -m 755 -d ${destroot}${prefix}/share/java \
     56        xinstall -m 755 -d \
     57                ${destroot}${prefix}/share/java \
    4758                ${destroot}${prefix}/share/doc
     59       
     60        # Make a place to store blog entries
     61        xinstall -m 775 -d ${destroot}${blog_home}/default
     62        destroot.keepdirs-append ${destroot}${blog_home}/default
     63        system "chown -R ${blojsom_user}:${blojsom_group} ${destroot}${blog_home}"
     64        system "chmod -R 775 ${destroot}${blog_home}"
    4865               
    4966        # Install the war where it can be found
     
    5269                ${destroot}${prefix}/share/java
    5370               
     71        # Install docs
     72        file copy ${worksrcpath}/docs/content ${destroot}${prefix}/share/doc/${name}
     73
    5474        # Install the war into the tomcat webapps directory
    5575        if {[variant_isset tomcat5]} {
    56                 xinstall -m 755 -d ${destroot}${prefix}/share/java/tomcat5/webapps
    57                 xinstall -m 644 \
    58                         ${worksrcpath}/distro/blojsom.war \
    59                         ${destroot}${prefix}/share/java/tomcat5/webapps
     76                set dest ${destroot}${prefix}/share/java/tomcat5/webapps/${name}
    6077               
     78                # Extract the war into tomcat's webapps folder
     79                xinstall -m 755 -d ${dest}
     80                system "cd ${dest} && jar xf ${worksrcpath}/distro/blojsom.war"
     81               
     82                system "chown -R ${blojsom_user}:${blojsom_group} ${dest}"
     83                system "chmod -R 775 ${dest}"           
     84               
     85                # Do some cleanup on the directory to so that it'll work across upgrades
     86                set volatile "  WEB-INF/blojsom.properties
     87                                                WEB-INF/plugin.properties
     88                                                "
     89                foreach { f } ${volatile} {
     90                        file rename ${dest}/${f} ${dest}/${f}.sample
     91                }
     92                       
    6193                ui_info "#"
    62                 ui_info "# blojsom.war was copied into the tomcat5/webapps directory. "
     94                ui_info "# blojsom was copied into the tomcat5/webapps directory. "
    6395                ui_info "# You may need to kick tomcat so that it'll be deployed."
    6496                ui_info "#"
     97                ui_info "# The following configuration files have been installed with "
     98                ui_info "# a .sample suffix to prevent their being munged during upgrade. "
     99                ui_info "# You'll want to copy them to a like name, without the suffix, during "
     100                ui_info "# your configuration:"
     101                ui_info "#      [join ${volatile}]"
     102                ui_info "#"
    65103        }
    66 
    67         # Install docs
    68         file copy ${worksrcpath}/docs/content ${destroot}${prefix}/share/doc/${name}
    69104}
Note: See TracChangeset for help on using the changeset viewer.