desktop/calibre/PKGBUILD

67 lines
2.5 KiB
Bash
Raw Normal View History

2013-05-26 19:26:30 +08:00
# maintainer: almack
2010-11-19 20:36:49 +08:00
pkgname=calibre
2013-07-30 05:31:34 +08:00
pkgver=0.9.41
2013-02-17 00:53:19 +08:00
pkgrel=1
pkgdesc="Ebook management application"
arch=('x86_64')
2010-11-19 20:36:49 +08:00
url="http://calibre.kovidgoyal.net/"
license=('GPL3')
depends=('python2' 'python2-imaging' 'libusb' 'pyqt' 'python-mechanize'
2013-05-12 07:51:11 +08:00
'imagemagick' 'dbus-python' 'python-lxml' 'python2-beautifulsoup' 'python2-dateutil'
'python-cssutils' 'desktop-file-utils' 'python2-dns' 'libmtp'
'podofo' 'xdg-utils' 'cherrypy' 'python2-pdf' 'unrar' 'chmlib' 'poppler'
2012-11-01 09:17:52 +08:00
'poppler-qt' 'icu' 'libwmf' 'libffi' 'python2-six' 'python2-netifaces' 'python2-cssselect')
makedepends=('python2-pycountry' 'qt-private-headers')
2013-05-12 07:51:11 +08:00
#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
2013-06-23 22:32:59 +08:00
source=("http://sourceforge.net/projects/calibre/files/${pkgver}/calibre-${pkgver}.tar.xz"
2013-05-12 07:51:11 +08:00
'desktop_integration.patch')
2013-07-30 05:31:34 +08:00
md5sums=('2037b44c90a66e97823a637edfa194ca'
2013-05-12 07:51:11 +08:00
'8353d1878c5a498b3e49eddef473605f')
2012-08-27 00:01:32 +08:00
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
2013-05-12 07:51:11 +08:00
rm -rf resources/${pkgname}-portable.*
2013-06-08 01:57:47 +08:00
mkdir -p src/calibre/plugins
2013-05-12 07:51:11 +08:00
2011-03-09 20:23:16 +08:00
sed -i -e "s/ldflags = shlex.split(ldflags)/ldflags = shlex.split(ldflags) + ['-fPIC']/" setup/extensions.py
2013-05-12 07:51:11 +08:00
2011-03-09 20:23:16 +08:00
sed -i -e 's:\(#!/usr/bin/env[ ]\+python$\|#!/usr/bin/python$\):\12:g' \
$(find . -regex ".*.py\|.*.recipe")
2013-05-07 04:54:52 +08:00
2013-01-03 02:15:48 +08:00
LANG='en_US.UTF-8' python2 setup.py build
2013-06-08 01:57:47 +08:00
#LANG='en_US.UTF-8' python2 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
patch -p1 -i "${srcdir}/desktop_integration.patch"
2010-11-19 20:36:49 +08:00
2012-08-22 21:03:59 +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
python2 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
2013-01-19 02:09:55 +08:00
python2 -m compileall "${pkgdir}/usr/lib/calibre/"
python2 -O -m compileall "${pkgdir}/usr/lib/calibre/"
2011-01-07 09:05:37 +08:00
}