aboutsummaryrefslogtreecommitdiff
path: root/office
diff options
context:
space:
mode:
authorAlexander Verbovetsky <alik@ejik.org>2022-10-24 22:28:55 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-10-29 10:28:36 +0700
commita85185379b31e78f412c833ec71cb4d656c61012 (patch)
tree59bc5aea4f7b0a232f7f12c84e2d745ebbc3c1f1 /office
parent24f7e9543e00faf1ca17f551292859a2899753bc (diff)
office/cpdf: Added (CLI tool to manipulate PDF files)
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office')
-rw-r--r--office/cpdf/README20
-rw-r--r--office/cpdf/cpdf.SlackBuild90
-rw-r--r--office/cpdf/cpdf.info10
-rw-r--r--office/cpdf/slack-desc19
4 files changed, 139 insertions, 0 deletions
diff --git a/office/cpdf/README b/office/cpdf/README
new file mode 100644
index 000000000000..ec5a09769502
--- /dev/null
+++ b/office/cpdf/README
@@ -0,0 +1,20 @@
+The cpdf command line tool allows you to manipulate existing PDF files
+in a variety of ways. For example:
+
+* Merge PDF files together, or split them apart
+* Encrypt and decrypt
+* Scale, crop and rotate pages
+* Read and set document info and metadata
+* Copy, add or remove bookmarks
+* Put multiple pages on one (imposition)
+* Stamp logos, text, dates, page numbers
+* Add or remove attachments
+* Losslessly compress PDF files
+* Convert PDF files to and from JSON
+
+This tool has been available commercially from Coherent Graphics Ltd
+since 2007, in 2013 it was released for free under a
+not-for-commercial-use license.
+
+This script builds the cpdf command line tool and cpdf as an OCaml
+library.
diff --git a/office/cpdf/cpdf.SlackBuild b/office/cpdf/cpdf.SlackBuild
new file mode 100644
index 000000000000..6c24994315c3
--- /dev/null
+++ b/office/cpdf/cpdf.SlackBuild
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+# Slackware build script for cpdfappname>
+
+# Copyright 2022, Alexander Verbovetsky, Moscow, Russia
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=cpdf
+VERSION=${VERSION:-2.5.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-source-$VERSION
+tar xvf $CWD/$PRGNAM-source-$VERSION.tar.gz
+cd $PRGNAM-source-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+make -j1
+OCAMLFIND_DESTDIR="$PKG/$(ocamlfind printconf destdir)"
+mkdir -p $OCAMLFIND_DESTDIR
+make install OCAMLFIND_DESTDIR=$OCAMLFIND_DESTDIR
+
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+install -sDm 0755 cpdf -t $PKG/usr/bin/
+
+sed -i -e "s|cpdfmanual.pdf|/usr/doc/$PRGNAM-$VERSION/&|" cpdf.1
+mkdir -p $PKG/usr/man/man1
+gzip -9 -c cpdf.1 > $PKG/usr/man/man1/cpdf.1.gz
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a Changes LICENSE README.md cpdfmanual.pdf cpdfmanual.tex \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/office/cpdf/cpdf.info b/office/cpdf/cpdf.info
new file mode 100644
index 000000000000..7dd6831dc61b
--- /dev/null
+++ b/office/cpdf/cpdf.info
@@ -0,0 +1,10 @@
+PRGNAM="cpdf"
+VERSION="2.5.1"
+HOMEPAGE="https://community.coherentpdf.com"
+DOWNLOAD="https://github.com/johnwhitington/cpdf-source/archive/v2.5.1/cpdf-source-2.5.1.tar.gz"
+MD5SUM="9dea734559625813cc21cab8cc607570"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="camlpdf"
+MAINTAINER="Alexander Verbovetsky"
+EMAIL="alik@ejik.org"
diff --git a/office/cpdf/slack-desc b/office/cpdf/slack-desc
new file mode 100644
index 000000000000..5c8591bd39f9
--- /dev/null
+++ b/office/cpdf/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+cpdf: cpdf (CLI tool to manipulate PDF files)
+cpdf:
+cpdf:
+cpdf: The cpdf command line tool allows you to manipulate existing PDF
+cpdf: files in a variety of ways.
+cpdf:
+cpdf: Homepage: https://community.coherentpdf.com
+cpdf: Source code: https://github.com/johnwhitington/cpdf-source
+cpdf:
+cpdf:
+cpdf: