Changeset 97460 for trunk/dports/java


Ignore:
Timestamp:
Sep 7, 2012, 2:56:35 AM (7 years ago)
Author:
hum@…
Message:

hadoop: fetch the source tarball and build and install native libraries into ${prefix}/lib (See #35902); add patch-native.diff and dependencies; install documents into ${prefix}/share/doc/${distname}.

Location:
trunk/dports/java/hadoop
Files:
1 added
1 edited

Legend:

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

    r95899 r97460  
    66name                hadoop
    77version             1.0.3
    8 revision            1
     8revision            2
    99categories          java devel science
    1010maintainers         hum openmaintainer
     
    1717homepage            http://hadoop.apache.org/
    1818platforms           darwin
    19 supported_archs     noarch
    2019license             Apache-2
    2120
    2221master_sites        apache:hadoop/common/${distname}
    23 distfiles           ${distname}-bin${extract.suffix}
    24 checksums           rmd160  a98ca552a8a6dfcc6455b53cfd7988d562c265d1 \
    25                     sha256  a33d07ece0e9b7e1ecf32670cac28444ba8f56b3360548d96b56964facc2d1ef
     22checksums           rmd160  e41421483156fd0fa65d608b206a17cd2a73a989 \
     23                    sha256  716ab51f75ffb70343c3cca02f7ba4722f42376edb67eecbd42a426a054e6423
     24
     25patchfiles          patch-hadoop-env.sh.diff \
     26                    patch-native.diff
     27
     28depends_build       bin:ant:apache-ant
     29depends_lib         port:zlib \
     30                    port:snappy
     31
     32set java_home       /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
    2633
    2734pre-fetch {
     
    3239        return -code error "Mac OS X 10.6 (Snow Leopard) or later is required"
    3340    }
    34 }
    35 
    36 patchfiles          patch-hadoop-env.sh.diff
    37 
    38 use_configure       no
    39 
    40 build {}
    41 
    42 set hadoopuser      hadoop
    43 
    44 set java_home       /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
    45 
    46 pre-configure {
    4741    if {![file exists ${java_home}]} {
    4842        ui_error "Java 1.6 is required, but not located at ${java_home}"
     
    5044    }
    5145}
     46
     47universal_variant   no
     48
     49use_configure       no
     50
     51build.cmd           ant
     52build.args          -Dcompile.native=true \
     53                    -Dsnappy.prefix=${prefix} \
     54                    -Dinstall.native=${prefix}
     55build.target        compile
    5256
    5357# Hadoop home and conf directories.
     
    5660set hadoop_conf_dir ${hadoop_home}/conf
    5761
     62# Document directory.
     63set hadoop_doc_dir  ${prefix}/share/doc/${distname}
     64
    5865# Working directories.
    5966set hadoop_var_dir  ${prefix}/var/${name}
     
    6168set hadoop_pid_dir  ${hadoop_var_dir}/run
    6269
     70set hadoopuser      hadoop
     71
    6372destroot {
    6473    # Copy the distribution to Hadoop home directory.
    65     xinstall -m 755 -d  ${destroot}${hadoop_basedir}
    66     copy ${worksrcpath} ${destroot}${hadoop_basedir}
     74    xinstall -m 755 -d  ${destroot}${hadoop_home}
     75    foreach dir {bin conf contrib lib libexec sbin share webapps} {
     76        copy ${worksrcpath}/${dir} ${destroot}${hadoop_home}
     77    }
     78    foreach file [glob ${worksrcpath}/hadoop-*] {
     79        xinstall -m 644 ${file} ${destroot}${hadoop_home}
     80    }
     81    delete ${destroot}${hadoop_home}/lib/native
     82    delete ${destroot}${hadoop_home}/libexec/jsvc.amd64
    6783
    6884    # Patch for Mahout 0.4 to suppress warnings.
    69     xinstall -m 755 -d \
    70         ${destroot}${hadoop_home}/webapps/secondary/WEB-INF
     85    set webinf ${destroot}${hadoop_home}/webapps/secondary/WEB-INF
     86    xinstall -m 755 -d ${webinf}
     87    destroot.keepdirs-append ${webinf}
     88
     89    # Install native libraries.
     90    foreach file [glob ${worksrcpath}/build/native/**/lib/*] {
     91        xinstall -m 644 ${file} ${destroot}${prefix}/lib
     92    }
     93   
     94    # Copy extra documents.
     95    xinstall -m 755 -d  ${destroot}${hadoop_doc_dir}
     96    copy ${worksrcpath}/docs ${destroot}${hadoop_doc_dir}
     97    foreach file [glob ${worksrcpath}/*.txt] {
     98        xinstall -m 644 ${file} ${destroot}${hadoop_doc_dir}
     99    }
    71100
    72101    # Install an extra script for this port.
Note: See TracChangeset for help on using the changeset viewer.