1 # Contributor: Jakub Schmidtke <sjakub-at-gmail.com>
7 pkgdesc="Hadoop - MapReduce implementation and distributed filesystem - subversion version"
9 url="http://hadoop.apache.org"
11 depends=('jre' 'zlib' 'gzip' 'lzo' 'bzip2')
12 makedepends=('jdk' 'apache-ant' 'subversion')
15 install=hadoop.install
16 source=('progressReporter.patch')
17 md5sums=('f991dca050cb9bacaa67e062d66b1a76')
19 _svntrunk=http://svn.apache.org/repos/asf/hadoop/core/trunk
26 if [ -d ${_svnmod}/.svn ]; then
27 (cd ${_svnmod} && svn -R revert .)
28 (cd ${_svnmod} && svn -r ${pkgver} up)
31 svn co ${_svntrunk} --config-dir ./ -r ${pkgver} ${_svnmod}
34 msg "SVN checkout done or server timeout"
36 cd ${srcdir}/${_svnmod} || return 1
44 patch -Np0 -i ${srcdir}/progressReporter.patch || return 1
48 ant -Dcompile.native=true bin-package || return 1
52 mkdir -p ${pkgdir}/usr/share
53 mkdir -p ${pkgdir}/etc/hadoop
55 cd ${srcdir}/${_svnmod}/build || return 1
57 mv hadoop-${_devver} ${pkgdir}/usr/share/hadoop
58 mv ${pkgdir}/usr/share/hadoop/conf ${pkgdir}/etc/hadoop/default
60 cd ${pkgdir}/etc/hadoop/default || return 1
65 echo 'export JAVA_HOME=/opt/java/jre' >> hadoop-env.sh
68 echo 'export HADOOP_LOG_DIR="/var/log/hadoop"' >> hadoop-env.sh
69 echo 'export HADOOP_PID_DIR="/var/run"' >> hadoop-env.sh
71 # Disable IPv6 (comment out for IPv6 support):
72 sed -i 's|_OPTS="-D|_OPTS="-Djava.net.preferIPv4Stack=true -D|' hadoop-env.sh
74 cd ${pkgdir}/usr/share/hadoop || return 1
76 sed -i 's#^export HADOOP_HOME=`dirname "$this"`/..#export HADOOP_HOME="/usr/share/hadoop"\nexport HADOOP_CONF_DIR="/etc/hadoop"#' bin/hadoop-config.sh
78 if [ "$CARCH" = "i686" ]; then
79 cd lib/native/Linux-i386-32
82 if [ "$CARCH" = "x86_64" ]; then
83 cd lib/native/Linux-amd64-64
86 # Create some links, so Hadoop's KFS jar could access KFS libraries properly
87 # (it is still fine if KFS is not installed)
89 msg "Creating KFS links..."
91 for lib in libkfsClient libkfsCommon libkfsEmulator libkfsIO libkfsMeta; do
93 ln -s /usr/lib/${lib}.${ext}
97 ln -s /usr/lib/libkfs_access.so