updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / bibus / PKGBUILD
blob17405c9fccb728be73c60559b42e171cb7bf82e6
1 # Contributor & Maintainer: machoo02 <ichthyoboy@gmail.com>
2 # Contributor: mutlu_inek <mutlu_inek@yahoo.de>
4 pkgname=bibus
5 pkgver=1.5.2
6 pkgrel=1
7 pkgdesc="A bibliographic database that can directly insert references in \
8 OpenOffice.org/LibreOffice and generate the bibliographic index."
9 url="http://sourceforge.net/projects/bibus-biblio/"
10 license="GPL"
11 arch=('any')
12 depends=('python-pysqlite' 'wxpython' 'pyxml' 'unixodbc' 'hicolor-icon-theme')
13 optdepends=('libreoffice' 'openoffice-base-bin')
14 source=(http://downloads.sourceforge.net/project/$pkgname-biblio/$pkgname-biblio/${pkgname}-${pkgver}/${pkgname}_${pkgver}.orig.tar.gz)
15 md5sums=('5bb8b26d0980ebb72a2882b618fbe62c')
16 install=${pkgname}.install
17 backup=(etc/bibus.config)
19 package() {
20   cd "$srcdir/$pkgname-$pkgver"
22   if [[ -d /usr/lib/libreoffice ]]; then
23         export oopath=/usr/lib/libreoffice/program
24         export ooure=/usr/lib/libreoffice/basis-link/ure-link/lib
25         export oobasis=/usr/lib/libreoffice/basis-link/program
26   elif [[ -d /opt/openoffice.org3 ]]; then
27         export oopath=/opt/openoffice.org3/program
28         export ooure=/opt/openoffice.org3/basis-link/ure-link/lib
29         export oobasis=/opt/openoffice.org3/basis-link/program
30   fi
32   make -f Setup/Makefile DESTDIR="$pkgdir/usr" python=/usr/bin/python2 \
33         sysconfdir="$pkgdir/etc" oopath=$oopath ooure=$ooure oobasis=$oobasis install
34   rm "$pkgdir/usr/bin/bibus"
35   ln -s /usr/share/bibus/bibusStart.py "$pkgdir/usr/bin/bibus"
36   rm "$pkgdir/usr/share/bibus/Setup/uninstall.sh"
37   
38   ## Fix .py files for python2
39   sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
40       -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
41       $(find $pkgdir -name '*.py')
42       
43   sed -i -e "s|${pkgdir}||g" "${pkgdir}/usr/share/bibus/bibus.cfg"