2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
8 # Detect rpm-based systems: the exit code of the following command is zero
10 if /usr/bin/rpm -q -f /usr/bin/rpm >/dev/null 2>&1; then
11 # Red Hat ("%{...}" is interpolated at package build time)
14 prefix="${RPM_INSTALL_PREFIX}"
17 script="$(basename "${0}")"
18 pkg="${script%.postinst}"
23 # populated from the build script
24 # dash only supports one array, $@
25 if [ "%FPM_BINARIES" != "" ]; then
29 # Install symlinks to the binary/binaries
30 if [ "$pkg" != "" ]; then
32 if [ "%FPM_BINARIES" != "" ]; then
35 if [ -e /usr/bin/$binary ]; then
36 rm -f /usr/bin/$binary
38 ln -s /usr/share/%PYTHON/dist/$pkg/bin/$binary /usr/bin/$binary
42 # special case for arvados-cwl-runner
43 if [ "${pkg#python-}" = "arvados-cwl-runner" ]; then
44 if [ -e /usr/bin/cwl-runner ]; then
45 rm -f /usr/bin/cwl-runner
47 ln -s /usr/share/%PYTHON/dist/$pkg/bin/$binary /usr/bin/cwl-runner