aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e9d5005bade9ba3795cfacc448d614c7387fe9c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Maintainer: Alex Kashirin <kashirin.alex@gmail.com>

_group_name="hdfs"
_sub_name="lib-cpp"

pkgname=${_group_name}-${_sub_name}
pkgver=3.3.0
pkgrel=1
pkgdesc="Libhdfs++ for Hadoop’s Distributed File System (HDFS)"
arch=("x86_64")

groups=($_group_name)
provides=(
  libhdfspp.so
)

url="https://github.com/apache/hadoop/tree/rel/release-3.3.0/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp"
license=('APACHE')


depends=(
  'gsasl'
  'openssl'
  'protobuf'
)
makedepends=(
  'pkg-config'
  'cmake'
  'make'
  'gcc'
  'gsasl'
  'openssl'
  'protobuf'
  'jdk-openjdk'
)

optdepends=()
conflicts=()
replaces=()
backup=()
options=()
install=README.md
changelog=


source=(
  $pkgname-$pkgver-source::git+https://github.com/apache/hadoop.git#tag=rel/release-$pkgver
)
sha256sums=('SKIP')

build() {
  export JAVA_HOME=/usr/lib/jvm/default;
  _src_path=`pwd`/$pkgname-$pkgver-source/;
  _build_path=`pwd`/$pkgname-$pkgver-build/;

  sed -i 's/set(LIBHDFSPP_VERSION "0.1.0")/set(LIBHDFSPP_VERSION "'${pkgver}'")/g' \
    ${_src_path}/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt;

  mkdir -p ${_build_path};
  cd ${_build_path};

  cmake ${_src_path}/hadoop-hdfs-project/hadoop-hdfs-native-client/src/ \
    -DJVM_ARCH_DATA_MODEL=64 -DHADOOP_BUILD=ON -DHDFSPP_LIBRARY_ONLY=ON \
    -DBUILD_SHARED_HDFSPP=ON -DLIBHDFSPP_VERSION=$pkgver \
    -DCMAKE_CXX_FLAGS="-ffile-prefix-map=${_src_path}= -ffile-prefix-map=${_build_path}=" \
    -DCMAKE_SKIP_RPATH=ON -DCMAKE_INSTALL_PREFIX=$pkgdir/usr \
    -DCMAKE_BUILD_TYPE=Release;

  cd main/native/libhdfspp;
  make hdfspp -j$((`grep -c processor < /proc/cpuinfo || echo 1`)) VERBOSE=1;
}


package() {
  mkdir -p $pkgdir/usr/share/$pkgname;
  cp $pkgname-$pkgver-source/LICENSE.txt $pkgdir/usr/share/$pkgname/;

  cd $pkgname-$pkgver-build/main/native/libhdfspp;
  make hdfspp install;
}