Changeset 97554 for trunk/dports/java


Ignore:
Timestamp:
Sep 9, 2012, 3:24:48 AM (7 years ago)
Author:
hum@…
Message:

hadoop: build c++-libhdfs with patch-c++.diff and add fusedfs variant with patch-fusedfs.diff (see #359024); use add_users instead of adduser and delete add_hadoop_user_and_group.

Location:
trunk/dports/java/hadoop
Files:
3 added
2 edited

Legend:

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

    r97460 r97554  
    66name                hadoop
    77version             1.0.3
    8 revision            2
     8revision            3
    99categories          java devel science
    1010maintainers         hum openmaintainer
     
    2424
    2525patchfiles          patch-hadoop-env.sh.diff \
    26                     patch-native.diff
     26                    patch-native.diff \
     27                    patch-c++.diff
    2728
    2829depends_build       bin:ant:apache-ant
     
    4546}
    4647
     48# Fix a file permission to build c++-libhdfs.
     49post-extract {
     50    file attributes ${worksrcpath}/src/c++/libhdfs/install-sh -permissions 0755
     51}
     52
    4753universal_variant   no
    4854
    4955use_configure       no
    5056
     57# Build native and c++ libraries.
    5158build.cmd           ant
    5259build.args          -Dcompile.native=true \
    5360                    -Dsnappy.prefix=${prefix} \
    54                     -Dinstall.native=${prefix}
    55 build.target        compile
     61                    -Dcompile.c++=true \
     62                    -Dlibhdfs=true
     63build.target        compile-native compile-c++-libhdfs
     64
     65# Fix install_name of dylib.
     66post-build {
     67    foreach file [glob ${worksrcpath}/build/native/**/lib/*.dylib \
     68                       ${worksrcpath}/build/c++/**/lib/*.dylib] {
     69        if {[file isfile ${file}]} {
     70            set libname [file tail ${file}]
     71            system "install_name_tool -id ${prefix}/lib/${libname} ${file}"
     72        }
     73    }
     74}
    5675
    5776# Hadoop home and conf directories.
     
    6988
    7089set hadoopuser      hadoop
     90
     91add_users ${hadoopuser} \
     92    group=${hadoopuser} \
     93    realname=Hadoop\ Server \
     94    home=${hadoop_var_dir} \
     95    shell=/bin/bash
     96
     97variant fusedfs description {Add Fuse-DFS} {
     98    depends_lib-append port:fuse4x
     99
     100    patchfiles-append  patch-fusedfs.diff
     101
     102    post-patch {
     103        set cppflags "-I${prefix}/include -I/System/Library/Frameworks/JavaVM.framework/Headers"
     104        set ldflags  "-L${prefix}/lib -L$@"
     105        reinplace "s|configure|configure CPPFLAGS=\"${cppflags}\" LDFLAGS=\"${ldflags}\"|" \
     106            ${worksrcpath}/src/contrib/fuse-dfs/bootstrap.sh
     107    }
     108
     109    post-build {
     110        system -W ${worksrcpath} "ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1"
     111    }
     112
     113    post-destroot {
     114        xinstall -m 755 \
     115            ${worksrcpath}/build/contrib/fuse-dfs/fuse_dfs \
     116            ${destroot}${prefix}/bin
     117        # Install fuse_dfs_wrapper.sh.
     118        xinstall -m 755 ${filespath}/fuse_dfs_wrapper.sh ${destroot}${hadoop_home}/bin
     119        set sh ${destroot}${hadoop_home}/bin/fuse_dfs_wrapper.sh
     120        reinplace "s|@hadoop_home@|${hadoop_home}|" ${sh}
     121        reinplace "s|@java_home@|${java_home}|"     ${sh}
     122        reinplace "s|@prefix@|${prefix}|"           ${sh}
     123    }
     124}
    71125
    72126destroot {
     
    87141    destroot.keepdirs-append ${webinf}
    88142
    89     # Install native libraries.
    90     foreach file [glob ${worksrcpath}/build/native/**/lib/*] {
     143    # Install native and c++ libraries.
     144    foreach file [glob ${worksrcpath}/build/native/**/lib/* \
     145                       ${worksrcpath}/build/c++/**/lib/*] {
    91146        xinstall -m 644 ${file} ${destroot}${prefix}/lib
    92147    }
     
    111166    reinplace "s|@hadoop_log_dir@|${hadoop_log_dir}|g" ${env_sh}
    112167    reinplace "s|@hadoop_pid_dir@|${hadoop_pid_dir}|g" ${env_sh}
    113 
    114     add_hadoop_user_and_group
    115168
    116169    # Create working directories.
     
    123176        ${destroot}${hadoop_log_dir} \
    124177        ${destroot}${hadoop_pid_dir}
    125 }
    126 
    127 pre-activate {
    128     add_hadoop_user_and_group
    129 }
    130 
    131 proc add_hadoop_user_and_group {} {
    132     global hadoopuser hadoop_var_dir
    133     if {![existsgroup ${hadoopuser}]} {
    134         addgroup ${hadoopuser}
    135         adduser ${hadoopuser} \
    136             gid=[existsgroup ${hadoopuser}] \
    137             realname=Hadoop\ Server \
    138             home=${hadoop_var_dir} \
    139             shell=/bin/bash
    140     }
    141178}
    142179
  • trunk/dports/java/hadoop/files/patch-native.diff

    r97460 r97554  
    6767     // three pointers are for host, user, domain, we only care
    6868     // about user now
    69 --- build.xml.orig      2012-05-09 05:35:00.000000000 +0900
    70 +++ build.xml   2012-09-05 23:10:45.000000000 +0900
    71 @@ -680,7 +680,7 @@
    72           <env key="OS_ARCH" value="${os.arch}"/>
    73           <env key="JVM_DATA_MODEL" value="${sun.arch.data.model}"/>
    74           <env key="HADOOP_NATIVE_SRCDIR" value="${native.src.dir}"/>
    75 -      <arg line="${native.src.dir}/configure"/>
    76 +      <arg line="${native.src.dir}/configure --prefix=${install.native}"/>
    77      </exec>
    78  
    79      <exec dir="${build.native}" executable="${make.cmd}" failonerror="true">
Note: See TracChangeset for help on using the changeset viewer.