summaryrefslogtreecommitdiffstats
path: root/office/calibre/calibre.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'office/calibre/calibre.SlackBuild')
-rwxr-xr-x[-rw-r--r--]office/calibre/calibre.SlackBuild51
1 files changed, 34 insertions, 17 deletions
diff --git a/office/calibre/calibre.SlackBuild b/office/calibre/calibre.SlackBuild
index ff5e573439..4ed7729d54 100644..100755
--- a/office/calibre/calibre.SlackBuild
+++ b/office/calibre/calibre.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for calibre
-# Copyright 2009-2011 Larry Hajali <larryhaja[at]gmail[dot]com>
+# Copyright 2009-2012 Larry Hajali <larryhaja[at]gmail[dot]com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=calibre
-VERSION=0.7.45
+VERSION=${VERSION:-0.8.69}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -61,7 +61,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM
chown -R root:root .
find . \
@@ -70,14 +70,18 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Fix man pages.
-patch -p1 < $CWD/patches/manpages-installation.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 shebangs.
+patch -p1 < $CWD/patches/fix-shebangs.patch
+# Make sure version string is correct.
+sed -i "/^numeric_version/s|(.*)|(${VERSION//\./, })|" src/calibre/constants.py
-CFLAGS="$SLKCFLAGS" python setup.py build
+OVERRIDE_CFLAGS="$SLKCFLAGS" \
+OVERRIDE_LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
+python setup.py build
# We have to fake out CALIBRE_CONFIG_DIRECTORY if there is a current
# calibre installation while the build process takes place. :/
@@ -97,28 +101,41 @@ python setup.py install \
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-
# Fix permissions on calibre's bash completion.
chmod 0755 $PKG/etc/bash_completion.d/$PRGNAM
# 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 $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/share/{applications,mime/packages}
+cat src/calibre/linux.py | sed -n "/^VIEWER/,/^'''/p" | \
+ sed -e "/'''/d" > $PKG/usr/share/applications/$PRGNAM-lrfviewer.desktop
+cat src/calibre/linux.py | sed -n "/^EVIEWER/,/^'''/p" | \
+ sed -e "/'''/d" > $PKG/usr/share/applications/$PRGNAM-ebook-viewer.desktop
+cat src/calibre/linux.py | sed -n "/^GUI/,/^'''/p" | \
+ sed -e "/'''/d" > $PKG/usr/share/applications/$PRGNAM-gui.desktop
+cat src/calibre/linux.py | sed -n "/^MIME/,/^'''/p" | \
+ sed -e "/'''/d" > $PKG/usr/share/mime/packages/$PRGNAM-mimetypes.xml
for i in 16 24 32 64 96 128; do
convert resources/images/lt.png -resize ${i}x${i}! $PRGNAM-gui-${i}.png
- convert -background none resources/images/viewer.png \
+ convert -background none imgsrc/viewer.svg \
-resize ${i}x${i}! $PRGNAM-viewer-${i}.png
+ convert imgsrc/mimetypes/lrf.svg \
+ -resize ${i}x${i}! application-x-sony-bbeb-${i}.png
install -D -m 0644 $PRGNAM-gui-${i}.png \
$PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM-gui.png
install -D -m 0644 $PRGNAM-viewer-${i}.png \
$PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM-viewer.png
+ install -D -m 0644 application-x-sony-bbeb-${i}.png \
+ $PKG/usr/share/icons/hicolor/${i}x${i}/mimetypes/application-x-sony-bbeb.png
+done
+
+# Don't ship fonts that are already in Slackware.
+for FONT in $PKG/usr/share/$PRGNAM/fonts/liberation/*; do
+ # Make sure that the fonts exist first before deleting them.
+ if find /usr/share/fonts/ -name "$(basename $FONT)" 2>/dev/null 1>/dev/null
+ then
+ rm -f $FONT
+ ln -s $(find /usr/share/fonts/ -name "$(basename $FONT)") $FONT
+ fi
done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION