1 # Maintainer: Andrea Fagiani <andfagiani _at_ gmail dot com>
5 pkgdesc="E-book library management application"
7 url="http://calibre.kovidgoyal.net/"
9 depends=('chmlib' 'coffee-script-git' 'desktop-file-utils' 'imagemagick'
10 'libusb' 'libwmf' 'podofo>=0.8.4' 'poppler>=0.12.0' 'python2-qt'
11 'python-beautifulsoup' 'python2-cherrypy' 'python2-cssutils' 'python2-dateutil'
12 'python-dnspython' 'python-imaging' 'python-lxml'
13 'python-mechanize' 'python-pypdf' 'shared-mime-info' 'unrar')
14 makedepends=('bzr' 'python2-pycountry' 'python2-distribute')
15 optdepends=('ipython: to use calibre-debug')
18 install=calibre.install
19 source=(desktop_integration.patch)
20 md5sums=('1a2f4984d68c10a34edc6291ddb88056')
22 _bzrtrunk="lp:calibre"
27 msg "Connecting to Bazaar server...."
29 if [ -d $_bzrmod ] ; then
30 cd $_bzrmod && bzr pull -r $pkgver
31 msg "The local files are updated."
33 bzr branch $_bzrtrunk $_bzrmod -r $pkgver
36 msg "Bazaar checkout done or server timeout"
37 msg "Starting make..."
39 rm -rf "$srcdir/$_bzrmod-build"
40 cp -r "$srcdir/$_bzrmod" "$srcdir/$_bzrmod-build"
41 cd "$srcdir/$_bzrmod-build"
47 rm -rf src/{cherrypy,pyPdf}
49 sed -i -e "s/ldflags = shlex.split(ldflags)/ldflags = shlex.split(ldflags) + ['-fPIC']/" setup/extensions.py
51 sed -i -e 's:\(#!/usr/bin/env[ ]\+python$\|#!/usr/bin/python$\):\12:g' \
52 $(find . -regex ".*.py\|.*.recipe")
54 python2 setup.py build
55 python2 setup.py resources
56 python2 setup.py translations
60 cd "$srcdir/$_bzrmod-build"
62 patch -Np1 -i $srcdir/desktop_integration.patch
64 # disable update checking by default
65 sed -i -e 's/\(--no-update-check.*\)False\(.*\)store_true/\1True\2store_false/g' src/calibre/gui2/main.py
67 # More on desktop integration (e.g. enforce arch defaults)
68 sed -i -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \
69 -e "s|self.opts.staging_sharedir, 'man/man1'|self.opts.staging_root, 'usr/share/man/man1'|" \
70 -e "s|manpath, prog+'.1'+__appname__+'.bz2'|manpath, prog+'.1'+'.bz2'|" \
71 -e "s|old_udev = '/etc|old_udev = '${pkgdir}/etc|" \
72 -e "s/^Name=calibre/Name=Calibre/g" src/calibre/linux.py
74 # Fix the environment module location
75 sed -i -e "s|(prefix=.*)|(prefix='$pkgdir/usr')|g" setup/install.py
77 mkdir -p ${pkgdir}/usr/lib/python2.7/site-packages
78 python2 setup.py install --root=${pkgdir}/ --prefix=/usr \
79 --staging-bindir=${pkgdir}/usr/bin \
80 --staging-libdir=${pkgdir}/usr/lib \
81 --staging-sharedir=${pkgdir}/usr/share
83 find ${pkgdir} -type d -empty -delete
85 # Decompress the man pages so makepkg will do it for us.
86 for decom in ${pkgdir}/usr/share/man/man1/*.bz2; do