From 966fd11c2050c60e59bbb592bd0d35a2d8f5b173 Mon Sep 17 00:00:00 2001 From: hvmzx Date: Fri, 9 Aug 2024 19:51:28 +0200 Subject: [PATCH] style: fixed indent to 2 to match the rest --- Dockerfile | 16 +++--- .../init-mod-calibre-web-kcc-add-package/run | 54 +++++++++++++++++++ 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100755 root/etc/s6-overlay/s6-rc.d/init-mod-calibre-web-kcc-add-package/run diff --git a/Dockerfile b/Dockerfile index 9b12135..b945557 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,14 +9,14 @@ RUN chmod +rwx 'kindlegen' RUN rm kindlegen.tar.gz RUN latest_tag=$(curl -s https://api.github.com/repos/ciromattia/kcc/releases/latest | jq -rc ".tag_name") && \ - curl -L https://github.com/ciromattia/kcc/archive/refs/tags/$latest_tag.tar.gz > kcc.tar.gz && \ - tar -xzf kcc.tar.gz && \ - mv kcc-$(echo "$latest_tag" | sed 's/^.\(.*\)/\1/') kcc && \ - touch kcc/KCC_VERSION && \ - echo $latest_tag > kcc/KCC_VERSION && \ - mkdir -p /root-layer/usr/local/bin && \ - mv kindlegen /root-layer/usr/local/bin/ && \ - mv kcc /root-layer/usr/local/bin/ + curl -L https://github.com/ciromattia/kcc/archive/refs/tags/$latest_tag.tar.gz > kcc.tar.gz && \ + tar -xzf kcc.tar.gz && \ + mv kcc-$(echo "$latest_tag" | sed 's/^.\(.*\)/\1/') kcc && \ + touch kcc/KCC_VERSION && \ + echo $latest_tag > kcc/KCC_VERSION && \ + mkdir -p /root-layer/usr/local/bin && \ + mv kindlegen /root-layer/usr/local/bin/ && \ + mv kcc /root-layer/usr/local/bin/ COPY root/ /root-layer/ diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-calibre-web-kcc-add-package/run b/root/etc/s6-overlay/s6-rc.d/init-mod-calibre-web-kcc-add-package/run new file mode 100755 index 0000000..be3556f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-calibre-web-kcc-add-package/run @@ -0,0 +1,54 @@ +#!/usr/bin/with-contenv bash + +# This is the init file used for adding os or pip packages to install lists. +# It takes advantage of the built-in init-mods-package-install init script that comes with the baseimages. +# If using this, we need to make sure we set this init as a dependency of init-mods-package-install so this one runs first + +echo "**** Adding kcc dependencies (repo and pip) to package install lists ****" +if ! python3 /usr/local/bin/kcc/kcc-c2e.py > /dev/null 2>&1 ; then + echo "\ + PySide6 \ + Pillow \ + psutil \ + requests \ + python-slugify \ + raven \ + mozjpeg-lossless-optimization \ + natsort[fast] \ + distro" >> /mod-pip-packages-to-install.list + ## Ubuntu + if [ -f /usr/bin/apt ]; then + echo "\ + python3 \ + python3-pip + python3-dev \ + libpng-dev \ + libjpeg-dev \ + p7zip-full \ + p7zip-rar \ + unrar-free \ + libgl1 \ + python3-pyqt5 \ + cmake" >> /mod-repo-packages-to-install.list + fi + # Alpine + if [ -f /sbin/apk ]; then + echo "\ + cargo \ + libffi-dev \ + openssl-dev \ + python3 \ + python3-dev \ + python3 \ + py3-pip \ + libpng-dev \ + libjpeg \ + p7zip \ + unrar \ + mesa-gl \ + py3-qt5 \ + cmake" >> /mod-repo-packages-to-install.list + fi +else + echo "**** kcc dependencies already installed, skipping ****" +fi \ No newline at end of file