]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/build_tools/make_package.sh
7b5c52cff26b7ecb516450c1f80b18726af56356
1 # shellcheck disable=SC1113
3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
18 if [[ -f "/etc/yum.conf" ]]; then
19 eval $__resultvar="centos"
20 elif [[ -f "/etc/dpkg/dpkg.cfg" ]]; then
21 eval $__resultvar="ubuntu"
23 fatal
"Unknwon operating system"
29 if [[ $OS = "ubuntu" ]]; then
30 if dpkg
--get-selections |
grep --quiet $1; then
31 log
"$1 is already installed. skipping."
33 # shellcheck disable=SC2068
36 elif [[ $OS = "centos" ]]; then
37 if rpm
-qa |
grep --quiet $1; then
38 log
"$1 is already installed. skipping."
40 # shellcheck disable=SC2068
46 function detect_fpm_output
() {
47 if [[ $OS = "ubuntu" ]]; then
49 elif [[ $OS = "centos" ]]; then
55 function gem_install
() {
56 if gem list |
grep --quiet $1; then
57 log
"$1 is already installed. skipping."
59 # shellcheck disable=SC2068
65 if [[ $# -ne 1 ]]; then
66 fatal
"Usage: $0 <rocksdb_version>"
68 log
"using rocksdb version: $1"
71 if [[ -d /vagrant
]]; then
72 if [[ $OS = "ubuntu" ]]; then
76 # the deb would depend on libgflags2, but the static lib is the only thing
77 # installed by make install
81 elif [[ $OS = "centos" ]]; then
82 pushd /etc
/yum.repos.d
83 if [[ ! -f /etc
/yum.repos.d
/devtools-1.1.repo
]]; then
84 wget http
://people.centos.org
/tru
/devtools-1.1
/devtools-1.1.repo
86 package devtoolset-1.1
-gcc --enablerepo=testing-1.1
-devtools-6
87 package devtoolset-1.1
-gcc-c++ --enablerepo=testing-1.1
-devtools-6
88 export CC
=/opt
/centos
/devtoolset-1.1
/root
/usr
/bin
/gcc
89 export CPP
=/opt
/centos
/devtoolset-1.1
/root
/usr
/bin
/cpp
90 export CXX
=/opt
/centos
/devtoolset-1.1
/root
/usr
/bin
/c
++
91 export PATH
=$PATH:/opt
/centos
/devtoolset-1.1
/root
/usr
/bin
93 if ! rpm
-qa |
grep --quiet gflags
; then
94 rpm
-i https
://github.com
/schuhschuh
/gflags
/releases
/download
/v2.1
.0/gflags-devel-2.1
.0-1.amd64.rpm
106 make install INSTALL_PATH
=package
111 if [[ -z "$ARCH" ]]; then
112 ARCH
=$
(getconf LONG_BIT
)
114 if [[ ("$FPM_OUTPUT" = "rpm") && ($ARCH -eq 64) ]]; then
125 --url http
://rocksdb.org
/ \
129 --description "RocksDB is an embeddable persistent key-value store for fast storage." \
133 # shellcheck disable=SC2068