diff options
Diffstat (limited to 'office/calibre')
-rw-r--r-- | office/calibre/README | 22 | ||||
-rw-r--r-- | office/calibre/calibre.SlackBuild | 123 | ||||
-rw-r--r-- | office/calibre/calibre.info | 8 | ||||
-rw-r--r-- | office/calibre/desktop/calibre-gui.desktop | 11 | ||||
-rw-r--r-- | office/calibre/desktop/calibre-lrfviewer.desktop | 12 | ||||
-rw-r--r-- | office/calibre/desktop/calibre-mimetypes | 15 | ||||
-rw-r--r-- | office/calibre/doinst.sh | 8 | ||||
-rw-r--r-- | office/calibre/patches/fix-libraries.diff | 37 | ||||
-rw-r--r-- | office/calibre/patches/fix-manpages.diff | 21 | ||||
-rw-r--r-- | office/calibre/patches/fix-postinstall.diff | 46 | ||||
-rw-r--r-- | office/calibre/slack-desc | 18 |
11 files changed, 321 insertions, 0 deletions
diff --git a/office/calibre/README b/office/calibre/README new file mode 100644 index 000000000000..ee4a23800566 --- /dev/null +++ b/office/calibre/README @@ -0,0 +1,22 @@ +Calibre is an e-book library manager. It can view, convert and catalog +e-books in most of the major e-book formats. It can also talk to e-book +reader devices. It can go out to the internet and fetch metadata for your +books. It can download newspapers and convert them into e-books for +convenient reading. It is cross platform, running on Linux, Windows +and OS X. + +Requires: pysetuptools, lxml, python-dateutil, pil, BeautifulSoup, +ClientForm, mechanize, dnspython, qt4, sip, and pyqt4. + +Optional: unrar and openjpeg. + +Warning: It is best to uninstall calibre first before upgrading to a new +version. + +Warning: This package conflicts with pyPdf, CherryPy and cssutils, as it +provides its own copy of these programs. + +Note: The ebook viewer functionality doesn't work with Qt 4.5.0 and +pyqt4 4.4.4. However, it does work with Qt 4.4.3 and pyqt4 4.4.4. As an +alternative, FBReader is a good choice to view downloaded content on the +desktop. diff --git a/office/calibre/calibre.SlackBuild b/office/calibre/calibre.SlackBuild new file mode 100644 index 000000000000..d285cf116b45 --- /dev/null +++ b/office/calibre/calibre.SlackBuild @@ -0,0 +1,123 @@ +#!/bin/sh + +# Slackware build script for calibre + +# Copyright 2009 Larry Hajali <larryhaja[at]gmail[dot]com> +# 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 ''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. + +PRGNAM=calibre +VERSION=${VERSION:-0.5.8} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +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-$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 {} \; + +# pyqtdistutils.py points to qmake rather then qmake-qt4. +sed -i 's|qmake|qmake-qt4|g' pyqtdistutils.py +# Correct the location of the libraries. +patch -p1 < $CWD/patches/fix-libraries.diff +# Remove desktop integration and post-install step. We'll do that later. +patch -p1 < $CWD/patches/fix-postinstall.diff +# Fix the man pages. +patch -p1 < $CWD/patches/fix-manpages.diff + +python setup.py install --root=$PKG + +# This shouldn't be necessary but calibre has a post install desktop integration +# step that leaves unwanted files on the system if calibre is later removed. +# So we'll provide the necessary paths for calibre to use in order to package it. +cd build + ln -s lib\.* lib +cd - + +DESTDIR="${PKG}" \ +PYTHONPATH="${TMP}/${PRGNAM}-${VERSION}/build/lib" \ +python "${TMP}/${PRGNAM}-${VERSION}"/src/${PRGNAM}/linux.py \ + --use-destdir \ + --do-not-reload-udev-hal \ + --group-file=/etc/group \ + --dont-check-root + +convert icons/library.ico $PRGNAM-gui.png +convert icons/viewer.ico $PRGNAM-viewer.png + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null +) + +# Fix the man pages +for i in $PKG/usr/man/man1/*.bz2 ; do bzip2 -d $i ; done +gzip -9 $PKG/usr/man/man?/*.? + +PYTHON_VERSION=$(python -c 'import sys; print sys.version[:3]') +sed -i 's|self.view.setProperty|#self.view.setProperty|' \ + $PKG/usr/lib/python${PYTHON_VERSION}/site-packages/calibre/gui2/viewer/main_ui.py + +# Install the necessary desktop items. +install -D -m 0644 $CWD/desktop/$PRGNAM-gui.desktop \ + $PKG/usr/share/applications/$PRGNAM-gui.desktop +install -D -m 0644 $PRGNAM-gui.png \ + $PKG/usr/share/pixmaps/$PRGNAM-gui.png +install -D -m 0644 $CWD/desktop/$PRGNAM-lrfviewer.desktop \ + $PKG/usr/share/applications/$PRGNAM-lrfviewer.desktop +install -D -m 0644 $PRGNAM-viewer.png \ + $PKG/usr/share/pixmaps/$PRGNAM-viewer.png +install -D -m 0644 $CWD/desktop/$PRGNAM-mimetypes \ + $PKG/usr/share/mime/packages/$PRGNAM-mimetypes + +# Put the udev rules file in the right place +mkdir -p $PKG/lib +mv $PKG/etc/udev $PKG/lib + +# Rename the bash-completion file to be more consistent with others +mv $PKG/etc/bash_completion.d/calibre $PKG/etc/bash_completion.d/calibre.sh + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a LICENSE todo $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 +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/office/calibre/calibre.info b/office/calibre/calibre.info new file mode 100644 index 000000000000..99e2813eeac7 --- /dev/null +++ b/office/calibre/calibre.info @@ -0,0 +1,8 @@ +PRGNAM="calibre" +VERSION="0.5.8" +HOMEPAGE="http://calibre.kovidgoyal.net/" +DOWNLOAD="http://pypi.python.org/packages/source/c/calibre/calibre-0.5.8.tar.gz" +MD5SUM="88744fbaa92913206508e1bcde5d5398" +MAINTAINER="Larry Hajali" +EMAIL="larryhaja[at]gmail[dot]com" +APPROVED="rworkman" diff --git a/office/calibre/desktop/calibre-gui.desktop b/office/calibre/desktop/calibre-gui.desktop new file mode 100644 index 000000000000..2fbf78c5b759 --- /dev/null +++ b/office/calibre/desktop/calibre-gui.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=0.5.6 +Type=Application +Name=calibre +GenericName=E-book library management +Comment=E-book library management +TryExec=calibre +Exec=calibre +Icon=calibre-gui +Categories=Office; +StartupNotify=false diff --git a/office/calibre/desktop/calibre-lrfviewer.desktop b/office/calibre/desktop/calibre-lrfviewer.desktop new file mode 100644 index 000000000000..37a3fe54e4d8 --- /dev/null +++ b/office/calibre/desktop/calibre-lrfviewer.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=0.5.6 +Type=Application +Name=LRF Viewer +GenericName=Viewer for LRF files +Comment=Viewer for LRF files (SONY ebook format files) +TryExec=lrfviewer +Exec=lrfviewer %F +Icon=calibre-viewer +MimeType=application/x-sony-bbeb; +Categories=Graphics;Viewer; +StartupNotify=false diff --git a/office/calibre/desktop/calibre-mimetypes b/office/calibre/desktop/calibre-mimetypes new file mode 100644 index 000000000000..7e85223cbbf4 --- /dev/null +++ b/office/calibre/desktop/calibre-mimetypes @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> + <mime-type type="application/x-sony-bbeb"> + <comment>SONY E-book compiled format</comment> + <glob pattern="*.lrf"/> + </mime-type> + <mime-type type="application/epub+zip"> + <comment>EPUB ebook format</comment> + <glob pattern="*.epub"/> + </mime-type> + <mime-type type="text/lrs"> + <comment>SONY E-book source format</comment> + <glob pattern="*.lrs"/> + </mime-type> +</mime-info> diff --git a/office/calibre/doinst.sh b/office/calibre/doinst.sh new file mode 100644 index 000000000000..e4e6459838cb --- /dev/null +++ b/office/calibre/doinst.sh @@ -0,0 +1,8 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi + diff --git a/office/calibre/patches/fix-libraries.diff b/office/calibre/patches/fix-libraries.diff new file mode 100644 index 000000000000..33006a70c784 --- /dev/null +++ b/office/calibre/patches/fix-libraries.diff @@ -0,0 +1,37 @@ +diff -Naur calibre-0.5.6.orig/installer/linux/freeze.py calibre-0.5.6/installer/linux/freeze.py +--- calibre-0.5.6.orig/installer/linux/freeze.py 2009-04-02 22:51:20.000000000 +0000 ++++ calibre-0.5.6/installer/linux/freeze.py 2009-04-08 03:30:37.000000000 +0000 +@@ -31,17 +31,17 @@ + '/usr/lib/libsqlite3.so.0', + '/usr/lib/libsqlite3.so.0', + '/usr/lib/libmng.so.1', +- '/lib/libz.so.1', ++ '/usr/lib/libz.so.1', + '/lib/libbz2.so.1', + '/lib/libbz2.so.1', +- '/usr/lib/libpoppler.so.4', ++ '/usr/lib/libpoppler.so.3', + '/usr/lib/libxml2.so.2', + '/usr/lib/libdbus-1.so.3', +- '/usr/lib/libopenjpeg.so.2', ++ '/usr/lib/libopenjpeg.so.1.3', + '/usr/lib/libxslt.so.1', + '/usr/lib/libxslt.so.1', + '/usr/lib/libgthread-2.0.so.0', +- '/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/libstdc++.so.6', ++ '/usr/lib/libstdc++.so.6', + '/usr/lib/libpng12.so.0', + '/usr/lib/libexslt.so.0', + '/usr/lib/libMagickWand.so', +diff -Naur calibre-0.5.6.orig/src/calibre/libwand.py calibre-0.5.6/src/calibre/libwand.py +--- calibre-0.5.6.orig/src/calibre/libwand.py 2009-04-09 04:13:27.000000000 +0000 ++++ calibre-0.5.6/src/calibre/libwand.py 2009-04-14 17:04:11.000000000 +0000 +@@ -7,7 +7,7 @@ + class WandException(Exception): + pass + +-_lib_name = 'CORE_RL_wand_.dll' if iswindows else 'libWand.dylib' if isosx else 'libWand.so' ++_lib_name = 'CORE_RL_wand_.dll' if iswindows else 'libWand.dylib' if isosx else 'libMagickWand.so' + if iswindows and hasattr(sys, 'frozen'): + im_dir = os.path.join(os.path.dirname(sys.executable), 'ImageMagick') + os.putenv('PATH', im_dir + ';' + os.environ['PATH']) diff --git a/office/calibre/patches/fix-manpages.diff b/office/calibre/patches/fix-manpages.diff new file mode 100644 index 000000000000..55e7ff8582cf --- /dev/null +++ b/office/calibre/patches/fix-manpages.diff @@ -0,0 +1,21 @@ +diff -Naur calibre-0.5.6.orig/src/calibre/linux.py calibre-0.5.6/src/calibre/linux.py +--- calibre-0.5.6.orig/src/calibre/linux.py 2009-04-09 04:13:27.000000000 +0000 ++++ calibre-0.5.6/src/calibre/linux.py 2009-04-13 22:17:10.000000000 +0000 +@@ -417,7 +417,7 @@ + def install_man_pages(fatal_errors, use_destdir=False): + from calibre.utils.help2man import create_man_page + prefix = os.environ.get('DESTDIR', '/') if use_destdir else '/' +- manpath = os.path.join(prefix, 'usr/share/man/man1') ++ manpath = os.path.join(prefix, 'usr/man/man1') + if not os.path.exists(manpath): + os.makedirs(manpath) + print 'Installing MAN pages...' +@@ -431,7 +431,7 @@ + continue + parser = parser() + raw = create_man_page(prog, parser) +- manfile = os.path.join(manpath, prog+'.1'+__appname__+'.bz2') ++ manfile = os.path.join(manpath, prog+'.1'+'.bz2') + print '\tInstalling MAN page for', prog + open(manfile, 'wb').write(raw) + manifest.append(manfile) diff --git a/office/calibre/patches/fix-postinstall.diff b/office/calibre/patches/fix-postinstall.diff new file mode 100644 index 000000000000..676cd384068d --- /dev/null +++ b/office/calibre/patches/fix-postinstall.diff @@ -0,0 +1,46 @@ +diff -Naur calibre-0.5.6.orig/setup.py calibre-0.5.6/setup.py +--- calibre-0.5.6.orig/setup.py 2009-04-09 04:13:27.000000000 +0000 ++++ calibre-0.5.6/setup.py 2009-04-13 22:14:41.000000000 +0000 +@@ -55,8 +55,6 @@ + upload_to_pypi, stage3, stage2, stage1, upload, \ + upload_rss + +- entry_points['console_scripts'].append( +- 'calibre_postinstall = calibre.linux:post_install') + ext_modules = [ + Extension('calibre.plugins.lzx', + sources=['src/calibre/utils/lzx/lzxmodule.c', +--- calibre-0.5.6.orig/setup.py 2009-04-09 04:13:27.000000000 +0000 ++++ calibre-0.5.6/setup.py 2009-04-13 22:14:41.000000000 +0000 +@@ -179,6 +179,4 @@ + + if 'develop' in ' '.join(sys.argv) and islinux: + subprocess.check_call('calibre_postinstall --do-not-reload-udev-hal', shell=True) +- if 'install' in sys.argv and islinux: +- subprocess.check_call('calibre_postinstall', shell=True) + +diff -Naur calibre-0.5.6.orig/src/calibre/linux.py calibre-0.5.6/src/calibre/linux.py +--- calibre-0.5.6.orig/src/calibre/linux.py 2009-04-09 04:13:27.000000000 +0000 ++++ calibre-0.5.6/src/calibre/linux.py 2009-04-13 22:17:10.000000000 +0000 +@@ -444,7 +444,6 @@ + global use_destdir + use_destdir = opts.destdir + manifest = [] +- setup_desktop_integration(opts.fatal_errors) + if opts.no_root or os.geteuid() == 0: + manifest += install_man_pages(opts.fatal_errors, use_destdir) + manifest += setup_udev_rules(opts.group_file, not opts.dont_reload, opts.fatal_errors) +@@ -462,13 +461,6 @@ + if opts.save_manifest_to: + open(opts.save_manifest_to, 'wb').write('\n'.join(manifest)+'\n') + +- from calibre.utils.config import config_dir +- if os.path.exists(config_dir): +- os.chdir(config_dir) +- for f in os.listdir('.'): +- if os.stat(f).st_uid == 0: +- os.unlink(f) +- + def binary_install(): + manifest = os.path.join(getattr(sys, 'frozen_path'), 'manifest') + exes = [x.strip() for x in open(manifest).readlines()] diff --git a/office/calibre/slack-desc b/office/calibre/slack-desc new file mode 100644 index 000000000000..0e16f8ebd7c9 --- /dev/null +++ b/office/calibre/slack-desc @@ -0,0 +1,18 @@ +# 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------------------------------------------------------| +calibre: calibre (e-book management software) +calibre: +calibre: calibre is a one stop solution to all your e-book needs. It is free, +calibre: open source and cross-platform in design and works well on Linux, +calibre: OS X and Windows. calibre is meant to be a complete e-library +calibre: solution and thus includes library management, format conversion, +calibre: news feeds to ebook conversion, as well as e-book reader sync +calibre: features and an integrated e-book viewer. +calibre: +calibre: Homepage: http://calibre.kovidgoyal.net/ |