From e8baa812a372373c8fc4cd5d7c7479c94c897418 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Thu, 15 Feb 2024 17:02:13 +0100 Subject: [PATCH] update to 2.5.2 += jbig2enc --- .gitignore | 9 ++++--- README.todo | 57 ++++++++++++++++++++---------------------- build.profile | 5 ++-- buildall.sh | 1 + cleanall.sh | 15 +++++------ jbig2enc.build.sh | 55 ++++++++++++++++++++++++++++++++++++++++ paperless-ngx.build.sh | 2 ++ 7 files changed, 101 insertions(+), 43 deletions(-) create mode 100755 jbig2enc.build.sh diff --git a/.gitignore b/.gitignore index 7a08b92..9c0ad2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,19 @@ /build.local -/logs -/paperless-ngx-* -/Python-* +/ffmpeg-* +/jbig2enc-* /leptonica-* +/logs /nginx-* /node-* +/paperless-ngx-* /pngquant-* +/Python-* /sqlite-* /tessconfigs /tessdata /tesseract-* /unpaper-* /zbar-* -/ffmpeg-* *.tar *.tar.gz *.tar.xz diff --git a/README.todo b/README.todo index c94b041..166467b 100644 --- a/README.todo +++ b/README.todo @@ -1,35 +1,32 @@ - ✔ sqlite => 3.45.1 @done (24-02-12 13:18) - https://sqlite.org/download.html - ✔ Python => 3.11.8 @done (24-02-12 16:03) - https://www.python.org/downloads/release/python-3118/ - ✔ node => 20.11.0 @done (24-02-12 16:33) - https://nodejs.org/download/release/latest-v20.x/ - ✔ unpaper => git latest @done (24-02-13 12:23) - https://github.com/unpaper/unpaper - ☐ ffmpeg ? - https://ffmpeg.org//releases/ffmpeg-6.1.1.tar.gz - ✔ zbar => 0.23.93 @done (24-02-13 12:37) - https://github.com/mchehab/zbar/releases/tag/0.23.93 - ✔ leptonica => 1.84.1 @done (24-02-13 12:40) - https://github.com/DanBloomberg/leptonica/releases - ✔ tesseract => 5.3.4 @done (24-02-13 12:50) - https://github.com/tesseract-ocr/tesseract - ✔ nginx => 1.25.3 @done (24-02-14 09:19) - https://nginx.org/download/ - ☐ conf.build-scripte sed '/kmous=/d;/XM=/d;$s/$/XM=,/' - ☐ ocrmypdf -( . profile; ocrmypdf --force-ocr ../PDFofDeath/2024-01-29\ 5650025416_B.pdf xxx.pdf ) - ---force-ocr was issued, causing transcoding. -The optional dependency 'jbig2' was not found, so some image optimizations could not be attempted. - - ☐ pngquant -The optional dependency 'pngquant' was not found, so some image optimizations could not be attempted. - - -git clone --recursive https://github.com/kornelski/pngquant.git +___________________ +Archive: + ✔ ocrmypdf @done (24-02-15 17:01) + ( . profile; ocrmypdf --force-ocr ../PDFofDeath/2024-01-29\ 5650025416_B.pdf xxx.pdf ) + --force-ocr was issued, causing transcoding. + The optional dependency 'jbig2' was not found, so some image optimizations could not be attempted. + ✔ pngquant @done (24-02-15 13:48) + git clone --recursive https://github.com/kornelski/pngquant.git + The optional dependency 'pngquant' was not found, so some image optimizations could not be attempted. + ✔ ffmpeg ? @done (24-02-15 13:47) + https://ffmpeg.org//releases/ffmpeg-6.1.1.tar.gz + ✔ nginx => 1.25.3 @done (24-02-14 09:19) + https://nginx.org/download/ + ✔ tesseract => 5.3.4 @done (24-02-13 12:50) + https://github.com/tesseract-ocr/tesseract + ✔ leptonica => 1.84.1 @done (24-02-13 12:40) + https://github.com/DanBloomberg/leptonica/releases + ✔ zbar => 0.23.93 @done (24-02-13 12:37) + https://github.com/mchehab/zbar/releases/tag/0.23.93 + ✔ unpaper => git latest @done (24-02-13 12:23) + https://github.com/unpaper/unpaper + ✔ node => 20.11.0 @done (24-02-12 16:33) + https://nodejs.org/download/release/latest-v20.x/ + ✔ Python => 3.11.8 @done (24-02-12 16:03) + https://www.python.org/downloads/release/python-3118/ + ✔ sqlite => 3.45.1 @done (24-02-12 13:18) + https://sqlite.org/download.html diff --git a/build.profile b/build.profile index f5f1fee..f36511d 100644 --- a/build.profile +++ b/build.profile @@ -1,4 +1,4 @@ -BUILD_TAG=2.5.1 +BUILD_TAG=2.5.2 . build.local @@ -21,5 +21,6 @@ BUILD_zbar=zbar-0.23.93 BUILD_leptonica=leptonica-1.84.1 BUILD_tesseract=tesseract-5.3.4 BUILD_nginx=nginx-1.25.3 +BUILD_jbig2enc=jbig2enc-0.28-17-gea05019 -BUILD_paperless=paperless-ngx-2.5.1 +BUILD_paperless=paperless-ngx-2.5.2 diff --git a/buildall.sh b/buildall.sh index 17369f6..5fe6bba 100755 --- a/buildall.sh +++ b/buildall.sh @@ -68,6 +68,7 @@ ln -fs $logfile $LOGS/build.log [ -d ${BUILD_leptonica} ] || ./leptonica.build.sh [ -d ${BUILD_tesseract} ] || ./tesseract.build.sh [ -d ${BUILD_nginx} ] || ./nginx.build.sh +[ -d ${BUILD_jbig2enc} ] || ./jbig2enc.build.sh ./nginx.conf.build.sh [ -d $PROJECT/${BUILD_paperless} ] || ./paperless-ngx.build.sh diff --git a/cleanall.sh b/cleanall.sh index 6ceb1ff..afb5879 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -7,17 +7,18 @@ set -x declare -a RMRF RMRF=( - $BUILD_sqlite - $BUILD_python - $BUILD_node $BUILD_ffmpeg - $BUILD_unpaper - $BUILD_pngquant - $BUILD_zbar + $BUILD_jbig2enc $BUILD_leptonica - $BUILD_tesseract $BUILD_nginx + $BUILD_node $BUILD_paperless + $BUILD_pngquant + $BUILD_python + $BUILD_sqlite + $BUILD_tesseract + $BUILD_unpaper + $BUILD_zbar ./logs ) diff --git a/jbig2enc.build.sh b/jbig2enc.build.sh new file mode 100755 index 0000000..9f2dbbb --- /dev/null +++ b/jbig2enc.build.sh @@ -0,0 +1,55 @@ +#!/bin/bash +{ +set -x +set -e + +. build.profile + +. ${PREFIX}/${BUILD_python}/profile +. ${PREFIX}/${BUILD_leptonica}/profile + +function B_JBIG2ENC { + +[ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } + +PREFIX=${PREFIX}/${BUILD_jbig2enc} + +mkdir -p $PREFIX + +cat >$PREFIX/profile <<-EOF +PATH=$PREFIX/bin:\$PATH +EOF + + +if [ ! -d ${BUILD_jbig2enc} ]; then + if [ ! -e ${BUILD_jbig2enc}.tar ]; then + git clone https://github.com/agl/jbig2enc.git ${BUILD_jbig2enc} + tar cf ${BUILD_jbig2enc}.tar ${BUILD_jbig2enc} + else + tar -xf ${BUILD_jbig2enc}.tar + fi +fi + +pushd ${BUILD_jbig2enc} + + +local _conf=( + --prefix ${PREFIX} + ) + +./autogen.sh + +export LDFLAGS=$(PKG_CONFIG_PATH=${PKG_CONFIG_PATH} pkg-config --libs-only-L lept) +export CPPFLAGS="-I${PROJECT}/${BUILD_leptonica}/include" + +./configure "${_conf[@]}" + +make -j $NPROC +make install + +popd +} + +B_JBIG2ENC + +} diff --git a/paperless-ngx.build.sh b/paperless-ngx.build.sh index a1bd5f7..e05ffac 100755 --- a/paperless-ngx.build.sh +++ b/paperless-ngx.build.sh @@ -10,9 +10,11 @@ set -e . ${PREFIX}/${BUILD_unpaper}/profile . ${PREFIX}/${BUILD_sqlite}/profile . ${PREFIX}/${BUILD_zbar}/profile +. ${PREFIX}/${BUILD_nginx}/profile . ${PREFIX}/${BUILD_python}/profile . ${PREFIX}/${BUILD_node}/profile . ${PREFIX}/${BUILD_leptonica}/profile +. ${PREFIX}/${BUILD_jbig2enc}/profile . ${PREFIX}/${BUILD_tesseract}/profile function B_PAPERLESS {