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=('ec0f791f866f82a7f2c1319a54f4db97')
19 #https://issues.apache.org/jira/secure/attachment/12394365/patch.4697
20 #https://issues.apache.org/jira/secure/attachment/12400552/patch.5292
23 cd ${srcdir}/hadoop-${pkgver} || return 1
31 sed -i "s/${_devver}/${pkgver}/" build.xml
33 # patch -Np0 -i ${srcdir}/progressReporter.patch || return 1
34 # patch -Np0 -i ${srcdir}/patch.5292 || return 1
36 sed -i "s|<ivysettings>|<ivysettings>\n<caches defaultCacheDir=\"${srcdir}/ivy_cache\"/>|" ivy/ivysettings.xml
40 ant -Dcompile.native=true bin-package || return 1
42 cd ${srcdir}/hadoop-${pkgver}/build || return 1
46 mkdir -p ${pkgdir}/usr/share
47 mkdir -p ${pkgdir}/etc/hadoop
49 mv hadoop-${pkgver} ${pkgdir}/usr/share/hadoop || return 1
50 mv ${pkgdir}/usr/share/hadoop/conf ${pkgdir}/etc/hadoop/default || return 1
56 mkdir -p ${pkgdir}/usr/share/hadoop
57 mkdir -p ${pkgdir}/etc/hadoop
59 cd ${srcdir}/hadoop-${pkgver}
61 mv bin lib webapps *.jar *.txt ${pkgdir}/usr/share/hadoop/ || return 1
62 mv conf ${pkgdir}/etc/hadoop/default || return 1
71 cd ${pkgdir}/etc/hadoop/default || return 1
74 echo 'export JAVA_HOME=/opt/java/jre' >> hadoop-env.sh
77 echo 'export HADOOP_LOG_DIR="/var/log/hadoop"' >> hadoop-env.sh
78 echo 'export HADOOP_PID_DIR="/var/run"' >> hadoop-env.sh
80 # Disable IPv6 (comment out for IPv6 support):
81 sed -i 's|_OPTS="-D|_OPTS="-Djava.net.preferIPv4Stack=true -D|' hadoop-env.sh
83 cd ${pkgdir}/usr/share/hadoop || return 1
85 sed -i 's#^export HADOOP_HOME=`dirname "$this"`/..#export HADOOP_HOME="/usr/share/hadoop"\nexport HADOOP_CONF_DIR="/etc/hadoop"#' bin/hadoop-config.sh
87 if [ "$CARCH" = "i686" ]; then
88 rm -rf lib/native/Linux-amd64-64
89 cd lib/native/Linux-i386-32
90 sed -i "s|dependency_libs='|dependency_libs='-L/opt/java/jre/lib/i386/server |" libhadoop.la
93 if [ "$CARCH" = "x86_64" ]; then
94 rm -rf lib/native/Linux-i386-32
95 cd lib/native/Linux-amd64-64
96 sed -i "s|dependency_libs='|dependency_libs='-L/opt/java/jre/lib/amd64/server |" libhadoop.la
99 # Create some links, so Hadoop's KFS jar could access KFS libraries properly
100 # (it is still fine if KFS is not installed)
102 msg "Creating KFS links..."
104 for lib in libkfsClient libkfsCommon libkfsEmulator libkfsIO libkfsMeta; do
106 ln -s /usr/lib/${lib}.${ext}
110 ln -s /usr/lib/libkfs_access.so