desktop/calibre/PKGBUILD

62 lines
2.3 KiB
Bash
Raw Normal View History

2010-11-19 20:36:49 +08:00
#
# Apps Packages for Chakra, part of chakra-project.org
#
# contributor (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
pkgname=calibre
2012-05-26 06:02:26 +08:00
pkgver=0.8.53
2011-03-12 22:29:59 +08:00
pkgrel=1
pkgdesc="Ebook management application"
2012-05-26 06:02:26 +08:00
arch=('i686' 'x86_64')
2010-11-19 20:36:49 +08:00
url="http://calibre.kovidgoyal.net/"
license=('GPL3')
depends=('python2' 'python-imaging' 'libusb' 'pyqt' 'python-mechanize'
2010-11-19 20:36:49 +08:00
'imagemagick' 'dbus-python' 'python-lxml' 'beautiful-soup' 'python-dateutil'
2012-05-26 06:02:26 +08:00
'python-cssutils' 'desktop-file-utils' 'python-dnspython'
'podofo>=0.8.1-6' 'xdg-utils' 'cherrypy' 'python-pypdf' 'unrar' 'chmlib' 'poppler' 'poppler-qt' 'icu' 'libwmf' 'libffi')
makedepends=('python-pycountry')
optdepends=('ipython: to use calibre-debug')
2012-04-21 01:20:22 +08:00
screenshot=('https://lh5.googleusercontent.com/_lG58t3XWd3c/TcNwiXkAx_I/AAAAAAAAAEc/M34I4uY9UUY/s800/gui.jpeg')
2010-11-19 20:36:49 +08:00
install=calibre.install
2011-12-10 13:06:22 +08:00
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.xz
2011-03-09 20:23:16 +08:00
desktop_integration.patch)
md5sums=('0842bdd815d5fe014ec6dac6a581a8e8'
2012-05-20 14:50:35 +08:00
'ed9b53a3cf8b3f55aa4f7891e6b45a41')
2010-11-19 20:36:49 +08:00
build() {
2011-05-29 19:57:47 +08:00
cd "${srcdir}/${pkgname}"
2010-11-19 20:36:49 +08:00
2011-05-29 19:57:47 +08:00
rm -rf src/cherrypy
2011-03-09 20:23:16 +08:00
sed -i -e "s/ldflags = shlex.split(ldflags)/ldflags = shlex.split(ldflags) + ['-fPIC']/" setup/extensions.py
sed -i -e 's:\(#!/usr/bin/env[ ]\+python$\|#!/usr/bin/python$\):\12:g' \
$(find . -regex ".*.py\|.*.recipe")
2012-05-26 06:02:26 +08:00
python setup.py build
2011-12-17 03:08:36 +08:00
#python setup.py resources
2011-07-16 23:51:57 +08:00
python setup.py translations
2010-11-19 20:36:49 +08:00
}
package() {
2011-03-09 20:23:16 +08:00
cd ${pkgname}
2012-05-26 06:02:26 +08:00
2011-07-16 23:51:57 +08:00
patch -Np1 -i $srcdir/desktop_integration.patch
2010-11-19 20:36:49 +08:00
# More on desktop integration (e.g. enforce chakra defaults)
2011-03-09 20:23:16 +08:00
sed -i -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \
-e "s|self.opts.staging_sharedir, 'man/man1'|self.opts.staging_root, 'usr/share/man/man1'|" \
-e "s|manpath, prog+'.1'+__appname__+'.bz2'|manpath, prog+'.1'+'.bz2'|" \
-e "s|old_udev = '/etc|old_udev = '${pkgdir}/etc|" \
-e "s/^Name=calibre/Name=Calibre/g" src/calibre/linux.py
2010-11-19 20:36:49 +08:00
2011-03-09 20:23:16 +08:00
# Fix the environment module location
sed -i -e "s|(prefix=.*)|(prefix='$pkgdir/usr')|g" setup/install.py
2010-11-19 20:36:49 +08:00
2011-03-09 20:23:16 +08:00
mkdir -p ${pkgdir}/usr/lib/python2.7/site-packages
python setup.py install --root=${pkgdir}/ --prefix=/usr \
2011-03-09 20:23:16 +08:00
--staging-bindir=${pkgdir}/usr/bin \
--staging-libdir=${pkgdir}/usr/lib \
--staging-sharedir=${pkgdir}/usr/share
2010-11-19 20:36:49 +08:00
2011-03-09 20:23:16 +08:00
find ${pkgdir} -type d -empty -delete
2011-01-07 09:05:37 +08:00
}