337 lines
14 KiB
Bash
337 lines
14 KiB
Bash
# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
|
|
# Contributor: Sébastien "Seblu" Luttringer <seblu@archlinux.org>
|
|
|
|
pkgbase='ceph'
|
|
pkgname=('ceph' 'ceph-libs' 'ceph-mgr')
|
|
_zstdver=1.5.0
|
|
pkgver=16.2.7
|
|
pkgrel=1
|
|
pkgdesc='Distributed, fault-tolerant storage platform delivering object, block, and file system'
|
|
arch=('x86_64')
|
|
url='https://ceph.com/'
|
|
license=('GPL')
|
|
makedepends=('zstd' 'bash' 'bc' 'boost' 'boost-libs' 'bzip2' 'c-ares' 'cmake' 'coreutils' 'coffeescript'
|
|
'cpio' 'crypto++' 'cryptsetup' 'cunit' 'curl' 'cython' 'expat'
|
|
'fcgi' 'fontconfig' 'fuse2' 'fuse3' 'fmt' 'gcc' 'gcc-libs' 'git' 'glibc' 'gmock' 'gnutls'
|
|
'gperf' 'gperftools' 'gptfdisk' 'gtest' 'hwloc' 'inetutils' 'java-runtime'
|
|
'jq' 'jre11-openjdk-headless' 'junit' 'keyutils' 'leveldb' 'libaio'
|
|
'libatomic_ops' 'libcap' 'libcap-ng' 'libcroco' 'libcurl-compat'
|
|
'libedit' 'libgudev' 'libnl' 'librabbitmq-c' 'libtool' 'util-linux'
|
|
'libuv' 'libxml2' 'librdkafka' 'libpciaccess' 'lsb-release' 'lua' 'lz4' 'ncurses' 'liburing'
|
|
'nss' 'numactl' 'oath-toolkit' 'openssl' 'parted' 'pcre' 'pcre2' 'pkgconf' 'protobuf'
|
|
'procps-ng' 'python-astroid' 'python-attrs' 'python-bcrypt'
|
|
'python-cheroot' 'python-cherrypy' 'python-coverage' 'python-dateutil'
|
|
'python-elasticsearch' 'python-flask' 'python-flask-restful'
|
|
'python-google-api-python-client' 'python-google-auth'
|
|
'python-google-auth-httplib2' 'python-grpcio' 'python-isort'
|
|
'python-jinja' 'python-lazy-object-proxy' 'python-mccabe'
|
|
'python-isodate' 'python-defusedxml' 'python-pkgconfig' 'python-protobuf'
|
|
'python-lxml' 'python-xmlsec' 'python-yaml'
|
|
'python-more-itertools' 'python-numpy' 'python-pbr' 'python-pecan'
|
|
'python-pip' 'python-pluggy' 'python-portend' 'python-prettytable'
|
|
'python-prometheus_client' 'python-py' 'python-pycparser'
|
|
'python-pyjwt' 'python-pyopenssl' 'python-pytz' 'python-requests'
|
|
'python-routes' 'python-scikit-learn' 'python-scipy'
|
|
'python-setuptools' 'python-six' 'python-sphinx' 'python-tempora'
|
|
'python-virtualenv' 'python-werkzeug' 'python-wrapt' 'rabbitmq'
|
|
'sed' 'snappy' 'socat' 'systemd' 'systemd-libs' 'valgrind'
|
|
'xfsprogs' 'xmlstarlet' 'xmlsec' 'xxhash' 'yaml-cpp' 'yasm' 'zlib' )
|
|
checkdepends=('python-mock' 'python-nose' 'python-pycodestyle' 'python-pylint'
|
|
'python-pytest' 'python-pytest-cov')
|
|
options=('emptydirs')
|
|
source=(
|
|
"https://download.ceph.com/tarballs/${pkgbase}-${pkgver}.tar.gz"
|
|
'ceph.sysusers'
|
|
'ceph-14.2.0-cflags.patch'
|
|
'ceph-12.2.4-boost-build-none-options.patch'
|
|
'ceph-13.2.0-cflags.patch'
|
|
'ceph-13.2.2-dont-install-sysvinit-script.patch'
|
|
'ceph-14.2.0-cython-0.29.patch'
|
|
'ceph-15.2.0-rocksdb-cmake.patch'
|
|
'ceph-16.2.0-liburing.patch'
|
|
'ceph-16.2.0-boost-string.patch'
|
|
'disable-empty-readable.sh-test.patch'
|
|
)
|
|
sha512sums=('eab047e646970d444acf1064d98237b8b1677fb16b5e771082d55880f7bc6d8bdb278c2fe514c82ae12c438878d9ecea29139fa6b8d890f9f737138f10fb740c'
|
|
'4354001c1abd9a0c385ba7bd529e3638fb6660b6a88d4e49706d4ac21c81b8e829303a20fb5445730bdac18c4865efb10bc809c1cd56d743c12aa9a52e160049'
|
|
'9e6bb46d5bbdc5d93f4f026b2a8d6bdb692d9ea6e7018c1bb0188d95ea8574c76238d968b340fd67ddaa3d8183b310e393e3549dc3a63a795fde696413b0ca94'
|
|
'6ff46a90d76f667fa23be0f9eb1ed2fb7e30af9a2621aec19944d0a22a431a0f5721603c588286e483ff55c14aac920adfccb039c9678a87cc59640dd70367ae'
|
|
'8ec0d668fefee12d2c7f5b5297dd81fc6a559f5823d069e6395d9b4240110eb8f95049d3054697a459948c1f3784b4450539849cf9d7f3b1aa1c7fbd96c475df'
|
|
'ea069b75b786c22166c609b127b512802cc5c6e9512d792d7b7b34d276f5b86d57c8c35cfc7b5c855a59c0ba87ba1aabe2ca26da72b26bff46b6ba8410ddb27e'
|
|
'82c1608928ee669ef60b8930ce82c443152c446e669e7bde9ce32f78571afb19a9620c3818b69ac8cb3ea33e7d7ac40f77c89162c71b19b157336d907fa23e3d'
|
|
'2e62020cce33e3152cdb9a128023ee673124c4bcfdb9ee17718891ba5c9a16d98eb03ed06fe7dc7833c98487c1c1eb67fadfad1aa2f40c2c648829c86b4caab0'
|
|
'e8d03f04cbc307b131a0a55cb90d8a568b78a8e8f294d7e4415b7da7acec05b4d1dc32632935841fe2a492de7ee8ff52e544aab91b838431fda3815ca377fa64'
|
|
'f467aba61f61036d8b655f39dd090b7dc20f1308d8581ebfba8b9ae341ed03eb80b2c7b7f4936a4f994ff1d1958ac2f1e431b94ad77b04e418725dea2268a9be'
|
|
'2234d005df71b3b6013e6b76ad07a5791e3af7efec5f41c78eb1a9c92a22a67f0be9560be59b52534e90bfe251bcf32c33d5d40163f3f8f7e7420691f0f4a222')
|
|
|
|
|
|
# -fno-plt causes linker errors (undefined reference to internal methods)
|
|
# similar issue: https://bugs.archlinux.org/task/54845
|
|
# https://github.com/intel/media-driver/commit/d95d8f7ab7ac94a2e0f4ee6a4b4794898dc2d3b7
|
|
# as of today (2019-07-12) the upstream maintainers do not consider this a bug in their code
|
|
# (IMHO rightfully so) and thus we strip the option here
|
|
export CFLAGS="${CFLAGS/-fno-plt/}"
|
|
export CXXFLAGS="${CXXFLAGS/-fno-plt/}"
|
|
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${pkgbase}-${pkgver}"
|
|
|
|
# apply patches from the source array
|
|
local filename
|
|
for filename in "${source[@]%%::*}"; do
|
|
if [[ "${filename}" =~ \.patch$ ]]; then
|
|
echo "Applying patch ${filename##*/}"
|
|
patch -p1 -N -i "${srcdir}/${filename##*/}"
|
|
fi
|
|
done
|
|
|
|
# temporarily disable unsubscriptable-object (buggy on Python 3.9)
|
|
# https://github.com/PyCQA/pylint/issues/3882
|
|
sed -i '/^disable=/a\ unsubscriptable-object,' \
|
|
src/pybind/mgr/dashboard/.pylintrc
|
|
|
|
# mypy complains about this but the exception is handled; not sure what's up
|
|
sed -i 's/from base64 import encodestring$/& # type: ignore/' \
|
|
src/pybind/mgr/dashboard/awsauth.py
|
|
|
|
# suppress deprecation warnings
|
|
sed -i '/#ifndef CEPH_CONFIG_H/i#define BOOST_ALLOW_DEPRECATED_HEADERS' \
|
|
src/common/config.h
|
|
sed -i '/#ifndef CEPH_TYPES_H/i#define BOOST_ALLOW_DEPRECATED_HEADERS' \
|
|
src/include/types.h
|
|
|
|
# fix boost stuff for system-boost
|
|
find . -name '*.cmake' -or -name 'CMakeLists.txt' -print0 | xargs --null \
|
|
sed -r \
|
|
-e 's|Boost::|boost_|g' \
|
|
-e 's|Boost_|boost_|g' \
|
|
-e 's|[Bb]oost_boost|boost_system|g' -i || exit 1
|
|
|
|
# remove bundled zstd and replace with newer release
|
|
#rm -rf src/zstd
|
|
#ln -sf "${srcdir}/zstd-${_zstdver}" src/zstd
|
|
|
|
# remove tests that require root privileges
|
|
rm src/test/cli/ceph-authtool/cap*.t
|
|
|
|
# disable/remove broken tests
|
|
sed -i '/add_ceph_test(smoke.sh/d' src/test/CMakeLists.txt
|
|
sed -i '/add_ceph_test(safe-to-destroy.sh/d' src/test/osd/CMakeLists.txt
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/${pkgbase}-${pkgver}"
|
|
|
|
# workaround for boost 1.74 -- similar fix exists upstream but I could
|
|
# not get it to work: https://github.com/ceph/ceph/commit/3d708219092d
|
|
CPPFLAGS+=' -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT'
|
|
|
|
export CFLAGS+=" ${CPPFLAGS}"
|
|
export CXXFLAGS+=" ${CPPFLAGS}"
|
|
export PYTHON_VERSION="$(python --version | awk '{print $2}')"
|
|
export PYTHON_INCLUDE_DIR="$(python -c "from sysconfig import get_path; print(get_path('include'))")"
|
|
export CMAKE_BUILD_TYPE='RelWithDebInfo'
|
|
export CMAKE_WARN_UNUSED_CLI=no
|
|
|
|
cmake \
|
|
-B build \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
|
|
-DCMAKE_INSTALL_SBINDIR=/usr/bin \
|
|
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
|
|
-DCEPH_SYSTEMD_ENV_DIR=/etc/default \
|
|
-DCMAKE_INSTALL_LIBEXECDIR=/usr/lib \
|
|
-DCMAKE_INSTALL_SYSTEMD_SERVICEDIR=/usr/lib/systemd/system \
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
-DENABLE_GIT_VERSION=ON \
|
|
-DWITH_PYTHON2=OFF \
|
|
-DWITH_PYTHON3="${PYTHON_VERSION}" \
|
|
-DMGR_PYTHON_VERSION=3 \
|
|
-DPYTHON_INCLUDE_DIR="${PYTHON_INCLUDE_DIR:?}" \
|
|
-DWITH_BABELTRACE=OFF \
|
|
-DWITH_LTTNG=OFF \
|
|
-DWITH_OPENLDAP=OFF \
|
|
-DWITH_RDMA=OFF \
|
|
-DWITH_OCF=OFF \
|
|
-DWITH_DPDK=OFF \
|
|
-DWITH_SPDK=OFF \
|
|
-DWITH_CEPHFS=ON \
|
|
-DWITH_CEPHFS_JAVA=ON \
|
|
-DWITH_CEPHFS_SHELL=ON \
|
|
-DWITH_FUSE=ON \
|
|
-DWITH_LZ4=ON \
|
|
-DWITH_XFS=ON \
|
|
-DWITH_MGR=ON \
|
|
-DWITH_MGR_DASHBOARD_FRONTEND=OFF \
|
|
-DDASHBOARD_FRONTEND_LANGS="ALL" \
|
|
-DWITH_RADOSGW=ON \
|
|
-DWITH_RADOSGW_FCGI_FRONTEND=OFF \
|
|
-DWITH_RADOSGW_BEAST_FRONTEND=ON \
|
|
-DWITH_RADOSGW_BEAST_OPENSSL=ON \
|
|
-DWITH_RADOSGW_AMQP_ENDPOINT=OFF \
|
|
-DWITH_LIBURING=ON \
|
|
-DWITH_SYSTEM_LIBURING=ON \
|
|
-DWITH_SYSTEMD=ON \
|
|
-DWITH_SYSTEM_BOOST=ON \
|
|
-DWITH_BOOST_CONTEXT=ON \
|
|
-DWITH_SYSTEM_GTEST=OFF \
|
|
-DWITH_SYSTEM_NPM=OFF \
|
|
-DENABLE_SHARED=ON \
|
|
-DWITH_TESTS=ON \
|
|
-Wno-dev
|
|
|
|
VERBOSE=1 make -C build all
|
|
}
|
|
|
|
###
|
|
### testsuite currently broken, needs some debugging
|
|
###
|
|
# check() {
|
|
# cd "${srcdir}/${pkgbase}-${pkgver}"
|
|
#
|
|
# export CTEST_PARALLEL_LEVEL=8
|
|
# export CTEST_OUTPUT_ON_FAILURE=1
|
|
# VERBOSE=1 make -C build check
|
|
#
|
|
# # sometimes processes are not properly terminated...
|
|
# for process in ceph-mon ceph-mgr ceph-osd; do
|
|
# pkill -9 "${process}" || true
|
|
# done
|
|
# }
|
|
|
|
package_ceph-libs() {
|
|
depends=('boost-libs' 'curl' 'glibc' 'keyutils' 'libutil-linux' 'bzip2' 'liburing' 'lz4' 'nss'
|
|
'oath-toolkit' 'python' 'snappy' 'systemd-libs' 'fmt')
|
|
|
|
cd "${srcdir}/${pkgbase}-${pkgver}"
|
|
|
|
# main install
|
|
VERBOSE=1 make DESTDIR="${pkgdir}" -C build install
|
|
|
|
# remove stuff that goes into the ceph package
|
|
rm -rf "${pkgdir}"/usr/lib/{ceph/mgr,systemd,sysusers.d,tmpfiles.d}
|
|
rm -rf "${pkgdir}/usr/share"
|
|
rm -rf "${pkgdir}/usr/sbin"
|
|
rm -rf "${pkgdir}/usr/bin"
|
|
rm -rf "${pkgdir}/etc"
|
|
rm -rf "${pkgdir}/var"
|
|
}
|
|
|
|
package_ceph() {
|
|
depends=("ceph-libs=${pkgver}-${pkgrel}"
|
|
'boost-libs' 'curl' 'fuse2' 'fuse3' 'fmt' 'glibc' 'gperftools' 'java-runtime'
|
|
'keyutils' 'leveldb' 'libaio' 'libutil-linux' 'librdkafka' 'lua'
|
|
'lsb-release' 'ncurses'
|
|
'nss' 'oath-toolkit' 'python' 'python-bcrypt' 'python-setuptools'
|
|
'python-prettytable' 'python-cmd2' 'python-dateutil' 'snappy' 'sudo' 'systemd-libs'
|
|
'python-flask' 'python-pecan' 'python-pyopenssl' 'python-requests' 'python-werkzeug' 'xfsprogs'
|
|
'python-yaml' 'python-pyaml')
|
|
|
|
cd "${srcdir}/${pkgbase}-${pkgver}"
|
|
|
|
# main install
|
|
VERBOSE=1 make DESTDIR="${pkgdir}" -C build install
|
|
|
|
# fix sbin dir (cmake opt seems to have no effect)
|
|
mv "${pkgdir}"/usr/sbin/* "${pkgdir}/usr/bin/"
|
|
rm -rf "${pkgdir}/usr/sbin"
|
|
|
|
# remove stuff that is in the ceph-libs package
|
|
find "${pkgdir}/usr/lib" -maxdepth 1 -type f -delete
|
|
find "${pkgdir}/usr/lib" -maxdepth 1 -type l -delete
|
|
find "${pkgdir}/usr/lib/ceph" -maxdepth 1 -type f -delete
|
|
find "${pkgdir}/usr/lib/ceph" -maxdepth 1 -type l -delete
|
|
rm -rf "${pkgdir}"/usr/lib/{ceph/{compressor,crypto,erasure-code,librbd},rados-classes}
|
|
rm -rf "${pkgdir}"/usr/lib/python*
|
|
rm -rf "${pkgdir}/usr/include"
|
|
|
|
# remove stuff that is in the ceph-mgr package
|
|
rm -rf "${pkgdir}"/usr/{bin/ceph-mgr,share/ceph/mgr,lib/systemd/system/ceph-mgr*}
|
|
|
|
# remove _test_ binaries from the package, not needed
|
|
find "${pkgdir}/usr/bin" -maxdepth 1 -type f -iname 'ceph_test_*' -delete
|
|
|
|
# install tmpfiles.d and sysusers.d stuff
|
|
install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/systemd/ceph.tmpfiles.d" \
|
|
"${pkgdir}/usr/lib/tmpfiles.d/${pkgbase}.conf"
|
|
install -Dm644 "${srcdir}/ceph.sysusers" \
|
|
"${pkgdir}/usr/lib/sysusers.d/${pkgbase}.conf"
|
|
|
|
# remove debian init script
|
|
rm -rf "${pkgdir}/etc/init.d"
|
|
|
|
# remove drop.ceph.com ssh stuff
|
|
rm -f "${pkgdir}"/usr/share/ceph/id_rsa_drop.ceph.com
|
|
rm -f "${pkgdir}"/usr/share/ceph/id_rsa_drop.ceph.com.pub
|
|
rm -f "${pkgdir}"/usr/share/ceph/known_hosts_drop.ceph.com
|
|
|
|
# fix bash completions path
|
|
install -d -m 755 "${pkgdir}/usr/share/bash-completion"
|
|
mv "${pkgdir}"/{etc/bash_completion.d,usr/share/bash-completion/completions}
|
|
|
|
# fix EnvironmentFile location in systemd service files
|
|
sed -i 's|/etc/sysconfig/|/etc/conf.d/|g' "${pkgdir}"/usr/lib/systemd/system/*.service
|
|
|
|
# prepare some paths and set correct permissions
|
|
install -D -d -m750 -o 0 -g 340 "${pkgdir}/etc/ceph"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/log/ceph"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph/bootstrap-mds"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph/bootstrap-osd"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph/bootstrap-rgw"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph/mon"
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph/osd"
|
|
}
|
|
|
|
package_ceph-mgr() {
|
|
depends=("ceph=${pkgver}-${pkgrel}" "ceph-libs=${pkgver}-${pkgrel}"
|
|
'bash' 'boost-libs' 'coffeescript' 'curl' 'gperftools' 'nodejs' 'nss'
|
|
'python' 'python-cherrypy' 'python-flask-restful' 'python-pecan'
|
|
'python-pyjwt' 'python-routes' 'python-jsonpatch' 'python-more-itertools' 'python-numpy'
|
|
'python-scipy' 'python-six')
|
|
optdepends=('python-influxdb: influx module'
|
|
'python-kubernetes: rook module'
|
|
'python-prometheus_client: prometheus module'
|
|
'python-remoto: ssh module')
|
|
conflicts=('ceph<14.2.1-1')
|
|
|
|
cd "${srcdir}/${pkgbase}-${pkgver}"
|
|
|
|
# main install
|
|
VERBOSE=1 make DESTDIR="${pkgdir}" -C build install
|
|
|
|
# fix sbin dir (cmake opt seems to have no effect)
|
|
mv "${pkgdir}"/usr/sbin/* "${pkgdir}/usr/bin/"
|
|
rm -rf "${pkgdir}/usr/sbin"
|
|
|
|
# remove everything except mgr related stuff, rest is in ceph/ceph-libs
|
|
rm -rf "${pkgdir}"/usr/lib/{ceph/{compressor,crypto,erasure-code},rados-classes}
|
|
rm -rf "${pkgdir}/usr/include"
|
|
find "${pkgdir}/usr/bin" -maxdepth 1 -type f -not -name 'ceph-mgr' -delete
|
|
find "${pkgdir}"/usr/lib/systemd/system -maxdepth 1 -type f -not -iname 'ceph-mgr*' -delete
|
|
find "${pkgdir}"/usr/lib -maxdepth 1 -type f -delete
|
|
find "${pkgdir}"/usr/lib -maxdepth 1 -type l -delete
|
|
rm -rf "${pkgdir}"/etc
|
|
rm -rf "${pkgdir}"/var
|
|
rm -rf "${pkgdir}"/usr/lib/{ceph,sysusers.d,tmpfiles.d}
|
|
rm -rf "${pkgdir}"/usr/lib/python*
|
|
rm -rf "${pkgdir}"/usr/share/{bash-completion,doc,java,man}
|
|
|
|
# remove debian init script
|
|
rm -rf "${pkgdir}/etc/init.d"
|
|
|
|
# remove drop.ceph.com ssh stuff
|
|
rm -f "${pkgdir}"/usr/share/ceph/id_rsa_drop.ceph.com
|
|
rm -f "${pkgdir}"/usr/share/ceph/id_rsa_drop.ceph.com.pub
|
|
rm -f "${pkgdir}"/usr/share/ceph/known_hosts_drop.ceph.com
|
|
|
|
# fix EnvironmentFile location in systemd service files
|
|
sed -i 's|/etc/sysconfig/|/etc/conf.d/|g' "${pkgdir}"/usr/lib/systemd/system/*.service
|
|
|
|
# prepare some paths and set correct permissions
|
|
install -D -d -m750 -o 340 -g 340 "${pkgdir}/var/lib/ceph/mgr"
|
|
}
|
|
|
|
# vim:set ts=2 sw=2 et:
|