summaryrefslogtreecommitdiff
blob: 94bbdc238ae0415f7e7526079a9176794804e598 (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
64
65
66
67
68
69
70
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

WANT_AUTOCONF="latest"
WANT_AUTOMAKE="latest"

inherit autotools eutils gnome2 multilib

DESCRIPTION="Program to facilitate social networking"
HOMEPAGE="http://www.mugshot.org"
SRC_URI="http://download.mugshot.org/client/sources/linux/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="firefox"

RDEPEND=">=dev-libs/glib-2.6
	>=x11-libs/gtk+-2.6
	|| ( >=dev-libs/dbus-glib-0.71 ( >=sys-apps/dbus-0.60 <sys-apps/dbus-0.90 ) )
	>=net-libs/loudmouth-1
	>=gnome-base/gconf-2
	>=net-misc/curl-7.13.1
	firefox? ( >=www-client/mozilla-firefox-1.5 <www-client/mozilla-firefox-2.0.1 )
	x11-libs/libXScrnSaver"

DEPEND="${RDEPEND}"

src_unpack() {
	unpack ${A}
	cd "${S}"
	# configure looks in the wrong place for xpidl
	sed -e 's:bin/xpidl:xpidl:' -i configure.ac
	epatch "${FILESDIR}/${PN}-1.1.22-as-needed.patch"
	epatch "${FILESDIR}/${P}-use-firefox.patch"
	eautoreconf
	use firefox && sed -e "s:GET_LIBDIR:$(get_libdir):" \
		"${FILESDIR}/${PN}-1.1.26-firefox-update.sh" > "${S}/firefox-update.sh"
}

src_compile() {
	econf $(use_enable firefox) \
		--with-gecko-sdk=/usr/$(get_libdir)/mozilla-firefox/ || die "./configure failed"
	emake || die "emake failed"
}

src_install () {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc AUTHORS ChangeLog README
}

pkg_postinst () {
	gnome2_pkg_postinst

	# install firefox extension
	if use firefox ; then
		einfo "Installing firefox extension. "
		einfo "Please restart firefox in order to use the mugshot extension."
		"${S}/firefox-update.sh" install
	fi
}

pkg_prerm () {
	# remove firefox extension
	if [ -x /usr/share/mugshot/firefox-update.sh ] ; then
		einfo "Removed the mugshot firefox extension."
		/usr/share/mugshot/firefox-update.sh remove
	fi
}