All pastes #1978233 Raw Edit

Unnamed

public text v1 · immutable
#1978233 ·published 2010-10-31 22:33 UTC
rendered paste body
# Maintainer: Alexandre Guimaraes - alexandre.guimaraes gmx.com
# Contributor: Christopher Schwaab -- christopher.schwaab gmail
pkgname=mendeleydesktop
pkgver=0.9.8.1
pkgrel=1
url="http://www.mendeley.com/"
pkgdesc="The desktop client for managing and sharing research papers."
license=('custom:mendeley_eula')
arch=('i686' 'x86_64')
[ $CARCH = 'x86_64' ] && _arch='x86_64'
[ $CARCH = 'i686' ]   && _arch='i486'
source=("http://www.mendeley.com/downloads/linux/$pkgname-$pkgver-linux-$_arch.tar.bz2")
[ $CARCH = 'x86_64' ] && md5sums=('6a8e143d69a4b530c02f3821b6d50fc2')
[ $CARCH = 'i686' ]   && md5sums=('eba9e819c3942ef15dd0d860fbb375ca')
depends=('qt' 'openssl' 'sqlite3' 'openssl-compatibility' 'libpng12')
makedepends=('cpio')

build() {
        cd $srcdir/$pkgname-$pkgver-linux-$_arch

        mkdir -p $pkgdir/opt/mendeleydesktop/{bin,lib,plugins}
        mkdir -p $pkgdir/usr/{bin,lib}

        rm -f INSTALL README

        # install libs
        mv lib/libMendeley.so lib/libMendeley.so.0.9 \
           $pkgdir/usr/lib/ 
        install -m755 lib/libMendeley.so.$pkgver \
                      lib/libPDFNetC.so \
                      $pkgdir/usr/lib/ 
        install -m755 lib/libpng.so.3 lib/libssl.so.0 \
                      lib/libQtGui.so.4 \
                      lib/libQtSvg.so.4 \
                      lib/libQtNetwork.so.4  \
                      lib/libQtXml.so.4 \
                      lib/libQtCore.so.4 \
                      lib/libQtSql.so.4 \
		      lib/libQtWebKit.so.4 \
		      lib/libQtXmlPatterns.so.4 \
                      $pkgdir/opt/mendeleydesktop/lib

        # install actual executables with pointer to sqlite plugin
        cat > $pkgdir/opt/mendeleydesktop/bin/qt.conf <<__EOF__
[Paths]
plugins=/opt/mendeleydesktop/plugins
__EOF__
        install -m755 \
           lib/mendeleydesktop/libexec/{Updater,mendeleydesktop.$_arch} \
           $pkgdir/opt/mendeleydesktop/bin 
        tar -cf - -C lib/mendeleydesktop/plugins . | \
          tar -C $pkgdir/opt/mendeleydesktop/plugins/ -xpf - 
        ln -s /usr/share/mendeleydesktop/ $pkgdir/opt/mendeleydesktop/bin/share

        # install launcher and fix up path
        sed -i "s~\"\$LOCAL_LIB_PATH\"/mendeleydesktop/libexec/~LD_LIBRARY_PATH=/opt/mendeleydesktop/lib:\$LD_LIBRARY_PATH /opt/mendeleydesktop/bin/~" \
               bin/mendeleydesktop 
        install -D -m755 bin/mendeleydesktop \
                         $pkgdir/usr/bin/mendeleydesktop 

        # install license and resources
        install -D -m644 LICENSE \
                         $pkgdir/usr/share/licenses/$pkgname/LICENSE 
        rm -f LICENSE

        find share/ | cpio -p -dum $pkgdir/usr 
        install -Dm644 share/icons/hicolor/48x48/apps/mendeleydesktop.png \
                       $pkgdir/usr/share/pixmaps/mendeleydesktop.png
        rm -rf share/{applications,icons}

}