From fd2daca9c005ec74ce5c73e46e84a5b0a4844dd2 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 6 Apr 2018 18:03:38 -0500 Subject: [PATCH] Calibre - split RPi from others to use raspbain's testing repo, split off unstable --- roles/calibre/defaults/main.yml | 4 +++- roles/calibre/tasks/debs.yml | 17 ++++++++++------- scripts/calibre-install-latest-rpi.sh | 18 ++++++++++++++++++ scripts/calibre-install-latest.sh | 18 ++++++------------ scripts/calibre-install-unstable.sh | 18 ++++++++++++++++++ 5 files changed, 55 insertions(+), 20 deletions(-) create mode 100755 scripts/calibre-install-latest-rpi.sh create mode 100755 scripts/calibre-install-unstable.sh diff --git a/roles/calibre/defaults/main.yml b/roles/calibre/defaults/main.yml index 737072bde..8cafdb995 100644 --- a/roles/calibre/defaults/main.yml +++ b/roles/calibre/defaults/main.yml @@ -12,5 +12,7 @@ calibre_sample_book: "Metamorphosis-jackson.epub" calibre_src_url: "https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py" -calibre_debs_on_debian: true # USE TO TEST debs.yml (RASPBIAN APPROACH!) ON DEBIAN 9.X +calibre_debs_on_debian: True +# enable calibre unstable +calibre_unstable: False diff --git a/roles/calibre/tasks/debs.yml b/roles/calibre/tasks/debs.yml index 02c9e1283..b2ca6be68 100644 --- a/roles/calibre/tasks/debs.yml +++ b/roles/calibre/tasks/debs.yml @@ -5,13 +5,16 @@ # April 5 2018 raspbian is now tracking the latest Calibre with a small delay. # Should you really want the latest just run the below script standalone, it is -# strongly suggested that waiting for the lastest deb from Rasbian is the best. +# strongly suggested that waiting for the lastest deb from Raspbian is the best. -- name: Upgrade latest Calibre +- name: Upgrade to testing Calibre - RPi + command: scripts/calibre-install-latest-rpi.sh + when: is_rpi + +- name: Upgrade to tesing Calibre - non-RPi command: scripts/calibre-install-latest.sh - #when: not is_rpi + when: not is_rpi -# Oops "when: not is_rpi" causes Calibre playbook to fail on Raspbian Lite (possibly -# other OS's too). Error msg is: "Unable to start service calibre-serve: Job for -# calibre-serve.service failed because the control process exited with error code." -# Running "calibre --version" then responds with "calibre (calibre 2.75.1)". +- name: Upgrade to unstable Calibre - all + command: scripts/calibre-install-unstable.sh + when: calibre_unstable diff --git a/scripts/calibre-install-latest-rpi.sh b/scripts/calibre-install-latest-rpi.sh new file mode 100755 index 000000000..8b7bc89c2 --- /dev/null +++ b/scripts/calibre-install-latest-rpi.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Thanks to Jerry Vonau (https://github.com/jvonau) who made +# this critical breakthrough (Calibre 3.x on Raspbian) possible! +# The latest available is 3.20 available from testing +# https://packages.debian.org/search?keywords=calibre +# (SEE http://archive.raspbian.org/raspbian/pool/main/c/calibre/ ?) +# might break future updates, you have been warned + +export DEBIAN_FRONTEND=noninteractive +# Updates calibre calibre-bin to version 3.20 or ... from testing +echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sources.list.d/rpi-testing.list +apt update +apt -y install calibre calibre-bin +# Remove last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list +sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list +# Clears the cache of testing +apt update diff --git a/scripts/calibre-install-latest.sh b/scripts/calibre-install-latest.sh index 77730fa4b..aebc86ca1 100755 --- a/scripts/calibre-install-latest.sh +++ b/scripts/calibre-install-latest.sh @@ -1,26 +1,20 @@ #!/bin/bash # Thanks to Jerry Vonau (https://github.com/jvonau) who made -# this critical breakthrough (Calibre 3.x on Raspbian) possible! +# this critical breakthrough for Calibre 3.x possible! +# The latest available is 3.20 available from testing +# https://packages.debian.org/search?keywords=calibre +# (SEE http://deb.debian.org/debian/pool/main/c/calibre/ ?) +# might break future updates, you have been warned export DEBIAN_FRONTEND=noninteractive # Drags in stock desktop dependencies without too much from testing below apt -y install calibre-bin dirmngr - -# Updates calibre-bin to version 3.10 or 3.14 or ... from testing (SEE http://archive.raspbian.org/raspbian/pool/main/c/calibre/ ?) +# Updates calibre calibre-bin to version 3.20 or ... from testing apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list apt update apt -y install libqt5core5a python-lxml calibre # Remove last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list - -# Updates to calibre & calibre-bin to "very latest" 3.x from unstable -echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list.d/debian-unstable.list -apt update -apt -y install calibre -# Remove last line, safer than: rm /etc/apt/sources.list.d/debian-unstable.list -sed -i '$ d' /etc/apt/sources.list.d/debian-unstable.list - -# Clears the cache of testing and unstable apt update diff --git a/scripts/calibre-install-unstable.sh b/scripts/calibre-install-unstable.sh new file mode 100755 index 000000000..c27bfebf5 --- /dev/null +++ b/scripts/calibre-install-unstable.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Thanks to Jerry Vonau (https://github.com/jvonau) who made +# this critical breakthrough possible! +# might break future updates, you have been warned +# The latest available is 3.20 available from testing +# https://packages.debian.org/search?keywords=calibre +# might break future updates, you have been warned + +export DEBIAN_FRONTEND=noninteractive +# Updates to calibre & calibre-bin to "very latest" 3.x from unstable +echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list.d/unstable.list +apt update +apt -y install calibre calibre-bin +# Remove last line, safer than: rm /etc/apt/sources.list.d/debian-unstable.list +sed -i '$ d' /etc/apt/sources.list.d/unstable.list +# Clears the cache of testing and unstable +apt update