mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 01:46:10 -04:00
Merge pull request #402 from linuxserver/universal-calibre-arm
This commit is contained in:
+4
-17
@@ -9,24 +9,11 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
|
|||||||
LABEL maintainer="chbmb"
|
LABEL maintainer="chbmb"
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** Install packages ****" && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y \
|
|
||||||
xz-utils && \
|
|
||||||
echo "**** Fetch calibre bin ****" && \
|
|
||||||
if [ -z ${CALIBRE_RELEASE+x} ]; then \
|
|
||||||
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
|
|
||||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
|
||||||
fi && \
|
|
||||||
CALIBRE_RELEASE=$(echo "${CALIBRE_RELEASE}" | sed 's/^v//g' ) && \
|
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
/root-layer/app/calibre && \
|
/root-layer && \
|
||||||
curl -o \
|
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
|
||||||
/tmp/calibre.txz -L \
|
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
|
||||||
"https://download.calibre-ebook.com/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE}-x86_64.txz" && \
|
echo $CALIBRE_RELEASE > /root-layer/CALIBRE_RELEASE
|
||||||
tar xf \
|
|
||||||
/tmp/calibre.txz \
|
|
||||||
-C /root-layer/app/calibre
|
|
||||||
|
|
||||||
# copy local files
|
# copy local files
|
||||||
COPY root/ /root-layer/
|
COPY root/ /root-layer/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Calibre - Docker mod for Ubuntu-based x86_64 containers
|
# Calibre - Docker mod for 64-bit Ubuntu-based containers
|
||||||
|
|
||||||
This mod adds the calibre binary to calibre-web, or other *Ubuntu-based* containers (**x86_64 only**), for ebook conversions.
|
This mod adds the calibre binary to calibre-web, or other *64-bit Ubuntu-based* containers, for ebook conversions.
|
||||||
|
|
||||||
In calibre-web docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:universal-calibre` to enable.
|
In calibre-web docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:universal-calibre` to enable.
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
if [[ ! "$(uname -m)" == "x86_64" ]]; then
|
if [[ "$(uname -m)" == "armv7l" ]]; then
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
********************************************************
|
********************************************************
|
||||||
********************************************************
|
********************************************************
|
||||||
* *
|
* *
|
||||||
* !!!! *
|
* !!!! *
|
||||||
* This mod is only supported on x86_64. *
|
* This mod is not supported on armhf. *
|
||||||
* *
|
* *
|
||||||
********************************************************
|
********************************************************
|
||||||
********************************************************
|
********************************************************
|
||||||
@@ -31,30 +31,58 @@ fi
|
|||||||
|
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
|
CALIBRE_RELEASE="$(cat /CALIBRE_RELEASE)"
|
||||||
|
PACKAGES+=("xz-utils")
|
||||||
|
|
||||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libGL.so.1 ]; then
|
if [ ! -L /usr/lib/x86_64-linux-gnu/libGL.so.1 ]; then
|
||||||
PACKAGES+=("libgl1-mesa-glx")
|
PACKAGES+=("libgl1-mesa-glx")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libxdamage.so.1 ]; then
|
if [ ! -L /usr/lib/x86_64-linux-gnu/libxdamage.so.1 ]; then
|
||||||
PACKAGES+=("libxdamage1")
|
PACKAGES+=("libxdamage1")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libEGL.so.1 ]; then
|
if [ ! -L /usr/lib/x86_64-linux-gnu/libEGL.so.1 ]; then
|
||||||
PACKAGES+=("libegl1")
|
PACKAGES+=("libegl1")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 ]; then
|
if [ ! -L /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 ]; then
|
||||||
PACKAGES+=("libxkbcommon0")
|
PACKAGES+=("libxkbcommon0")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 ]; then
|
if [ ! -L /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 ]; then
|
||||||
PACKAGES+=("libopengl0")
|
PACKAGES+=("libopengl0")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -v "PACKAGES[@]" ]; then
|
if [ -v "PACKAGES[@]" ]; then
|
||||||
apt-get install -y "${PACKAGES[@]}"
|
apt-get install -y "${PACKAGES[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e /usr/bin/calibre-server ]; then
|
echo "**** Fetching calibre bin ****"
|
||||||
/app/calibre/calibre_postinstall
|
if [ -z ${CALIBRE_RELEASE+x} ]; then
|
||||||
|
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
|
||||||
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p \
|
||||||
|
/app/calibre
|
||||||
|
|
||||||
|
if [ "$(uname -m)" == "x86_64" ]; then
|
||||||
|
curl -o \
|
||||||
|
/tmp/calibre.txz -L \
|
||||||
|
"https://github.com/kovidgoyal/calibre/releases/download/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE:1}-x86_64.txz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(uname -m)" == "aarch64" ]; then
|
||||||
|
curl -o \
|
||||||
|
/tmp/calibre.txz -L \
|
||||||
|
"https://github.com/kovidgoyal/calibre/releases/download/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE:1}-arm64.txz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
tar xf \
|
||||||
|
/tmp/calibre.txz \
|
||||||
|
-C /app/calibre
|
||||||
|
|
||||||
|
if [ ! -e /usr/bin/calibre-server ]; then
|
||||||
|
/app/calibre/calibre_postinstall
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user