Ticket #31155: Portfile.2.diff

File Portfile.2.diff, 4.5 KB (added by humem (humem), 13 years ago)
  • Portfile

    old new  
    55
    66name                apache-solr
    77version             3.3.0
    8 categories          java search
     8revision            1
     9categories          java textproc
    910platforms           darwin
    10 maintainers         gmail.com:haya10.ito openmaintainer
     11maintainers         gmail.com:haya10.ito hum openmaintainer
    1112license             Apache-2.0
    1213
    13 description         The open source enterprise search platform
    14 
     14homepage            http://lucene.apache.org/solr/
     15description         An open source enterprise search platform.
    1516long_description    Solr is the popular, blazing fast open source enterprise \
    1617                    search platform from the Apache Lucene project.
    1718
    18 homepage            http://lucene.apache.org/solr/
    1919master_sites        apache:lucene/solr/${version}/
    20 
     20extract.suffix      .tgz
    2121checksums           sha1    e6017419051e5eda9cb222e3b17006eeed682db9 \
    2222                    rmd160  ef2c2e58d44a9d8786c2fc5b2f19f59bf9e1f70c
    2323
    24 extract.suffix      .tgz
     24# set the destination paths.
     25set java_basepath   ${prefix}/share/java
     26set solr_destpath   ${java_basepath}/${distname}
     27set solr_path       ${solr_destpath}/example
     28set solr_home       ${solr_path}/solr
     29
     30post-patch {
     31    # expand relative pathes into abusolute ones.
     32    reinplace "s|\"\.\./\.\./|\"${solr_destpath}/|g" \
     33        ${worksrcpath}/example/solr/conf/solrconfig.xml
     34}
    2535
    2636use_configure       no
    2737supported_archs     noarch
    2838
    2939build {}
    3040
    31 set java_home       /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
    32 
    33 pre-configure {
    34     if {![file exists ${java_home}]} {
    35         ui_error "Java 1.6 is required, but not located at ${java_home}"
    36         return -code error "Java 1.6 missing"
    37     }
     41destroot {
     42    # copy the distribution.
     43    xinstall -d         ${destroot}${java_basepath}
     44    copy ${worksrcpath} ${destroot}${java_basepath}
     45    # install the solr script.
     46    xinstall -m 755 ${filespath}/solr.in     ${destroot}${prefix}/bin/solr
     47    reinplace "s|@solr_path@|${solr_path}|g" ${destroot}${prefix}/bin/solr
     48    reinplace "s|@solr_home@|${solr_home}|g" ${destroot}${prefix}/bin/solr
    3849}
    3950
    40 set target          ${prefix}/share/java/${name}-${version}
     51notes "
     52To try apache-solr, run 'sudo solr' and open http://localhost:8983/solr/browse.
     53To store sample documents, run 'cd ${solr_path}/exampledocs && ./post.sh *.xml'."
     54
     55# solr home for Japanese configurations.
     56set solr_home_ja    ${solr_home}-ja
     57
     58variant ja description {Add Japanese settings with lucene-gosen} {
     59    depends_run-append  port:lucene-gosen
     60    # create Japanese solr home 'solr-ja'.
     61    post-extract {
     62        copy ${worksrcpath}/example/solr ${worksrcpath}/example/solr-ja
     63    }
     64    patchfiles-append   patch-solr-ja.diff
     65    post-patch {
     66        # expand relative pathes into abusolute ones.
     67        reinplace "s|\"\.\./\.\./|\"${solr_destpath}/|g" \
     68            ${worksrcpath}/example/solr-ja/conf/solrconfig.xml
     69    }
     70    post-destroot {
     71        # set the lucene-gosen configuration path to config files.
     72        foreach config {schema.xml solrconfig.xml} {
     73            reinplace "s|@gosen_path@|${java_basepath}/lucene-gosen|g" \
     74                ${destroot}${solr_home_ja}/conf/${config}
     75        }
     76        # install a property file for UTF-8 encoding.
     77        copy ${filespath}/velocity.properties ${destroot}${solr_home_ja}/conf
     78        # copy a sample Japanese doc for testing.
     79        copy ${filespath}/solr-ja.xml ${destroot}${solr_path}/exampledocs
     80        # install the solr-ja script.
     81        xinstall -m 755 ${filespath}/solr.in        ${destroot}${prefix}/bin/solr-ja
     82        reinplace "s|@solr_path@|${solr_path}|g"    ${destroot}${prefix}/bin/solr-ja
     83        reinplace "s|@solr_home@|${solr_home_ja}|g" ${destroot}${prefix}/bin/solr-ja
     84    }
     85    notes-append "
    4186
    42 destroot {
    43     xinstall -d ${destroot}[file dirname ${target}]
    44     copy ${worksrcpath}/example ${destroot}${target}
    45     xinstall -m 755 ${filespath}/solr.in ${destroot}${prefix}/bin/solr
    46     reinplace "s|@TARGET@|${target}|g" ${destroot}${prefix}/bin/solr
    47     reinplace "s|@JAVA_HOME@|${java_home}|g" ${destroot}${prefix}/bin/solr
     87For Japanese texts, please run 'sudo solr-ja' instead of 'sudo solr'.
     88See ${solr_home_ja}."
    4889}
    4990
    5091livecheck.type      regex
    51 livecheck.url       http://mirrors.ibiblio.org/pub/mirrors/apache/lucene/solr/
    52 livecheck.regex     {href="([0-9.]+)"}
     92livecheck.url       http://www.apache.org/dist/lucene/solr/
     93livecheck.regex     (\[0-9.\]+)\/