File: docker-build-linux.sh

package info (click to toggle)
rocksdb 9.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 46,052 kB
  • sloc: cpp: 500,768; java: 42,992; ansic: 9,789; python: 8,373; perl: 5,822; sh: 4,921; makefile: 2,386; asm: 550; xml: 342
file content (43 lines) | stat: -rwxr-xr-x 1,315 bytes parent folder | download
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
#!/usr/bin/env bash
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

set -e
#set -x

# Set job parallelism to 1 (none) if it is not defined in the environment
if [ -z "${J}" ]; then
  J=1
fi

# just in-case this is run outside Docker
mkdir -p /rocksdb-local-build

rm -rf /rocksdb-local-build/*
cp -r /rocksdb-host/* /rocksdb-local-build
cd /rocksdb-local-build

# Use scl devtoolset if available
if hash scl 2>/dev/null; then
  if scl --list | grep -q 'devtoolset-8'; then
    # CentOS 6+
    scl enable devtoolset-8 'make clean-not-downloaded'
    scl enable devtoolset-8 "PORTABLE=1 J=$J make -j$J rocksdbjavastatic"
  elif scl --list | grep -q 'devtoolset-7'; then
    # CentOS 6+
    scl enable devtoolset-7 'make clean-not-downloaded'
    scl enable devtoolset-7 "PORTABLE=1 J=$J make -j$J rocksdbjavastatic"
  elif scl --list | grep -q 'devtoolset-2'; then
    # CentOS 5 or 6
    scl enable devtoolset-2 'make clean-not-downloaded'
    scl enable devtoolset-2 "PORTABLE=1 J=$J make -j$J rocksdbjavastatic"
  else
    echo "Could not find devtoolset"
    exit 1;
  fi
else
  make clean-not-downloaded
  PORTABLE=1 make -j$J rocksdbjavastatic
fi

cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar java/target/rocksdbjni-*-linux*.jar.sha1 /rocksdb-java-target