From 24a9b8655cbcc263e1f8818c7d549f00bf194476 Mon Sep 17 00:00:00 2001 From: B. Watson Date: Fri, 22 Aug 2014 17:52:27 +0700 Subject: office/fbpdf: Added (PDF viewer for the Linux framebuffer). Signed-off-by: Willy Sudiarto Raharjo --- office/fbpdf/README | 17 +++ office/fbpdf/fbpdf.1 | 236 ++++++++++++++++++++++++++++++++++++++++++ office/fbpdf/fbpdf.SlackBuild | 95 +++++++++++++++++ office/fbpdf/fbpdf.info | 10 ++ office/fbpdf/fbpdf.pod | 225 ++++++++++++++++++++++++++++++++++++++++ office/fbpdf/navigation.diff | 53 ++++++++++ office/fbpdf/slack-desc | 19 ++++ 7 files changed, 655 insertions(+) create mode 100644 office/fbpdf/README create mode 100644 office/fbpdf/fbpdf.1 create mode 100644 office/fbpdf/fbpdf.SlackBuild create mode 100644 office/fbpdf/fbpdf.info create mode 100644 office/fbpdf/fbpdf.pod create mode 100644 office/fbpdf/navigation.diff create mode 100644 office/fbpdf/slack-desc (limited to 'office') diff --git a/office/fbpdf/README b/office/fbpdf/README new file mode 100644 index 0000000000..e47293c2b7 --- /dev/null +++ b/office/fbpdf/README @@ -0,0 +1,17 @@ +fbpdf (PDF viewer for the Linux framebuffer) + +fbpdf is a framebuffer pdf/djvu file viewer. It can use either mupdf or +poppler libraries for rendering pdf files and it uses djvulibre library +for rendering djvu files. + +By default, the fbpdf2 (poppler support) executable is built, along +with fbdjvu. If you want mupdf support, install mupdf before running +this build and it will be auto-detected. The executable that uses mupdf +will be called fbpdf. + +This build includes a patch that makes the keyboard controls behave more +like other PDF readers. Mainly, it lets you page through the entire +document with the space bar (and backspace to go back), rather than +requiring separate keystrokes for "scroll within current page" and "go +to next page". If you prefer the original behaviour, set PRISTINE=yes +in the script's environment. diff --git a/office/fbpdf/fbpdf.1 b/office/fbpdf/fbpdf.1 new file mode 100644 index 0000000000..7d0fe2c4d8 --- /dev/null +++ b/office/fbpdf/fbpdf.1 @@ -0,0 +1,236 @@ +.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" ======================================================================== +.\" +.IX Title "FBPDF 1" +.TH FBPDF 1 "2014-08-22" "20140822" "SlackBuilds.org" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +fbpdf \- framebuffer pdf/djvu file viewer. +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +fbpdf [options] filename +.PP +fbpdf2 [options] filename +.PP +fbdjvu [options] filename +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +fbpdf is a framebuffer pdf/djvu file viewer. It can use either +mupdf or poppler libraries for rendering pdf files and it uses +djvulibre library for rendering djvu files. Note that fbpdf +uses different binaries for each library. +.IP "fbpdf" 4 +.IX Item "fbpdf" +\&\s-1PDF\s0 viewer, using the mupdf rendering library. +.IP "fbpdf2" 4 +.IX Item "fbpdf2" +\&\s-1PDF\s0 viewer, using the poppler rendering library. +.IP "fbdjvu" 4 +.IX Item "fbdjvu" +DjVu viewer, using the djvulibre rendering library. +.PP +All of the binaries take the same options and use the same +keystrokes. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-r\fR \fIrotation\fR" 4 +.IX Item "-r rotation" +Set rotation, in degrees. Same as \fBr\fR keystroke. +.IP "\fB\-z\fR \fIzoomx10\fR" 4 +.IX Item "-z zoomx10" +Set default zoom (will be multiplied by 10). Same as \fBz\fR keystroke. +.IP "\fB\-p\fR \fIpage\fR" 4 +.IX Item "-p page" +Set starting page. +.SH "KEYS" +.IX Header "KEYS" +The following table describes the commands available in fbpdf. +Most of these commands accept a numerical prefix. For instance, +\&'^F' tells fbpdf to go to the next page while '5^F' tells it to +move to the fifth next page. +.IP "\fB^F\fR, \fBJ\fR" 4 +.IX Item "^F, J" +next page +.IP "\fB^B\fR, \fBK\fR" 4 +.IX Item "^B, K" +previous page +.IP "\fBG\fR" 4 +.IX Item "G" +go to page (the last page if no prefix) +.IP "\fBo\fR" 4 +.IX Item "o" +set page number (for 'G' command only) +.IP "\fBO\fR" 4 +.IX Item "O" +set page number and go to current page +.IP "\fBz\fR, \fB=\fR" 4 +.IX Item "z, =" +zoom; prefix multiplied by 10 (i.e. '12z' = 120%). Default 15. +.IP "\fB+\fR" 4 +.IX Item "+" +increase zoom by 10% +.IP "\fB\-\fR" 4 +.IX Item "-" +decrease zoom by 10% +.IP "\fBr\fR" 4 +.IX Item "r" +set rotation in degrees +.IP "\fBi\fR" 4 +.IX Item "i" +print info +.IP "\fBq\fR" 4 +.IX Item "q" +quit +.IP "\fB^[\fR" 4 +.IX Item "^[" +(escape) clear numerical prefix +.IP "\fBmx\fR" 4 +.IX Item "mx" +mark page as 'x' (or any other letter) +.IP "\fB'x\fR" 4 +.IX Item "'x" +jump to the page marked as 'x' +.IP "\fB`x\fR" 4 +.IX Item "`x" +jump to the page and position marked as 'x' +.IP "\fBj\fR" 4 +.IX Item "j" +scroll down +.IP "\fBk\fR" 4 +.IX Item "k" +scroll up +.IP "\fBh\fR" 4 +.IX Item "h" +scroll left +.IP "\fBl\fR" 4 +.IX Item "l" +scroll right +.IP "\fB[\fR" 4 +.IX Item "[" +align with the left edge of the page +.IP "\fB]\fR" 4 +.IX Item "]" +align with the right edge of the page +.IP "\fB{\fR" 4 +.IX Item "{" +align with the leftmost character on the page +.IP "\fB}\fR" 4 +.IX Item "}" +align with the rightmost character on the page +.IP "\fBH\fR" 4 +.IX Item "H" +show page top +.IP "\fBM\fR" 4 +.IX Item "M" +center the page vertically +.IP "\fBL\fR" 4 +.IX Item "L" +show page bottom +.IP "\fBC\fR" 4 +.IX Item "C" +center the page horizontally +.IP "\fB' '\fR, \fB^D\fR" 4 +.IX Item "' ', ^D" +(space) page down +.IP "\fB^H\fR, \fB^U\fR" 4 +.IX Item "^H, ^U" +(backspace) page up +.IP "\fB^L\fR" 4 +.IX Item "^L" +redraw +.IP "\fBe\fR" 4 +.IX Item "e" +reload current file +.IP "\fBf\fR" 4 +.IX Item "f" +zoom to fit page height +.IP "\fBw\fR" 4 +.IX Item "w" +zoom to fit page width +.IP "\fBW\fR" 4 +.IX Item "W" +zoom to fit page contents horizontally +.IP "\fBZ\fR" 4 +.IX Item "Z" +the default zoom level for 'z' command +.IP "\fBd\fR" 4 +.IX Item "d" +sleep one second before the next command +.SH "AUTHOR" +.IX Header "AUTHOR" +fbpdf was written by Ali Gholami Rudi (ali at rudi dot ir). +.PP +This man page created from fbpdf's \s-1README\s0 by B. Watson, for the +SlackBuilds.org project. diff --git a/office/fbpdf/fbpdf.SlackBuild b/office/fbpdf/fbpdf.SlackBuild new file mode 100644 index 0000000000..02891669f2 --- /dev/null +++ b/office/fbpdf/fbpdf.SlackBuild @@ -0,0 +1,95 @@ +#!/bin/sh + +# Slackware build script for fbpdf + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# Source tarball made from: git clone git://repo.or.cz/fbpdf.git + +PRGNAM=fbpdf +VERSION=${VERSION:-20140822} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$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 {} \; + +# This patch has been sent upstream. In my opinion, fbpdf is needlessly +# difficult to use without it. +[ "${PRISTINE:-no}" != "yes" ] && \ + patch -p1 < $CWD/navigation.diff + +sed -i \ + -e 's,-lmupdf -lmujs,`pkg-config --libs mupdf`,' \ + -e 's,-lopenjpeg,-lopenjp2,' \ + Makefile + +mkdir -p $PKG/usr/bin + +# always build these two. +make ${PRGNAM}2 fbdjvu +install -s -m0755 ${PRGNAM}2 $PKG/usr/bin +install -s -m0755 fbdjvu $PKG/usr/bin + +# autodetect mupdf. +pkg-config --exists mupdf && \ + make clean && \ + make $PRGNAM && \ + install -s -m0755 $PRGNAM $PKG/usr/bin + +# man page written for this build. +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz +ln -s $PRGNAM.1.gz $PKG/usr/man/man1/${PRGNAM}2.1.gz +ln -s $PRGNAM.1.gz $PKG/usr/man/man1/fbdjvu.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README $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:-tgz} diff --git a/office/fbpdf/fbpdf.info b/office/fbpdf/fbpdf.info new file mode 100644 index 0000000000..050d17b142 --- /dev/null +++ b/office/fbpdf/fbpdf.info @@ -0,0 +1,10 @@ +PRGNAM="fbpdf" +VERSION="20140822" +HOMEPAGE="http://litcave.rudi.ir/" +DOWNLOAD="http://urchlay.naptime.net/~urchlay/src/fbpdf-20140822.tar.gz" +MD5SUM="95cb4e7d37203285783ca5f0b9534c72" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/office/fbpdf/fbpdf.pod b/office/fbpdf/fbpdf.pod new file mode 100644 index 0000000000..7c5b9d1f37 --- /dev/null +++ b/office/fbpdf/fbpdf.pod @@ -0,0 +1,225 @@ +# pod source for fbpdf man page. Convert with: +# pod2man --stderr -s1 -cSlackBuilds.org -r20140822 -u fbpdf.pod > fbpdf.1 + +=pod + +=encoding utf8 + +=head1 NAME + +fbpdf - framebuffer pdf/djvu file viewer. + +=head1 SYNOPSIS + +fbpdf [options] filename + +fbpdf2 [options] filename + +fbdjvu [options] filename + +=head1 DESCRIPTION + +fbpdf is a framebuffer pdf/djvu file viewer. It can use either +mupdf or poppler libraries for rendering pdf files and it uses +djvulibre library for rendering djvu files. Note that fbpdf +uses different binaries for each library. + +=over 4 + +=item fbpdf + +PDF viewer, using the mupdf rendering library. + +=item fbpdf2 + +PDF viewer, using the poppler rendering library. + +=item fbdjvu + +DjVu viewer, using the djvulibre rendering library. + +=back + +All of the binaries take the same options and use the same +keystrokes. + +=head1 OPTIONS + +=over 4 + +=item B<-r> I + +Set rotation, in degrees. Same as B keystroke. + +=item B<-z> I + +Set default zoom (will be multiplied by 10). Same as B keystroke. + +=item B<-p> I + +Set starting page. + +=back + +=head1 KEYS + +The following table describes the commands available in fbpdf. +Most of these commands accept a numerical prefix. For instance, +'^F' tells fbpdf to go to the next page while '5^F' tells it to +move to the fifth next page. + +=over 4 + +=item B<^F>, B + +next page + +=item B<^B>, B + +previous page + + +=item B + +go to page (the last page if no prefix) + +=item B + +set page number (for 'G' command only) + +=item B + +set page number and go to current page + +=item B, B<=> + +zoom; prefix multiplied by 10 (i.e. '12z' = 120%). Default 15. + +=item B<+> + +increase zoom by 10% + +=item B<-> + +decrease zoom by 10% + +=item B + +set rotation in degrees + +=item B + +print info + +=item B + +quit + +=item B<^[> + +(escape) clear numerical prefix + +=item B + +mark page as 'x' (or any other letter) + +=item B<'x> + +jump to the page marked as 'x' + +=item B<`x> + +jump to the page and position marked as 'x' + +=item B + +scroll down + +=item B + +scroll up + +=item B + +scroll left + +=item B + +scroll right + +=item B<[> + +align with the left edge of the page + +=item B<]> + +align with the right edge of the page + +=item B<{> + +align with the leftmost character on the page + +=item B<}> + +align with the rightmost character on the page + +=item B + +show page top + +=item B + +center the page vertically + +=item B + +show page bottom + +=item B + +center the page horizontally + +=item B<' '>, B<^D> + +(space) page down + +=item B<^H>, B<^U> + +(backspace) page up + +=item B<^L> + +redraw + +=item B + +reload current file + +=item B + +zoom to fit page height + +=item B + +zoom to fit page width + +=item B + +zoom to fit page contents horizontally + +=item B + +the default zoom level for 'z' command + +=item B + +sleep one second before the next command + +=back + +=head1 AUTHOR + +fbpdf was written by Ali Gholami Rudi (ali at rudi dot ir). + +This man page created from fbpdf's README by B. Watson, for the +SlackBuilds.org project. diff --git a/office/fbpdf/navigation.diff b/office/fbpdf/navigation.diff new file mode 100644 index 0000000000..6280062a68 --- /dev/null +++ b/office/fbpdf/navigation.diff @@ -0,0 +1,53 @@ +diff -Naur fbpdf-20140822/README fbpdf-20140822.patched/README +--- fbpdf-20140822/README 2014-08-21 21:12:00.000000000 -0400 ++++ fbpdf-20140822.patched/README 2014-08-22 04:53:46.000000000 -0400 +@@ -28,7 +28,9 @@ + G go to page (the last page if no prefix) + o set page number (for 'G' command only) + O set page number and go to current page +-z zoom; prefix multiplied by 10 (i.e. '15z' = 150%) ++z/= zoom; prefix multiplied by 10 (i.e. '12z' = 120%). Default 15. +++ increase zoom by 10% ++- decrease zoom by 10% + r set rotation in degrees + i print info + q quit +diff -Naur fbpdf-20140822/fbpdf.c fbpdf-20140822.patched/fbpdf.c +--- fbpdf-20140822/fbpdf.c 2014-08-21 21:12:00.000000000 -0400 ++++ fbpdf-20140822.patched/fbpdf.c 2014-08-22 04:53:56.000000000 -0400 +@@ -220,6 +220,7 @@ + numdiff = num - getcount(num); + break; + case 'z': ++ case '=': + zoom_page(getcount(zoom_def)); + break; + case 'Z': +@@ -288,10 +289,12 @@ + case ' ': + case CTRL('d'): + head += fb_rows() * getcount(1) - step; ++ if(head > prows) showpage(num + 1, 0); + break; + case 127: + case CTRL('u'): + head -= fb_rows() * getcount(1) - step; ++ if(head < 0) showpage(num - 1, prows - step); + break; + case '[': + left = leftmost(0); +@@ -307,6 +310,14 @@ + break; + case CTRLKEY('l'): + break; ++ case '+': ++ count = 0; ++ zoom_page(zoom + 1); ++ break; ++ case '-': ++ count = 0; ++ if(zoom > 0) zoom_page(zoom - 1); ++ break; + default: + /* no need to redraw */ + continue; diff --git a/office/fbpdf/slack-desc b/office/fbpdf/slack-desc new file mode 100644 index 0000000000..2406bde801 --- /dev/null +++ b/office/fbpdf/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------------------------------------------------------| +fbpdf: fbpdf (PDF viewer for the Linux framebuffer) +fbpdf: +fbpdf: fbpdf is a framebuffer pdf/djvu file viewer. It can use either mupdf +fbpdf: or poppler libraries for rendering pdf files and it uses djvulibre +fbpdf: library for rendering djvu files. +fbpdf: +fbpdf: +fbpdf: +fbpdf: +fbpdf: +fbpdf: -- cgit v1.2.3