From 4259b6fb383161be55208e7c4aab65cf096e3f5e Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 29 Jul 2012 23:14:20 -0500 Subject: [PATCH] office/zathura-cb: Added (comic book plugin for zathura) Signed-off-by: Robby Workman --- office/zathura-cb/README | 5 ++ office/zathura-cb/glib228compat.diff | 59 +++++++++++++++++++ office/zathura-cb/slack-desc | 19 +++++++ office/zathura-cb/zathura-cb.SlackBuild | 75 +++++++++++++++++++++++++ office/zathura-cb/zathura-cb.info | 10 ++++ 5 files changed, 168 insertions(+) create mode 100644 office/zathura-cb/README create mode 100644 office/zathura-cb/glib228compat.diff create mode 100644 office/zathura-cb/slack-desc create mode 100644 office/zathura-cb/zathura-cb.SlackBuild create mode 100644 office/zathura-cb/zathura-cb.info diff --git a/office/zathura-cb/README b/office/zathura-cb/README new file mode 100644 index 0000000000..2c5c6bc328 --- /dev/null +++ b/office/zathura-cb/README @@ -0,0 +1,5 @@ +zathura-cb (comic book plugin for zathura) + +Adds support for cbz, cbr, cb7, cbt files to the zathura document viewer. + +This requires zathura, unrar, and p7zip. diff --git a/office/zathura-cb/glib228compat.diff b/office/zathura-cb/glib228compat.diff new file mode 100644 index 0000000000..20b9b5a59c --- /dev/null +++ b/office/zathura-cb/glib228compat.diff @@ -0,0 +1,59 @@ +diff -Naur zathura-cb-0.1.0/cb.c zathura-cb-0.1.0.patched/cb.c +--- zathura-cb-0.1.0/cb.c 2012-06-09 17:48:13.000000000 -0400 ++++ zathura-cb-0.1.0.patched/cb.c 2012-07-22 15:06:18.000000000 -0400 +@@ -1,7 +1,9 @@ + /* See LICENSE file for license and copyright information */ + +-#include + #include ++#include ++#include ++#include + #include + #include + #include +@@ -11,7 +13,7 @@ + #include "utils.h" + + struct cb_document_s { +- char* directory; /**< Path to the directory */ ++ char directory[4096]; /**< Path to the directory */ + girara_list_t* page_paths; /**< List of page paths */ + }; + +@@ -58,8 +60,8 @@ + cb_document_t* cb_document = g_malloc0(sizeof(cb_document)); + + /* create temp directory */ +- cb_document->directory = g_dir_make_tmp("zathura-cb-XXXXXX", NULL); +- if (cb_document->directory == NULL) { ++ sprintf(cb_document->directory, "%s/zathura-cb-XXXXXX", g_get_tmp_dir()); ++ if(mkdtemp(cb_document->directory) == NULL) { + goto error_free; + } + +@@ -148,18 +150,18 @@ + return ZATHURA_ERROR_INVALID_ARGUMENTS; + } + +- /* remove temp directory */ +- if (cb_document->directory != NULL) { +- g_remove(cb_document->directory); +- } +- + /* remove page list */ + if (cb_document->page_paths != NULL) { ++ char *path; ++ GIRARA_LIST_FOREACH(cb_document->page_paths, char*, iter, path) ++ g_remove(path); ++ GIRARA_LIST_FOREACH_END(cb_document->page_paths, char*, iter, path); + girara_list_free(cb_document->page_paths); + } + ++ /* remove temp directory */ + if (cb_document->directory != NULL) { +- g_free(cb_document->directory); ++ g_remove(cb_document->directory); + } + + g_free(cb_document); diff --git a/office/zathura-cb/slack-desc b/office/zathura-cb/slack-desc new file mode 100644 index 0000000000..025799279c --- /dev/null +++ b/office/zathura-cb/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 ':'. + + |-----handy-ruler------------------------------------------------------| +zathura-cb: zathura-cb (comic book plugin for zathura) +zathura-cb: +zathura-cb: Adds support for cbz, cbr, cb7, cbt files to the zathura document +zathura-cb: viewer. +zathura-cb: +zathura-cb: +zathura-cb: +zathura-cb: +zathura-cb: +zathura-cb: +zathura-cb: diff --git a/office/zathura-cb/zathura-cb.SlackBuild b/office/zathura-cb/zathura-cb.SlackBuild new file mode 100644 index 0000000000..be9dec3721 --- /dev/null +++ b/office/zathura-cb/zathura-cb.SlackBuild @@ -0,0 +1,75 @@ +#!/bin/bash + +# Slackware build script for zathura-cb + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://sam.zoy.org/wtfpl/ for details. + +PRGNAM=zathura-cb +VERSION=${VERSION:-0.1.0} +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 . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# as shipped, the source uses g_dir_make_tmp(), which was introduced in +# glib-2.30. Slack 13.37 ships with glib-2.28, so we make the code use +# g_mkdtemp() instead. +patch -p1 < $CWD/glib228compat.diff + +sed -i "s,-fPIC,$SLKCFLAGS," config.mk + +make VERBOSE=1 +strip *.so +make install DESTDIR=$PKG + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS LICENSE $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/zathura-cb/zathura-cb.info b/office/zathura-cb/zathura-cb.info new file mode 100644 index 0000000000..a6f101d7cf --- /dev/null +++ b/office/zathura-cb/zathura-cb.info @@ -0,0 +1,10 @@ +PRGNAM="zathura-cb" +VERSION="0.1.0" +HOMEPAGE="http://www.pwmt.org/projects/zathura/plugins/zathura-cb/" +DOWNLOAD="http://www.pwmt.org/projects/zathura/plugins/download/zathura-cb-0.1.0.tar.gz" +DOWNLOAD_x86_64="" +MD5SUM="be34b699862f4c1c9f5ef4347d1dfdef" +MD5SUM_x86_64="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" +APPROVED="rworkman"