1 # Contributor: Mantas Vidutis <mantas.a.vidutis-at-gmail.com>
7 pkgdesc="Hadoop - MapReduce implementation and distributed filesystem"
9 url="http://hadoop.apache.org"
11 depends=('jre' 'zlib' 'gzip' 'lzo' 'bzip2')
12 makedepends=('jdk' 'apache-ant')
14 conflicts=('hadoop-svn')
15 install=hadoop.install
16 source=("http://mirror.csclub.uwaterloo.ca/apache/hadoop/common/hadoop-${pkgver}/hadoop-${pkgver}.tar.gz")
17 md5sums=('fa150612de0efe80be88144c28225780')
20 cd ${srcdir}/hadoop-${pkgver} || return 1
28 sed -i "s/${_devver}/${pkgver}/" build.xml
30 sed -i "s|<ivysettings>|<ivysettings>\n<caches defaultCacheDir=\"${srcdir}/ivy_cache\"/>|" ivy/ivysettings.xml
34 ant -Dcompile.native=true bin-package || return 1
36 cd ${srcdir}/hadoop-${pkgver}/build || return 1
40 mkdir -p ${pkgdir}/usr/share
41 mkdir -p ${pkgdir}/usr/share/hadoop/etc/hadoop/
43 mv hadoop-${pkgver} ${pkgdir}/usr/share/hadoop || return 1
44 mv ${pkgdir}/usr/share/hadoop/conf ${pkgdir}/usr/share/hadoop/etc/hadoop/default || return 1
50 mkdir -p ${pkgdir}/usr/share/hadoop
51 mkdir -p ${pkgdir}/usr/share/hadoop/etc/hadoop/
53 cd ${srcdir}/hadoop-${pkgver}
55 mv bin lib webapps *.jar *.txt ${pkgdir}/usr/share/hadoop/ || return 1
56 mv conf ${pkgdir}/usr/share/hadoop/etc/hadoop/default || return 1
65 cd ${pkgdir}/usr/share/hadoop/etc/hadoop/default || return 1
68 echo 'export JAVA_HOME=/opt/java/jre' >> hadoop-env.sh
71 echo 'export HADOOP_LOG_DIR="/var/log/hadoop"' >> hadoop-env.sh
72 echo 'export HADOOP_PID_DIR="/var/run"' >> hadoop-env.sh
74 # Disable IPv6 (comment out for IPv6 support):
75 sed -i 's|_OPTS="-D|_OPTS="-Djava.net.preferIPv4Stack=true -D|' hadoop-env.sh
77 cd ${pkgdir}/usr/share/hadoop || return 1
79 sed -i 's#^export HADOOP_HOME=`dirname "$this"`/..#export HADOOP_HOME="/usr/share/hadoop"\nexport HADOOP_CONF_DIR="/etc/hadoop"#' bin/hadoop-config.sh
81 if [ "$CARCH" = "i686" ]; then
82 rm -rf lib/native/Linux-amd64-64
83 cd lib/native/Linux-i386-32
84 sed -i "s|dependency_libs='|dependency_libs='-L/opt/java/jre/lib/i386/server |" libhadoop.la
87 if [ "$CARCH" = "x86_64" ]; then
88 rm -rf lib/native/Linux-i386-32
89 cd lib/native/Linux-amd64-64
90 sed -i "s|dependency_libs='|dependency_libs='-L/opt/java/jre/lib/amd64/server |" libhadoop.la
93 # Create some links, so Hadoop's KFS jar could access KFS libraries properly
94 # (it is still fine if KFS is not installed)
96 msg "Creating KFS links..."
98 for lib in libkfsClient libkfsCommon libkfsEmulator libkfsIO libkfsMeta; do
100 ln -s /usr/lib/${lib}.${ext}
104 ln -s /usr/lib/libkfs_access.so