summaryrefslogtreecommitdiff
blob: 4cf7e2334cbcb0ddba274628348b809779d3bd9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit eutils

if [ "${ARCH}" = "amd64" ] ; then
	LNXARCH="linux-x86_64"
else
	LNXARCH="linux-i486"
fi

DESCRIPTION="A free research management tool for desktop & web"
HOMEPAGE="http://www.mendeley.com/"
SRC_URI="http://download.mendeley.com/linux/${P}-${LNXARCH}.tar.bz2"


LICENSE="Mendelay-EULA"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RESTRICT="mirror strip"
RDEPEND="dev-libs/openssl:0.9.8
	media-libs/fontconfig
	media-libs/freetype
	media-libs/libpng:1.2"

S="${WORKDIR}/${P}-${LNXARCH}"

MENDELEY_INSTALL_DIR="/opt/${PN}"

src_install() {
	# install menu
	domenu "share/applications/${PN}.desktop"
	# Install commonly used icon sizes
	for res in 16x16 22x22 32x32 48x48 64x64 128x128 ; do
		insinto "/usr/share/icons/hicolor/${res}/apps"
		doins "share/icons/hicolor/${res}/apps/${PN}.png" || \
		die "Installing icons failed."
	done
	insinto "/usr/share/pixmaps"
	doins "share/icons/hicolor/48x48/apps/${PN}.png" || \
	die "Installing pixmap failed."

	# dodoc
	dodoc "share/doc/${PN}/"* || die "Installing docs failed."

	# create directories for installation
	dodir ${MENDELEY_INSTALL_DIR} || die "dodir failed"
	dodir "${MENDELEY_INSTALL_DIR}/lib" || die "dodir failed"
	dodir "${MENDELEY_INSTALL_DIR}/share" || die "dodir failed"

	# install binaries
	mv "bin" "${D}${MENDELEY_INSTALL_DIR}" || die "Installing bin failed."
	mv "lib" "${D}${MENDELEY_INSTALL_DIR}" || die "Installing libs failed."
	mv "share/${PN}" "${D}${MENDELEY_INSTALL_DIR}/share" || \
	die "Installing shared files failed."
	dosym "${MENDELEY_INSTALL_DIR}/bin/${PN}" "/opt/bin/${PN}" || \
	die "Installing launcher symlinks failed."
}