Bugfix: make the arvados-docker-cleaner packages install their systemd
authorWard Vandewege <ward@jhvc.com>
Thu, 7 May 2020 14:20:50 +0000 (10:20 -0400)
committerWard Vandewege <ward@jhvc.com>
Thu, 7 May 2020 14:20:50 +0000 (10:20 -0400)
unit file in the correct directory.

closes #16373

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@jhvc.com>

build/run-library.sh

index fd37f632b0350fac411e5d3e2fb819c8c045d7af..beb23f563a637abe99186a92f6698eed3e993b4d 100755 (executable)
@@ -638,7 +638,8 @@ fpm_build_virtualenv () {
   COMMAND_ARR+=('-n' "$PYTHON_PKG")
   COMMAND_ARR+=('-C' "build")
 
-  if [[ -e "$WORKSPACE/$PKG_DIR/$PKG.service" ]]; then
+  systemd_unit="$WORKSPACE/$PKG_DIR/$PKG.service"
+  if [[ -e "${systemd_unit}" ]]; then
     COMMAND_ARR+=('--after-install' "${WORKSPACE}/build/go-python-package-scripts/postinst")
     COMMAND_ARR+=('--before-remove' "${WORKSPACE}/build/go-python-package-scripts/prerm")
   fi
@@ -671,6 +672,12 @@ fpm_build_virtualenv () {
     COMMAND_ARR+=('--depends' "$i")
   done
 
+  # make sure the systemd service file ends up in the right place
+  # currently only used by arvados-docker-cleaner
+  if [[ -e "${systemd_unit}" ]]; then
+    COMMAND_ARR+=("usr/share/python3/dist/$PKG/share/doc/$PKG/$PKG.service=/lib/systemd/system/$PKG.service")
+  fi
+
   COMMAND_ARR+=("${fpm_args[@]}")
 
   # Make sure to install all our package binaries in /usr/bin.