office/calibre: Updated for version 0.7.2.

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
Larry Hajali 2010-06-15 04:26:34 -05:00 committed by Robby Workman
parent 45e8294d0e
commit 4bdda09a80
16 changed files with 109 additions and 148 deletions

View File

@ -9,11 +9,5 @@ formats. It also supports conversion from a dozen different ebook formats to
LRF and EPUB. A graphical interface to the conversion software can be
accessed easily by just clicking the "Convert E-books" button.
This requires pysetuptools, lxml, python-dateutil, BeautifulSoup, ClientForm,
This requires pysetuptools, cssutils, lxml, python-dateutil, BeautifulSoup,
mechanize, dnspython, and podofo.
Optional: unrar and openjpeg.
Note: This package conflicts with pyPdf, cssutils, and CherryPy, as it
provides these packages (available at slackbuilds.org). Calibre also
provides odfpy and django-tagging (not available at slackbuilds.org).

View File

@ -2,7 +2,7 @@
# Slackware build script for calibre
# Copyright 2009 Larry Hajali <larryhaja[at]gmail[dot]com>
# Copyright 2009-2010 Larry Hajali <larryhaja[at]gmail[dot]com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -23,16 +23,14 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=calibre
VERSION=${VERSION:-0.5.14}
VERSION=0.7.2
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@ -43,10 +41,13 @@ 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"
@ -58,9 +59,9 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
rm -rf $PRGNAM
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
cd $PRGNAM
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@ -69,66 +70,58 @@ find . \
-exec chmod 644 {} \;
# Fix man pages.
patch -p1 < $CWD/patches/fix-manpages.diff
# Remove desktop integration and post isntall step. We'll do that later.
patch -p1 < $CWD/patches/post-install-removal.patch
# Fix a validation error in django-tagging python module.
patch -p1 < $CWD/patches/tagging-form.patch
patch -p1 < $CWD/patches/fix-manpages.patch
# Remove desktop integration. We'll do that later.
patch -p1 < $CWD/patches/remove-desktop-integration.patch
# Fix calibre module location.
patch -p1 < $CWD/patches/calibre-module-fix.patch
# Fix version info.
sed -i "s|0.7.1|$VERSION|" src/calibre/{constants.py,translations/calibre.pot}
python setup.py install --root=$PKG
CFLAGS="$SLKCFLAGS" python setup.py build
# 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 -
# We have to fake out CALIBRE_CONFIG_DIRECTORY if there is a current
# calibre installation while the install process takes place. :(
mkdir -p $PWD/tmp/config
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
CALIBRE_CONFIG_DIRECTORY="$PWD/tmp/config" \
python setup.py install \
--root=$PKG \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sharedir=/usr/share \
--bindir=/usr/bin \
--staging-libdir=$PKG/usr/lib${LIBDIRSUFFIX} \
--staging-bindir=$PKG/usr/bin \
--staging-sharedir=$PKG/usr/share
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# Fix the man pages.
for i in $PKG/usr/man/man1/*.bz2 ; do bzip2 -d $i ; done
gzip -9 $PKG/usr/man/man?/*.?
# Fix the man pages
for i in $PKG/usr/man/man?/*.bz2 ; do bzip2 -d $i ; done
find $PKG/usr/man -type f -exec gzip -9 {} \;
# Put the udev rules file in the right place
mkdir -p $PKG/lib
mv $PKG/etc/udev $PKG/lib
# Fix permissions on calibre's bash completion.
chmod 0755 $PKG/etc/bash_completion.d/$PRGNAM
# Make the bash completion into a more standard form.
mv $PKG/etc/bash_completion.d/calibre $PKG/etc/bash_completion.d/calibre.sh
# Fix a bug in the ebook-viewer for Qt 4.5.x incompatibility.
PYVER=$(python -c 'import sys; print sys.version[:3]')
sed -i 's|self.view.setProperty|#self.view.setProperty|' \
$PKG/usr/lib${LIBDIRSUFFIX}/python${PYVER}/site-packages/calibre/gui2/viewer/main_ui.py
# Install the necessary desktop items
# Install the necessary desktop items.
install -D -m 644 $CWD/desktop/$PRGNAM-gui.desktop \
$PKG/usr/share/applications/$PRGNAM-gui.desktop
install -D -m 644 $CWD/desktop/$PRGNAM-lrfviewer.desktop \
$PKG/usr/share/applications/$PRGNAM-lrfviewer.desktop
install -D -m 644 $PRGNAM-gui.png \
$PKG/usr/share/icons/hicolor/128x128/apps/$PRGNAM-gui.png
install -D -m 644 $PRGNAM-viewer.png \
$PKG/usr/share/icons/hicolor/128x128/apps/$PRGNAM-viewer.png
install -D -m 644 $CWD/desktop/$PRGNAM-gui.png \
$PKG/usr/share/pixmaps/$PRGNAM-gui.png
install -D -m 644 $CWD/desktop/$PRGNAM-viewer.png \
$PKG/usr/share/pixmaps/$PRGNAM-viewer.png
install -D -m 644 $CWD/desktop/$PRGNAM-ebook-viewer.desktop \
$PKG/usr/share/applications/$PRGNAM-ebook-viewer.desktop
install -D -m 644 $CWD/desktop/$PRGNAM-mimetypes \
$PKG/usr/share/mime/packages/$PRGNAM-mimetypes
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
LICENSE todo \
LICENSE* Changelog.yaml COPYRIGHT README \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

View File

@ -1,8 +1,8 @@
PRGNAM="calibre"
VERSION="0.5.14"
HOMEPAGE="http://calibre.kovidgoyal.net/"
DOWNLOAD="http://pypi.python.org/packages/source/c/calibre/calibre-0.5.14.tar.gz"
MD5SUM="e4c97257c0824342ecd607866c08ddaa"
VERSION="0.7.2"
HOMEPAGE="http://calibre-ebook.com/"
DOWNLOAD="http://downloads.sourceforge.net/calibre/calibre-0.7.2.tar.gz"
MD5SUM="296531c56e12a9825418cbe1c040abd1"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Larry Hajali"

View File

@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=E-book Viewer
GenericName=Viewer for E-books
Comment=Viewer for E-books
TryExec=ebook-viewer
Exec=ebook-viewer %F
Icon=calibre-viewer
MimeType=application/epub+zip;
Categories=Graphics;Viewer;

View File

@ -1,5 +1,5 @@
[Desktop Entry]
Version=0.5.6
Version=1.0
Type=Application
Name=calibre
GenericName=E-book library management

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -1,8 +0,0 @@
/usr/share/hal/fdi/policy/20thirdparty/10-calibre.fdi
/usr/share/mime/packages/calibre-mimetypes
/usr/share/gnome/apps/calibre-lrfviewer.desktop
/usr/share/gnome/apps/calibre-gui.desktop
/usr/share/icons/hicolor/128x128/apps/calibre-gui.png
/usr/share/icons/hicolor/128x128/apps/calibre-viewer.png
/usr/share/applnk/calibre-lrfviewer.desktop
/usr/share/applnk/calibre-gui.desktop

View File

@ -1,5 +1,5 @@
[Desktop Entry]
Version=0.5.6
Version=1.0
Type=Application
Name=LRF Viewer
GenericName=Viewer for LRF files

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -0,0 +1,14 @@
diff -Naur calibre.orig/setup/install.py calibre/setup/install.py
--- calibre.orig/setup/install.py 2010-03-05 21:13:33.000000000 +0000
+++ calibre/setup/install.py 2010-03-07 00:07:41.000000000 +0000
@@ -142,7 +142,9 @@
def install_env_module(self):
import distutils.sysconfig as s
- libdir = s.get_python_lib(prefix=self.opts.staging_root)
+ libdir = s.get_python_lib(prefix=(self.opts.staging_root + sys.prefix))
+ if not os.path.exists(libdir):
+ os.makedirs(libdir)
if os.path.exists(libdir):
path = os.path.join(libdir, 'init_calibre.py')
self.info('Installing calibre environment module: '+path)

View File

@ -1,21 +0,0 @@
diff -Naur calibre-0.5.12.orig/src/calibre/linux.py calibre-0.5.12/src/calibre/linux.py
--- calibre-0.5.12.orig/src/calibre/linux.py 2009-05-15 21:05:52.000000000 +0000
+++ calibre-0.5.12/src/calibre/linux.py 2009-05-16 04:09:44.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)

View File

@ -0,0 +1,21 @@
diff -Naur calibre.orig/src/calibre/linux.py calibre/src/calibre/linux.py
--- calibre.orig/src/calibre/linux.py 2010-03-05 21:13:33.000000000 +0000
+++ calibre/src/calibre/linux.py 2010-03-07 00:02:26.000000000 +0000
@@ -325,7 +325,7 @@
if isfreebsd:
manpath = os.path.join(self.opts.staging_root, 'man/man1')
else:
- manpath = os.path.join(self.opts.staging_sharedir, 'man/man1')
+ manpath = os.path.join(self.opts.staging_root, 'usr/man/man1')
if not os.path.exists(manpath):
os.makedirs(manpath)
self.info('Installing MAN pages...')
@@ -341,7 +341,7 @@
if isfreebsd:
manfile = os.path.join(manpath, prog+'.1')
else:
- manfile = os.path.join(manpath, prog+'.1'+__appname__+'.bz2')
+ manfile = os.path.join(manpath, prog+'.1'+'.bz2')
self.info('\tInstalling MAN page for', prog)
open(manfile, 'wb').write(raw)
self.manifest.append(manfile)

View File

@ -1,44 +0,0 @@
diff -Naur calibre-0.5.14.orig/setup.py calibre-0.5.14/setup.py
--- calibre-0.5.14.orig/setup.py 2009-05-29 17:25:45.000000000 +0000
+++ calibre-0.5.14/setup.py 2009-06-27 03:26:58.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')
optional = []
@@ -198,6 +196,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.14.orig/src/calibre/linux.py calibre-0.5.14/src/calibre/linux.py
--- calibre-0.5.14.orig/src/calibre/linux.py 2009-05-29 17:25:45.000000000 +0000
+++ calibre-0.5.14/src/calibre/linux.py 2009-06-27 03:26:23.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()]

View File

@ -0,0 +1,13 @@
diff -Naur calibre.orig/src/calibre/linux.py calibre/src/calibre/linux.py
--- calibre.orig/src/calibre/linux.py 2010-06-11 22:28:24.000000000 +0000
+++ calibre/src/calibre/linux.py 2010-06-13 23:07:49.000000000 +0000
@@ -133,9 +133,6 @@
if islinux:
self.setup_completion()
self.install_man_pages()
- if islinux:
- self.setup_desktop_integration()
- self.create_uninstaller()
from calibre.utils.config import config_dir
if os.path.exists(config_dir):

View File

@ -1,12 +0,0 @@
diff -Naur calibre-0.5.14.orig/src/tagging/forms.py calibre-0.5.14/src/tagging/forms.py
--- calibre-0.5.14.orig/src/tagging/forms.py 2009-05-29 17:25:45.000000000 +0000
+++ calibre-0.5.14/src/tagging/forms.py 2009-07-01 22:58:17.000000000 +0000
@@ -16,7 +16,7 @@
value = self.cleaned_data['name']
tag_names = parse_tag_input(value)
if len(tag_names) > 1:
- raise ValidationError(_('Multiple tags were given.'))
+ raise forms.ValidationError(_('Multiple tags were given.'))
elif len(tag_names[0]) > settings.MAX_TAG_LENGTH:
raise forms.ValidationError(
_('A tag may be no more than %s characters long.') %

View File

@ -7,13 +7,13 @@
|-----handy-ruler------------------------------------------------------|
calibre: Calibre (Ebook library manager)
calibre:
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:
calibre: Homepage: http://calibre.kovidgoyal.net/
calibre: