summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2018-06-13 10:45:58 -0700
committerPatrick McLean <chutzpah@gentoo.org>2018-06-13 10:51:19 -0700
commit15907512d886d53b2f4559b740eb69eb127e7a07 (patch)
treec457e52e5576a498c10f3f7eb100af61cd2c22e0 /sys-cluster/ceph/files
parentx11-misc/xdg-utils: Format metadata (diff)
downloadgentoo-15907512d886d53b2f4559b740eb69eb127e7a07.tar.gz
gentoo-15907512d886d53b2f4559b740eb69eb127e7a07.tar.bz2
gentoo-15907512d886d53b2f4559b740eb69eb127e7a07.zip
sys-cluster/ceph: Version bump to 13.2.0 (unkeyworded for the moment)
Closes: https://bugs.gentoo.org/657430 Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'sys-cluster/ceph/files')
-rw-r--r--sys-cluster/ceph/files/ceph-13.2.0-boost-sonames.patch166
-rw-r--r--sys-cluster/ceph/files/ceph-13.2.0-cflags.patch26
-rw-r--r--sys-cluster/ceph/files/ceph-13.2.0-mgr-python-version.patch16
-rw-r--r--sys-cluster/ceph/files/ceph-13.2.0-no-virtualenvs.patch78
-rw-r--r--sys-cluster/ceph/files/make-node-frontend-tarball.bash140
5 files changed, 426 insertions, 0 deletions
diff --git a/sys-cluster/ceph/files/ceph-13.2.0-boost-sonames.patch b/sys-cluster/ceph/files/ceph-13.2.0-boost-sonames.patch
new file mode 100644
index 000000000000..8de09b91d8ae
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-13.2.0-boost-sonames.patch
@@ -0,0 +1,166 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2f997d03f8..748cb190e6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -591,7 +591,7 @@ set(BOOST_COMPONENTS
+ set(BOOST_HEADER_COMPONENTS container)
+
+ if(WITH_MGR)
+- list(APPEND BOOST_COMPONENTS python)
++ list(APPEND BOOST_COMPONENTS python-${EPYTHON_VERSION})
+ endif()
+ if(WITH_BOOST_CONTEXT)
+ list(APPEND BOOST_COMPONENTS context coroutine)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 3d3b4c0919..94ab42ef9f 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -630,12 +630,12 @@ set(ceph_common_objs
+ $<TARGET_OBJECTS:crush_objs>)
+ set(ceph_common_deps
+ json_spirit erasure_code ${LIB_RESOLV}
+- Boost::thread
+- Boost::system
+- Boost::random
+- Boost::program_options
+- Boost::date_time
+- Boost::iostreams
++ boost_thread
++ boost_system
++ boost_random
++ boost_program_options
++ boost_date_time
++ boost_iostreams
+ ${BLKID_LIBRARIES}
+ ${Backtrace_LIBRARIES}
+ ${BLKIN_LIBRARIES}
+@@ -759,7 +759,7 @@ if (WITH_MGR)
+ $<TARGET_OBJECTS:heap_profiler_objs>)
+ target_include_directories(ceph-mgr SYSTEM PRIVATE "${PYTHON_INCLUDE_DIRS}")
+ target_link_libraries(ceph-mgr osdc client global-static ceph-common
+- Boost::python ${MGR_PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
++ boost_python-${EPYTHON_VERSION} ${MGR_PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
+ install(TARGETS ceph-mgr DESTINATION bin)
+ endif (WITH_MGR)
+
+@@ -888,7 +888,7 @@ set(ceph_mds_srcs
+ ceph_mds.cc)
+ add_executable(ceph-mds ${ceph_mds_srcs})
+ target_link_libraries(ceph-mds mds ${CMAKE_DL_LIBS} global-static ceph-common
+- Boost::thread)
++ boost_thread)
+ install(TARGETS ceph-mds DESTINATION bin)
+
+ add_subdirectory(erasure-code)
+diff --git a/src/rbd_replay/CMakeLists.txt b/src/rbd_replay/CMakeLists.txt
+index e9d3804c5f..5c6eb58de1 100644
+--- a/src/rbd_replay/CMakeLists.txt
++++ b/src/rbd_replay/CMakeLists.txt
+@@ -36,7 +36,7 @@ if(HAVE_BABELTRACE)
+ global
+ babeltrace
+ babeltrace-ctf
+- Boost::date_time
++ boost_date_time
+ )
+ install(TARGETS rbd-replay-prep DESTINATION bin)
+ endif(HAVE_BABELTRACE)
+diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt
+index c1edd3b882..000c8daaf8 100644
+--- a/src/rgw/CMakeLists.txt
++++ b/src/rgw/CMakeLists.txt
+@@ -162,7 +162,7 @@ target_link_libraries(rgw_a librados cls_otp_client cls_lock_client cls_rgw_clie
+
+ if (WITH_RADOSGW_BEAST_FRONTEND)
+ target_compile_definitions(rgw_a PUBLIC BOOST_COROUTINES_NO_DEPRECATION_WARNING)
+- target_link_libraries(rgw_a Boost::coroutine Boost::context)
++ target_link_libraries(rgw_a boost_coroutine boost_context)
+ endif()
+
+ if (WITH_CURL_OPENSSL OR (WITH_RADOSGW_BEAST_FRONTEND AND WITH_RADOSGW_BEAST_OPENSSL))
+diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
+index a43335e825..a0d056faaa 100644
+--- a/src/test/CMakeLists.txt
++++ b/src/test/CMakeLists.txt
+@@ -147,7 +147,7 @@ add_executable(ceph_omapbench
+ )
+ target_link_libraries(ceph_omapbench
+ librados
+- Boost::program_options
++ boost_program_options
+ global
+ ${BLKID_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+diff --git a/src/test/erasure-code/CMakeLists.txt b/src/test/erasure-code/CMakeLists.txt
+index 4ba31ab2a8..ab66208b57 100644
+--- a/src/test/erasure-code/CMakeLists.txt
++++ b/src/test/erasure-code/CMakeLists.txt
+@@ -2,15 +2,15 @@
+ add_executable(ceph_erasure_code_benchmark
+ ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
+ ceph_erasure_code_benchmark.cc)
+-target_link_libraries(ceph_erasure_code_benchmark ceph-common Boost::program_options global ${CMAKE_DL_LIBS})
++target_link_libraries(ceph_erasure_code_benchmark ceph-common boost_program_options global ${CMAKE_DL_LIBS})
+ install(TARGETS ceph_erasure_code_benchmark
+ DESTINATION bin)
+
+ add_executable(ceph_erasure_code_non_regression ceph_erasure_code_non_regression.cc)
+-target_link_libraries(ceph_erasure_code_non_regression ceph-common Boost::program_options global ${CMAKE_DL_LIBS})
++target_link_libraries(ceph_erasure_code_non_regression ceph-common boost_program_options global ${CMAKE_DL_LIBS})
+
+ add_executable(ceph_erasure_code ceph_erasure_code.cc)
+-target_link_libraries(ceph_erasure_code ceph-common Boost::program_options global ${CMAKE_DL_LIBS})
++target_link_libraries(ceph_erasure_code ceph-common boost_program_options global ${CMAKE_DL_LIBS})
+ install(TARGETS ceph_erasure_code
+ DESTINATION bin)
+
+diff --git a/src/test/librados/CMakeLists.txt b/src/test/librados/CMakeLists.txt
+index 1c909ee1ce..7c1ef32df1 100644
+--- a/src/test/librados/CMakeLists.txt
++++ b/src/test/librados/CMakeLists.txt
+@@ -61,7 +61,7 @@ set_target_properties(ceph_test_rados_api_asio PROPERTIES COMPILE_FLAGS
+ target_link_libraries(ceph_test_rados_api_asio global
+ librados ${UNITTEST_LIBS})
+ if(WITH_BOOST_CONTEXT)
+- target_link_libraries(ceph_test_rados_api_asio Boost::coroutine Boost::context)
++ target_link_libraries(ceph_test_rados_api_asio boost_coroutine boost_context)
+ endif()
+
+ # ceph_test_rados_api_list
+@@ -147,7 +147,7 @@ add_executable(ceph_test_rados_api_tier
+ set_target_properties(ceph_test_rados_api_tier PROPERTIES COMPILE_FLAGS
+ ${UNITTEST_CXX_FLAGS})
+ target_link_libraries(ceph_test_rados_api_tier
+- librados global ${UNITTEST_LIBS} Boost::system radostest)
++ librados global ${UNITTEST_LIBS} boost_system radostest)
+
+ # ceph_test_rados_api_snapshots
+ add_executable(ceph_test_rados_api_snapshots
+diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
+index e0844ec0c7..886839302c 100644
+--- a/src/tools/CMakeLists.txt
++++ b/src/tools/CMakeLists.txt
+@@ -29,20 +29,20 @@ install(PROGRAMS
+ endif(WITH_TESTS)
+
+ add_executable(ceph-osdomap-tool ceph_osdomap_tool.cc)
+-target_link_libraries(ceph-osdomap-tool os global Boost::program_options)
++target_link_libraries(ceph-osdomap-tool os global boost_program_options)
+ install(TARGETS ceph-osdomap-tool DESTINATION bin)
+
+ add_executable(ceph-monstore-tool
+ ceph_monstore_tool.cc
+ ../mgr/mgr_commands.cc)
+-target_link_libraries(ceph-monstore-tool os global Boost::program_options)
++target_link_libraries(ceph-monstore-tool os global boost_program_options)
+ install(TARGETS ceph-monstore-tool DESTINATION bin)
+
+ add_executable(ceph-objectstore-tool
+ ceph_objectstore_tool.cc
+ rebuild_mondb.cc
+ RadosDump.cc)
+-target_link_libraries(ceph-objectstore-tool osd os global Boost::program_options ${CMAKE_DL_LIBS})
++target_link_libraries(ceph-objectstore-tool osd os global boost_program_options ${CMAKE_DL_LIBS})
+ if(WITH_FUSE)
+ target_link_libraries(ceph-objectstore-tool fuse)
+ endif(WITH_FUSE)
diff --git a/sys-cluster/ceph/files/ceph-13.2.0-cflags.patch b/sys-cluster/ceph/files/ceph-13.2.0-cflags.patch
new file mode 100644
index 000000000000..b275a177da35
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-13.2.0-cflags.patch
@@ -0,0 +1,26 @@
+diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake
+index d6572115a4..cc0bdddc9f 100644
+--- a/cmake/modules/BuildBoost.cmake
++++ b/cmake/modules/BuildBoost.cmake
+@@ -62,7 +62,7 @@ function(do_build_boost version)
+ else()
+ list(APPEND boost_features "address-model=32")
+ endif()
+- set(BOOST_CXXFLAGS "-fPIC -w") # check on arm, etc <---XXX
++ set(BOOST_CXXFLAGS "${CMAKE_CXX_FLAGS} -fPIC -w") # check on arm, etc <---XXX
+ list(APPEND boost_features "cxxflags=${BOOST_CXXFLAGS}")
+
+ list(FIND Boost_BUILD_COMPONENTS "python" with_python)
+diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt
+index 5a80aa539c..8d6ff5c8f0 100644
+--- a/src/compressor/zstd/CMakeLists.txt
++++ b/src/compressor/zstd/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ # zstd
+
+ # libzstd - build it statically
+-set(ZSTD_C_FLAGS "-fPIC -Wno-unused-variable -O3")
++set(ZSTD_C_FLAGS "-fPIC -Wno-unused-variable $ENV{CFLAGS} -O3")
+
+ include(ExternalProject)
+ ExternalProject_Add(zstd_ext
diff --git a/sys-cluster/ceph/files/ceph-13.2.0-mgr-python-version.patch b/sys-cluster/ceph/files/ceph-13.2.0-mgr-python-version.patch
new file mode 100644
index 000000000000..0dc90ebeaef3
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-13.2.0-mgr-python-version.patch
@@ -0,0 +1,16 @@
+diff --git a/src/pybind/CMakeLists.txt b/src/pybind/CMakeLists.txt
+index c996cd9402..f99765702b 100644
+--- a/src/pybind/CMakeLists.txt
++++ b/src/pybind/CMakeLists.txt
+@@ -62,11 +62,6 @@ foreach(python_version ${py_vers})
+ endforeach()
+
+ if(WITH_MGR)
+- if(NOT WITH_PYTHON2 AND MGR_PYTHON_VERSION_MAJOR EQUAL 2)
+- message(FATAL_ERROR "mgr plugins require python2 binding")
+- elseif(NOT WITH_PYTHON3 AND MGR_PYTHON_VERSION_MAJOR EQUAL 3)
+- message(FATAL_ERROR "mgr plugins require python3 binding")
+- endif()
+ # Location needs to match default setting for mgr_module_path, currently:
+ # OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr")
+ install(DIRECTORY
diff --git a/sys-cluster/ceph/files/ceph-13.2.0-no-virtualenvs.patch b/sys-cluster/ceph/files/ceph-13.2.0-no-virtualenvs.patch
new file mode 100644
index 000000000000..470dbaeb3c0b
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-13.2.0-no-virtualenvs.patch
@@ -0,0 +1,78 @@
+diff --git a/src/ceph-detect-init/CMakeLists.txt b/src/ceph-detect-init/CMakeLists.txt
+index 6e5946b784..233cccfc9b 100644
+--- a/src/ceph-detect-init/CMakeLists.txt
++++ b/src/ceph-detect-init/CMakeLists.txt
+@@ -2,8 +2,8 @@ set(CEPH_DETECT_INIT_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-detect-init-virtua
+
+ add_custom_target(ceph-detect-init
+ COMMAND
+- ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=python2.7 ${CEPH_DETECT_INIT_VIRTUALENV} &&
+- ${CEPH_DETECT_INIT_VIRTUALENV}/bin/pip install --no-index --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-detect-init/wheelhouse -e .
++ #${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=python2.7 ${CEPH_DETECT_INIT_VIRTUALENV} &&
++ #${CEPH_DETECT_INIT_VIRTUALENV}/bin/pip install --no-index --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-detect-init/wheelhouse -e .
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-detect-init
+ COMMENT "ceph-detect-init is being created")
+ add_dependencies(tests ceph-detect-init)
+diff --git a/src/ceph-disk/CMakeLists.txt b/src/ceph-disk/CMakeLists.txt
+index 00aaec4a80..b0700c488f 100644
+--- a/src/ceph-disk/CMakeLists.txt
++++ b/src/ceph-disk/CMakeLists.txt
+@@ -2,8 +2,8 @@ set(CEPH_DISK_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-disk-virtualenv)
+
+ add_custom_target(ceph-disk
+ COMMAND
+- ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=python2.7 ${CEPH_DISK_VIRTUALENV} &&
+- ${CEPH_DISK_VIRTUALENV}/bin/pip install --no-index --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-disk/wheelhouse -e .
++ #${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=python2.7 ${CEPH_DISK_VIRTUALENV} &&
++ #${CEPH_DISK_VIRTUALENV}/bin/pip install --no-index --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-disk/wheelhouse -e .
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-disk
+ COMMENT "ceph-disk is being created")
+ add_dependencies(tests ceph-disk)
+diff --git a/src/pybind/mgr/dashboard/CMakeLists.txt b/src/pybind/mgr/dashboard/CMakeLists.txt
+index 2b050f6c6e..e9fb87f76b 100644
+--- a/src/pybind/mgr/dashboard/CMakeLists.txt
++++ b/src/pybind/mgr/dashboard/CMakeLists.txt
+@@ -2,7 +2,7 @@ set(MGR_DASHBOARD_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-dashboard-virtualenv)
+
+ add_custom_target(mgr-dashboard-test-venv
+ COMMAND
+- ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${MGR_DASHBOARD_VIRTUALENV}
++ #${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${MGR_DASHBOARD_VIRTUALENV}
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard
+ COMMENT "dashboard tests virtualenv is being created")
+ add_dependencies(tests mgr-dashboard-test-venv)
+@@ -13,9 +13,9 @@ set(mgr-dashboard-nodeenv ${CMAKE_CURRENT_BINARY_DIR}/node-env)
+
+ add_custom_command(
+ OUTPUT "${mgr-dashboard-nodeenv}/bin/npm"
+- COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${mgr-dashboard-nodeenv}
+- COMMAND ${mgr-dashboard-nodeenv}/bin/pip install nodeenv
+- COMMAND ${mgr-dashboard-nodeenv}/bin/nodeenv -p -n 8.10.0
++ #COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${mgr-dashboard-nodeenv}
++ #COMMAND ${mgr-dashboard-nodeenv}/bin/pip install nodeenv
++ #COMMAND ${mgr-dashboard-nodeenv}/bin/nodeenv -p -n 8.10.0
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "dashboard nodeenv is being installed"
+ )
+@@ -27,7 +27,7 @@ add_custom_target(mgr-dashboard-nodeenv
+
+ add_custom_command(
+ OUTPUT "${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend/node_modules"
+- COMMAND . ${mgr-dashboard-nodeenv}/bin/activate && npm install && deactivate
++ #COMMAND . ${mgr-dashboard-nodeenv}/bin/activate && npm install && deactivate
+ DEPENDS frontend/package.json
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend
+ COMMENT "dashboard frontend dependencies are being installed"
+@@ -62,9 +62,11 @@ else()
+ set(npm_command npm run build)
+ endif()
+
++LIST(APPEND CMAKE_PROGRAM_PATH ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend/node_modules/.bin)
++
+ add_custom_command(
+ OUTPUT "${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend/dist"
+- COMMAND . ${mgr-dashboard-nodeenv}/bin/activate && ${npm_command} && deactivate
++ COMMAND PREFIX="${CMAKE_SOURCE_DIR}" ${npm_command}
+ DEPENDS ${frontend_src} frontend/node_modules
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend
+ COMMENT "dashboard frontend is being created"
diff --git a/sys-cluster/ceph/files/make-node-frontend-tarball.bash b/sys-cluster/ceph/files/make-node-frontend-tarball.bash
new file mode 100644
index 000000000000..0a8015ffa985
--- /dev/null
+++ b/sys-cluster/ceph/files/make-node-frontend-tarball.bash
@@ -0,0 +1,140 @@
+#!/bin/bash
+
+frontend_path="src/pybind/mgr/dashboard/frontend"
+node_dir="node_modules"
+output_name_format="ceph-%s-frontend-node-modules.tar.xz"
+cache_dir_format="ceph-%s-npm-cache"
+
+# regexes for modules to remove
+remove_modules=(
+ "^karma.*"
+ "^jasmine.*"
+ ".+/jasmine.*"
+ "^tslint.*"
+ "^codelyzer"
+ "^protractor"
+ "^ts-node"
+)
+
+# location to find dependencies to prune
+node_dep_location="devDependencies"
+
+# node package files
+node_package_file="package.json"
+node_package_lock="package-lock.json"
+
+# system commands needed
+dependencies=(
+ wget
+ git
+ gzip
+ jq
+ tar
+ xz
+)
+
+check_deps() {
+ local dep
+
+ for dep in "${dependencies[@]}"; do
+ if ! command -v "${dep}" >/dev/null; then
+ printf '%s: ERROR could not find required command "%s"\n' "${appname}" "${dep}" >&2
+ exit 1
+ fi
+ done
+
+ # make sure that jq was compiled with support for regexes
+ if ! jq -c 'map( select(. | test("TEST"; "i")))' <<< '{"TEST": "TEST"}' >/dev/null; then
+ printf '%s: ERROR: jq does not support regular expressions, make sure the "oniguruma" USE flag is enabled\n' \
+ "${appname}"
+ exit 1
+ fi
+ :
+}
+
+get_npm_packages() {
+ local tempfile jq_regex full_cache_dir
+
+ full_cache_dir="${PWD}/${cache_dir}"
+
+ pushd "${source_path}/${frontend_path}" > /dev/null
+ if [[ ! -r "${node_package_file}" ]]; then
+ printf '%s: ERROR: could not find "%s" in "%s"\n' "${appname}" \
+ "${node_package_file}" "${frontend_path}"
+ exit 1
+ fi
+
+ tempfile="$(TMPDIR="." mktemp packages-XXXXX.json)"
+
+ jq_regex="$(printf "%s|" "${remove_modules[@]}")"
+
+ # filter out test only deps that pull in precompiled binaries
+ # shellcheck disable=SC2031
+ jq --monochrome-output --raw-output --exit-status \
+ '."'"${node_dep_location}"'"|=with_entries(select(.key|test("('"${jq_regex%|}"')")|not))' \
+ "${node_package_file}" > "${tempfile}"
+
+ # make sure output is still valid JSON
+ jq . --exit-status "${tempfile}" > /dev/null
+
+ mv "${tempfile}" "${node_package_file}"
+
+ rm -rf "${full_cache_dir:?}" "${node_dir:?}" "${node_package_lock:?}"
+
+ npm install --ignore-scripts --cache="${full_cache_dir}"
+
+ popd >/dev/null
+}
+
+main() {
+ local appname source_path version cache_dir
+
+ set -e
+ set -o pipefail
+ shopt -s nullglob
+
+ appname=$(basename "${0}")
+ source_path="${1}"
+ version="${2}"
+
+ if [[ -z ${source_path} || -z ${version} ]]; then
+ printf 'Syntax: %s <source directory> <version>\n' "${appname}" >&2
+ return 1
+
+ elif [[ ! -d ${source_path} ]]; then
+ printf '%s: ERROR: Not a directory: %s\n' "${appname}" "${source_path}"
+ return 1
+ fi
+
+ check_deps
+
+ # shellcheck disable=SC2059
+ cache_dir="$(printf -- "${cache_dir_format}\\n" "${version}")"
+
+ get_npm_packages
+ pack_tarball
+}
+
+pack_tarball() {
+ local output
+
+ # shellcheck disable=SC2059
+ output="$(printf -- "${output_name_format}\\n" "${version}")"
+
+ tar caf "${output}" \
+ --numeric-owner \
+ --anchored \
+ --owner="root:0" \
+ --group="root:0" \
+ --exclude-vcs \
+ --transform="s:^${source_path}/:ceph-${version}/:" \
+ "${cache_dir}" \
+ "${source_path}/${frontend_path}/${node_package_file}" \
+ "${source_path}/${frontend_path}/${node_package_lock}"
+
+ printf '%s: Output written to "%s"\n' "${appname}" "${output}"
+}
+
+main "${@}"
+
+# vim:ft=sh:noet:ts=4:sts=4:sw=4: