aboutsummaryrefslogtreecommitdiff
path: root/bin/provision
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-06-06 08:17:18 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-06-06 08:17:18 -0300
commit515bdd658d91020c73f82b70ff001015b359adc0 (patch)
treee7c62578e2ef61bf7c9a46de91d92d37620553fe /bin/provision
downloadbookup-515bdd658d91020c73f82b70ff001015b359adc0.tar.gz
bookup-515bdd658d91020c73f82b70ff001015b359adc0.tar.bz2
Initial import
Diffstat (limited to 'bin/provision')
-rwxr-xr-xbin/provision71
1 files changed, 71 insertions, 0 deletions
diff --git a/bin/provision b/bin/provision
new file mode 100755
index 0000000..f438a5e
--- /dev/null
+++ b/bin/provision
@@ -0,0 +1,71 @@
+#!/bin/bash
+#
+# Provisioner
+#
+
+# Parameters
+DIRNAME="`dirname $0`"
+BOOKDOWN_PACKAGING="${BOOKDOWN_PACKAGING:-DEB}"
+
+# Dependencies
+DEPENDENCIES="make"
+DEPENDENCIES="$DEPENDENCIES texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-extra texlive-extra-utils texlive-xetex texlive-lang-portuguese vim-latexsuite"
+DEPENDENCIES="$DEPENDENCIES pandoc pandoc-sidenote"
+DEPENDENCIES="$DEPENDENCIES fonts-liberation fonts-linuxlibertine"
+DEPENDENCIES="$DEPENDENCIES libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev"
+DEPENDENCIES="$DEPENDENCIES r-cran-rmarkdown r-cran-magick"
+DEPENDENCIES="$DEPENDENCIES libpoppler-cpp-dev"
+DEPENDENCIES="$DEPENDENCIES graphviz"
+DEPENDENCIES="$DEPENDENCIES biber pybtex"
+
+# Additional BibTeX dependencies
+#DEPENDENCIES="$DEPENDENCIES texlive-bibtex-extra"
+
+# For pdfcrop support
+DEPENDENCIES="$DEPENDENCIES texlive-extra-utils"
+
+# Old dependencies
+#DEPENDENCIES="$DEPENDENCIES python-yaml python-cheetah python-unidecode python-pycurl python-shortuuid"
+#DEPENDNECIES="$DEPENDENCIES python-sphinx python-sphinx-bootstrap-theme python-sphinx-paramlinks python-sphinx-patchqueue python-sphinx-rtd-theme python-sphinx-gallery python-sphinxcontrib.bibtex-doc"
+#DEPENDENCIES="$DEPENDENCIES pelican hugo jekyll"
+
+# Check for sudo
+if [ "`whoami`" != "root" ]; then
+ SUDO="sudo"
+fi
+
+# Configure Debian backports
+if which trashman &> /dev/null; then
+ trashman install debian-backports
+fi
+
+# Ensure an up-to-date system
+$SUDO apt-get update && $SUDO apt-get dist-upgrade -y && \
+ $SUDO apt-get autoremove -y && $SUDO apt-get clean
+
+# Install dependencies
+$SUDO apt install -y $DEPENDENCIES
+
+# Additional software
+#$SUDO apt install -y python3-pandocfilters
+
+# Try to install pandoc-citeproc, may be unavailable on Debian bookworm onwards
+#$SUDO apt install -y pandoc-citeproc
+
+# Tufte CSS
+#$SUDO apt install cabal-install
+#$SUDO cabal update
+#$SUDO cabal install pandoc-sidenote
+#$SUDO apt install -y libghc-pandoc-sidenote-dev \
+# libghc-pandoc-sidenote-doc libghc-pandoc-sidenote-prof
+
+# Bookdown dependencies
+$SUDO apt install -y libcurl4-openssl-dev libssl-dev
+
+if [ "$BOOKDOWN_PACKAGING" == "CRAN" ]; then
+ $SUDO $DIRNAME/provision.R
+else
+ $SUDO apt install -y r-cran-bookdown
+ $SUDO apt install -y r-cran-pdftools
+ $SUDO Rscript -e 'install.packages("eulerr")'
+fi