source: trunk/dports/java/apache-solr/Portfile @ 84041

Last change on this file since 84041 was 84041, checked in by hum@…, 8 years ago

apache-solr: update to 3.4.0; add data_dir option (-d) to the command scripts; see #31274.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 84041 2011-09-15 17:01:42Z hum@macports.org $
3
4PortSystem          1.0
5
6name                apache-solr
7version             3.4.0
8categories          java textproc
9platforms           darwin
10maintainers         gmail.com:haya10.ito hum openmaintainer
11license             Apache-2.0
12
13homepage            http://lucene.apache.org/solr/
14description         An open source enterprise search platform.
15long_description    Solr is the popular, blazing fast open source enterprise \
16                    search platform from the Apache Lucene project.
17
18master_sites        apache:lucene/solr/${version}/
19extract.suffix      .tgz
20checksums           sha1    4dc9bdbf3c49c4907c91d1bd75c40fccb4b430ba \
21                    rmd160  5b4058f78b60fb270da6114b6648253fa3b06dbc
22
23# set the destination paths.
24set java_basepath   ${prefix}/share/java
25set solr_destpath   ${java_basepath}/${distname}
26set solr_path       ${solr_destpath}/example
27set solr_home       ${solr_path}/solr
28
29post-patch {
30    # expand relative pathes into abusolute ones.
31    reinplace "s|\"\.\./\.\./|\"${solr_destpath}/|g" \
32        ${worksrcpath}/example/solr/conf/solrconfig.xml
33}
34
35use_configure       no
36supported_archs     noarch
37
38build {}
39
40destroot {
41    # copy the distribution.
42    xinstall -d         ${destroot}${java_basepath}
43    copy ${worksrcpath} ${destroot}${java_basepath}
44    # install the solr script.
45    xinstall -m 755 ${filespath}/solr.in     ${destroot}${prefix}/bin/solr
46    reinplace "s|@solr_path@|${solr_path}|g" ${destroot}${prefix}/bin/solr
47    reinplace "s|@solr_home@|${solr_home}|g" ${destroot}${prefix}/bin/solr
48}
49
50notes "
51To try apache-solr, run 'sudo solr' and open http://localhost:8983/solr/browse.
52To store sample documents, run 'cd ${solr_path}/exampledocs && ./post.sh *.xml'."
53
54# solr home for Japanese configurations.
55set solr_home_ja    ${solr_home}-ja
56
57variant ja description {Add Japanese settings with lucene-gosen} {
58    depends_run-append  port:lucene-gosen
59    # create Japanese solr home 'solr-ja'.
60    post-extract {
61        copy ${worksrcpath}/example/solr ${worksrcpath}/example/solr-ja
62    }
63    patchfiles-append   patch-solr-ja.diff
64    post-patch {
65        # expand relative pathes into abusolute ones.
66        reinplace "s|\"\.\./\.\./|\"${solr_destpath}/|g" \
67            ${worksrcpath}/example/solr-ja/conf/solrconfig.xml
68    }
69    post-destroot {
70        # set the lucene-gosen configuration path to config files.
71        foreach config {schema.xml solrconfig.xml} {
72            reinplace "s|@gosen_path@|${java_basepath}/lucene-gosen|g" \
73                ${destroot}${solr_home_ja}/conf/${config}
74        }
75        # install a property file for UTF-8 encoding.
76        copy ${filespath}/velocity.properties ${destroot}${solr_home_ja}/conf
77        # copy a sample Japanese doc for testing.
78        copy ${filespath}/solr-ja.xml ${destroot}${solr_path}/exampledocs
79        # install the solr-ja script.
80        xinstall -m 755 ${filespath}/solr.in        ${destroot}${prefix}/bin/solr-ja
81        reinplace "s|@solr_path@|${solr_path}|g"    ${destroot}${prefix}/bin/solr-ja
82        reinplace "s|@solr_home@|${solr_home_ja}|g" ${destroot}${prefix}/bin/solr-ja
83    }
84    notes-append "
85
86For Japanese texts, please run 'sudo solr-ja' instead of 'sudo solr'.
87See ${solr_home_ja}."
88}
89
90livecheck.type      regex
91livecheck.url       http://www.apache.org/dist/lucene/solr/
92livecheck.regex     (\[0-9.\]+)\/
Note: See TracBrowser for help on using the repository browser.