From 353383066964676a39652171ac9160b53992e557 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 5 Dec 2020 17:02:35 -0500 Subject: [PATCH] Set Required Docker Version In DEb Files --- debian/client/native/DEBIAN/control | 2 +- debian/client/virgl/DEBIAN/control | 2 +- debian/server/DEBIAN/control | 2 +- scripts/package.sh | 14 ++++++++++---- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/debian/client/native/DEBIAN/control b/debian/client/native/DEBIAN/control index 8a4fbb5c..33b97d8b 100644 --- a/debian/client/native/DEBIAN/control +++ b/debian/client/native/DEBIAN/control @@ -4,5 +4,5 @@ Maintainer: TheBrokenRail Description: Fun with Blocks Homepage: https://www.minecraft.net/en-us/edition/pi Architecture: all -Depends: docker.io|docker-ce, docker-compose, zenity, policykit-1, passwd, login, qemu-user-static, binfmt-support +Depends: ${DEPENDENCIES} Conflicts: minecraft-pi-virgl diff --git a/debian/client/virgl/DEBIAN/control b/debian/client/virgl/DEBIAN/control index b0af2e43..7429df48 100644 --- a/debian/client/virgl/DEBIAN/control +++ b/debian/client/virgl/DEBIAN/control @@ -4,5 +4,5 @@ Maintainer: TheBrokenRail Description: Fun with Blocks Homepage: https://www.minecraft.net/en-us/edition/pi Architecture: all -Depends: docker.io|docker-ce, docker-compose, virgl-server, zenity, policykit-1, passwd, login, qemu-user-static, binfmt-support +Depends: ${DEPENDENCIES}, virgl-server Conflicts: minecraft-pi-native diff --git a/debian/server/DEBIAN/control b/debian/server/DEBIAN/control index 5ca45454..806cf7db 100644 --- a/debian/server/DEBIAN/control +++ b/debian/server/DEBIAN/control @@ -4,4 +4,4 @@ Maintainer: TheBrokenRail Description: Fun with Blocks Homepage: https://www.minecraft.net/en-us/edition/pi Architecture: all -Depends: docker.io|docker-ce, docker-compose, qemu-user-static, binfmt-support +Depends: ${DEPENDENCIES} diff --git a/scripts/package.sh b/scripts/package.sh index 058db6bf..c6d49e14 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -3,6 +3,11 @@ # Current Version DEB_VERSION='1.0.0' +# Dependencies +REQUIRED_DOCKER_VERSION='19.03' +COMMON_DEPENDENCIES="docker.io (>=${REQUIRED_DOCKER_VERSION}) | docker-ce (>=${REQUIRED_DOCKER_VERSION}), libseccomp2 (>=2.4.2), docker-compose, qemu-user-static, binfmt-support" +CLIENT_DEPENDENCIES="zenity, policykit-1, passwd, login" + set -e # Docker Messes With SetGID @@ -16,9 +21,10 @@ mkdir -p out/deb rm -rf debian/tmp mkdir debian/tmp -# Set Version -prepare_version() { +# Prepare DEBIAN/control +prepare_control() { sed -i 's/${VERSION}/'"${DEB_VERSION}.$(date --utc '+%Y%m%d.%H%M')"'/g' "$1/DEBIAN/control" + sed -i 's/${DEPENDENCIES}/'"${COMMON_DEPENDENCIES}$2"'/g' "$1/DEBIAN/control" } # Package Client DEBs @@ -30,7 +36,7 @@ package_client() { rsync -r debian/client/common/ "debian/tmp/$1" rsync -r "debian/client/$1/" "debian/tmp/$1" cp debian/tmp/client-image.tar.gz "debian/tmp/$1/usr/share/minecraft-pi/client/image.tar.gz" - prepare_version "debian/tmp/$1" + prepare_control "debian/tmp/$1" ", ${CLIENT_DEPENDENCIES}" # Build dpkg -b "debian/tmp/$1" out/deb } @@ -45,7 +51,7 @@ package_server() { # Prepare rsync -r debian/server/ debian/tmp/server cp debian/tmp/server-image.tar.gz debian/tmp/server/usr/share/minecraft-pi/server/image.tar.gz - prepare_version debian/tmp/server + prepare_control debian/tmp/server '' # Build dpkg -b debian/tmp/server out/deb }