desktop/mendeleydesktop/PKGBUILD

109 lines
3.2 KiB
Bash
Raw Normal View History

2011-11-23 12:51:50 +08:00
pkgname=mendeleydesktop
2017-02-10 06:35:21 +08:00
pkgver=1.17.7
2016-12-11 03:20:04 +08:00
pkgrel=1
2015-01-30 00:42:49 +08:00
pkgdesc="Academic software for managing and sharing research papers (desktop client)"
url=http://www.mendeley.com/release-notes/
arch=('x86_64')
2015-04-29 04:23:32 +08:00
depends=('python2' 'qtwebkit')
2015-01-30 00:42:49 +08:00
license=('custom:mendeley_eula')
install=mendeleydesktop.install
categories=('education')
2012-11-28 20:44:05 +08:00
screenshot=('http://www.timelordz.com/blog/wp-content/uploads/2010/08/MendeleyClient.png')
2015-04-29 04:23:32 +08:00
source=("http://download.mendeley.com/linux/$pkgname-$pkgver-linux-x86_64.tar.bz2")
2017-02-10 06:35:21 +08:00
sha1sums=('13056fb09075a99fb428fb531e614e84664b2c7c')
2012-01-19 01:51:52 +08:00
2015-04-29 04:23:32 +08:00
prepare() {
cd "${srcdir}/$pkgname-$pkgver-linux-x86_64"
2012-10-17 06:16:55 +08:00
2015-04-29 04:23:32 +08:00
sed -i '1s@^#!/usr/bin/python$@&2@' bin/mendeleydesktop
# remember, if you upgrade from 1.13.6 or older,
# remove any old versions of ".desktop" file of mendeley in ~/.local/share/applications/
# stop the creations of .desktop file of mendeley in ~/.local/share/applications/
echo '#!/bin/sh
2012-10-17 06:16:55 +08:00
2015-04-29 04:23:32 +08:00
DESKTOP_PATH=$HOME/.local/share/applications/
DESKTOP_FILE=$DESKTOP_PATH/mendeleydesktop.desktop
MENDELEYDESKTOP_BIN=$HOME/.local/share/mendeleydesktop
GCONF_TOOL=`which gconftool-2`
2012-10-17 06:16:55 +08:00
2015-04-29 04:23:32 +08:00
if [ $? -ne 0 ]; then
echo "Unable to find gconftool-2. The mendeley:// link handler may not be installed correctly." >&2
fi
if [ ! -d "$DESKTOP_PATH" ]; then
mkdir -p "$DESKTOP_PATH"
fi
2012-10-17 06:16:55 +08:00
2015-04-29 04:23:32 +08:00
while getopts "u" flag
do
case $flag in
u)
# Uninstall the link handler
rm -f $DESKTOP_FILE
$GCONF_TOOL -u /desktop/gnome/url-handlers/mendeley
2012-10-17 06:16:55 +08:00
2015-04-29 04:23:32 +08:00
exit 0
;;
\?)
echo "Unknown option: -$OPTARG" >&2
;;
esac
done
shift $(($OPTIND - 1))
if [ $# -ne 1 ]; then
echo "Usage: "`basename $0`" [options] <path>"
echo " -u : Uninstall the mendeley:// link handler"
echo ""
echo "Install the mendeley:// link handler to launch <path>"
echo ""
exit 1
fi
if [ ! -f "$1" ]; then
echo "Mendeley Desktop binary '$1' does not exist"
exit 1
fi
# install the gnome link handler
$GCONF_TOOL -s /desktop/gnome/url-handlers/mendeley/command "$MENDELEYDESKTOP_BIN %s" --type String
$GCONF_TOOL -s /desktop/gnome/url-handlers/mendeley/enabled --type Boolean true' > bin/install-mendeley-link-handler.sh
2012-10-17 06:16:55 +08:00
#Remove unneeded lines if gconf is not installed.
if ! which gconftool-2 &>/dev/null;then
sed -i '6d;74d;75d' \
2015-04-29 04:23:32 +08:00
bin/install-mendeley-link-handler.sh
2012-10-17 06:16:55 +08:00
fi
2015-04-29 04:23:32 +08:00
}
package() {
cd "$pkgname-$pkgver-linux-x86_64"
install -d ${pkgdir}/usr/{bin,lib,share}
cp -R bin ${pkgdir}/usr
# remove bundled Qt from package
rm -rf lib/qt
cp -R lib ${pkgdir}/usr
# remove qt.conf to avoid Qt plugins fail to load
rm -f ${pkgdir}/usr/bin/qt.conf
2015-04-29 04:23:32 +08:00
install -D share/applications/${pkgname}.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop
install -D share/doc/${pkgname}/License.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
install -d ${pkgdir}/usr/share/{icons,mendeleydesktop}
cp -R share/icons ${pkgdir}/usr/share
cp -R share/mendeleydesktop ${pkgdir}/usr/share
#Remove bundled Qt from package
cat << __EOF__
Removing bundled Qt library.
If you used "--force-bundled-qt" to start mendeley,
make sure you remove any old versions of ".desktop" file of mendeley in ~/.local/share/applications/,
because mendeley will automatically create one there. This will apply only to version 1.13.6 or older.
__EOF__
2012-11-19 04:31:09 +08:00
}