diff options
author | felics@felics-tablet | 2015-09-23 10:20:41 +0200 |
---|---|---|
committer | felics@felics-tablet | 2015-09-23 10:20:41 +0200 |
commit | 709e063e17caa7444595400b11950a56f6e6d736 (patch) | |
tree | 75d1d4dd8ac9222c2eadcef3d1abaf1c118c474d | |
download | aur-709e063e17caa7444595400b11950a56f6e6d736.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 54 | ||||
-rw-r--r-- | license.txt | 5 | ||||
-rwxr-xr-x | pdf-append.sh | 79 |
4 files changed, 154 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5c1e8b82a86d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = pdf-append + pkgdesc = Combines an arbitrary amount of pdf documents into one by appending the documents one after another. + pkgver = 0.3 + pkgrel = 1 + url = http://www-example.com/no_url_since_this_is_just_a_local_script_and_no_online_upstream_available/but_the_archlinux_AUR_requires_to_have_the_url-variable_set/ + arch = any + license = custom + depends = bash + depends = pdftk + source = pdf-append.sh + source = license.txt + sha512sums = 152bfe65fe66e13713c8ec648b1ca3b3693c33d7a58f32947d3095a6fc6d9e379d406fe002ed06a3a895e7582527db2473b6fe6dc9c7896a079c813b25d90f96 + sha512sums = 46f9bc2d587b31b971a31dfcb77710821275cf4678c6116f3cebe62afa86f5431128d4e46c343d89c626f1aa5298218c115e64ea0723e35046b04ca98b16c5ac + +pkgname = pdf-append + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8d2dfc7c1c28 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +#!/bin/bash +# Above shabeng-line for automatic switch-on of syntax highlighing in some editors. + +# Maintainer: dreieck, <felix )dot( becker (at( zih )dot) tu-dresden |dot| de>. + +_pkgname="pdf-append" +pkgname="${_pkgname}" +url='http://www-example.com/no_url_since_this_is_just_a_local_script_and_no_online_upstream_available/but_the_archlinux_AUR_requires_to_have_the_url-variable_set/' +pkgver="0.3" +pkgrel="1" +pkgdesc="Combines an arbitrary amount of pdf documents into one by appending the documents one after another." +arch=('any') +depends=( + 'bash' + 'pdftk' + ) +makedepends=( + ) +optdepends=( + ) +license=( + 'custom' + ) + +### !!! IMPORTANT: Do not change the order of the entries in the 'source'-array. The entries here are used to determine the names of the source-files in the 'package'-function, and a fixed order is assumed. ### +source=( + 'pdf-append.sh' # The name of the source file of the executable is expected to be at ${source[0]}. Do not change that order. See 'package'-function. + 'license.txt' # The name of the source file of the license is expected to be at ${source[1]}. Do not change that order. See 'package'-function. + ) + +sha512sums=( + '152bfe65fe66e13713c8ec648b1ca3b3693c33d7a58f32947d3095a6fc6d9e379d406fe002ed06a3a895e7582527db2473b6fe6dc9c7896a079c813b25d90f96' + '46f9bc2d587b31b971a31dfcb77710821275cf4678c6116f3cebe62afa86f5431128d4e46c343d89c626f1aa5298218c115e64ea0723e35046b04ca98b16c5ac' + ) + +package() +{ + _executablesourcefilename="${source[0]}" + _licensesourcefilename="${source[1]}" + + _executabletargetfilename="${_pkgname}" + _licensetargetfilename="${_licensesourcefilename}" + _licensetargetgenericfilename="COPYING" + + _instdir='/usr/bin' + _instdir_pkgdir="${pkgdir}${_instdir}" + + _licensedir="/usr/share/licenses/${pkgname}" + _licensedir_pkgdir="${pkgdir}${_licensedir}" + + install -D -g root -m 755 -o root -p -v "${srcdir}/${_executablesourcefilename}" "${_instdir_pkgdir}/${_executabletargetfilename}" + install -D -g root -m 644 -o root -p -v "${srcdir}/${_licensesourcefilename}" "${_licensedir_pkgdir}/${_licensetargetfilename}" + cd "${_licensedir_pkgdir}" && ln -sv "${_licensetargetfilename}" "${_licensetargetgenericfilename}" +} diff --git a/license.txt b/license.txt new file mode 100644 index 000000000000..2f25d778eab2 --- /dev/null +++ b/license.txt @@ -0,0 +1,5 @@ +This piece of software, 'pdf-combine', a wrapper around pdftk to combine two pdf documents into one by appending the documents one after the other, is allowed to be modified, distributed, copied unter the following conditions: + +* Not allowed to be used for any military use. +* When copying or modifiying, always include this license. Any modified version has to follow this license. + diff --git a/pdf-append.sh b/pdf-append.sh new file mode 100755 index 000000000000..29c1c54a813f --- /dev/null +++ b/pdf-append.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +### Author: Anonymous. + +extendedhelp="### $0 +# +# Combines an arbitrary amount of pdf documents into one by appending the documents one after another. +# +###" + +output_file_default='/dev/stdout' + +errmsg() { + if [ "$#" -ge "1" ]; then + msg="$1" + else + msg="$0: Unspecified error." + fi + + echo "${msg}" >> /dev/stderr +} + +exiterror() { + if [ "$#" -ge "1" ]; then + msg="$1" + else + msg="$0: Unspecified error." + fi + + if [ "$#" -ge "2" ]; then + exitcode="$2" + else + exitcode=2 + fi + + errmsg "${msg}" + exit "${exitcode}" +} + +printusage() { + echo "Usage:" + echo " $0 <pdf_input_files> [<pdf_output_file]" + echo "(<pdf_output_file> defaults to '${output_file_default}')" +} + +printextendedhelp() { + echo "${extendedhelp}" +} + +if [ "$#" -lt "1" ]; then + errmsg "$0: Error: Too few arguments specified." + errmsg "" + errmsg "$(printusage)" + errmsg "" + errmsg "=== Extended information on this software: ===" + errmsg "" + errmsg "$(printextendedhelp)" + errmsg "" + exiterror "$0: Aborting, since too few arguments specified." 1 +fi + +if [ "$#" -ge "1" ]; then + output_file="${@: -1:1}" # Last argument: ${@: -1:1} +else + output_file="${output_file_default}" +fi + +### The following two lines are there to enable them for debugging: +# echo "I would call:" +# echo "pdftk ${@:1:$(($#-1))} cat output ${output_file}" +### + +pdftk "${@:1:$(($#-1))}" cat output "${output_file}" # All but last arguments: ${@:1:$(($#-1))} +exitcode_pdftk="$?" + +if [ "${exitcode_pdftk}" -ne 0 ]; then + errmsg "$0: Error: The run of 'pdftk' produced an error. See above error message from the call to 'pdftk' for details." +fi +exit "${exitcode_pdftk}" |