Ticket #31155: Portfile.diff

File Portfile.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 
    21 checksums           sha1    e6017419051e5eda9cb222e3b17006eeed682db9 \
     20extract.suffix      .tgz
     21checksums           ${distname}${extract.suffix} \
     22                    sha1    e6017419051e5eda9cb222e3b17006eeed682db9 \
    2223                    rmd160  ef2c2e58d44a9d8786c2fc5b2f19f59bf9e1f70c
    2324
    24 extract.suffix      .tgz
     25# set the destination path.
     26set solr_basepath   ${prefix}/share/java
     27set solr_destpath   ${solr_basepath}/${distname}
     28set solr_path       ${solr_destpath}/example
     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
     41destroot {
     42    # copy the distribution.
     43    xinstall -d         ${destroot}${solr_basepath}
     44    copy ${worksrcpath} ${destroot}${solr_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}
    3249
    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"
     50notes "
     51To try apache-solr, run 'sudo solr' and open http://localhost:8983/solr/browse.
     52To store sample documents, 'cd ${solr_destpath}/example/exampledocs && ./post.sh *.xml'."
     53
     54# lucene-gosen is a Japanese analyzer.
     55set gosen_distfile   lucene-gosen-1.1.1-ipadic.jar
     56
     57variant ja description {Add Japanese settings and lucene-gosen} {
     58    homepage-append      http://code.google.com/p/lucene-gosen/
     59
     60    # fetch lucene-gosen.
     61    distfiles-append     ${gosen_distfile}:gosen
     62    master_sites-append  http://lucene-gosen.googlecode.com/files/:gosen
     63    checksums-append     ${gosen_distfile} \
     64                         sha1    2637bf3c4bdb4cb0efd095f4d423e5efb37e4543 \
     65                         rmd160  3feacc9c2ac81e2c15f3b8d6a377a85dd6fb6d01
     66    extract.only-delete  ${gosen_distfile}
     67
     68    # create solr-ja, solr home for Japanase texts.
     69    post-extract {
     70        copy ${worksrcpath}/example/solr ${worksrcpath}/example/solr-ja
    3771    }
    38 }
     72   
     73    patchfiles-append    patch-solr-ja.diff
    3974
    40 set target          ${prefix}/share/java/${name}-${version}
     75    post-destroot {
     76        # install lucene-gosen jar and config files.
     77        xinstall -d ${destroot}${solr_destpath}/contrib/lucene-gosen/lib
     78        copy ${distpath}/${gosen_distfile} \
     79             ${destroot}${solr_destpath}/contrib/lucene-gosen/lib
     80        xinstall -m 644 -W ${filespath} \
     81            mapping-japanese.txt \
     82            stoptags_ja.txt \
     83            stopwords_ja.txt \
     84            velocity.properties \
     85            ${destroot}${solr_destpath}/example/solr-ja/conf
     86        # copy a sample Japanese doc for testing.
     87        copy ${filespath}/solr-ja.xml \
     88             ${destroot}${solr_destpath}/example/exampledocs
     89    }
    4190
    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
     91    notes-append "Please run 'sudo solr -ja' to treat Japanase texts properly."
    4892}
    4993
    5094livecheck.type      regex
    51 livecheck.url       http://mirrors.ibiblio.org/pub/mirrors/apache/lucene/solr/
    52 livecheck.regex     {href="([0-9.]+)"}
     95livecheck.url       http://www.apache.org/dist/lucene/solr/
     96livecheck.regex     (\[0-9.\]+)\/