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)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 8 Jun 2020 18:58:18 +0000 (14:58 -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 ac5dc718be1c6e36e86e743bf0805ab11c891da7..3a1ed1c1acb8d6cb4f2050648429fd73a2ee52e3 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.