diff --git a/conf/paperless.conf.example b/conf/paperless.conf.example index 81304ec..bb1b1dd 100644 --- a/conf/paperless.conf.example +++ b/conf/paperless.conf.example @@ -81,7 +81,7 @@ PAPERLESS_CONSUMER_IGNORE_PATTERNS=[".DS_STORE/*", "._*", ".stfolder/*", ".*"] # Binaries #PAPERLESS_CONVERT_BINARY=/usr/bin/convert -#PAPERLESS_GS_BINARY=/usr/bin/gs +PAPERLESS_GS_BINARY=__INSTALL_DIR__/ghostscript/bin/gs #PAPERLESS_OPTIPNG_BINARY=/usr/bin/optipng # YunoHost tweaks diff --git a/manifest.toml b/manifest.toml index 3aa2cf5..6a4ef8f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,6 +61,10 @@ ram.runtime = "350M" autoupdate.strategy = "latest_github_release" autoupdate.asset = "paperless-ngx-.*.tar.xz" + [resources.sources.gs] + url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10021/ghostpdl-10.02.1.tar.gz" + sha256 = "25399af0ef5bb94f2a13c91dc785c128d14f16744c4c92fa7c86e011c23151d8" + [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index 43462c2..d28a2ea 100755 --- a/scripts/install +++ b/scripts/install @@ -17,6 +17,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/ghostscript" --source_id="gs" + chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -55,6 +57,20 @@ pushd $install_dir ) popd +#================================================= +# BUILD GHOSTCRIPT SPECIFIC VERSION +#================================================= +ynh_script_progression --message="Building Ghostscript dependency..." + +pushd $install_dir/ghostscript + ./configure + make + make install +popd + +chown -R $app:$app "$install_dir/ghostscript" +chmod 755 $install_dir/ghostscript/bin/gs + #================================================= # CREATE DATA DIRECTORY #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 78ad9e1..914e689 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,6 +95,25 @@ pushd $install_dir ) popd +#================================================= +# BUILD GHOSTCRIPT SPECIFIC VERSION +#================================================= +if [ ! -f $install_dir/ghostscript/bin/gs ] && [ grep -q "10.02.1" $($install_dir/ghostscript/bin/gs -v) ] +then + ynh_script_progression --message="Building Ghostscript dependency..." + + ynh_setup_source --dest_dir="$install_dir/ghostscript" --source_id="gs" --full_replace + + pushd $install_dir/ghostscript + ./configure + make + make install + popd + + chown -R $app:$app "$install_dir/ghostscript" + chmod 755 $install_dir/ghostscript/bin/gs +fi + #================================================= # UPDATE A CONFIG FILE #=================================================