summaryrefslogtreecommitdiff
blob: 3d46df65fb20f8594bce83e9f922830f3c192143 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

WANT_AUTOCONF="latest"
WANT_AUTOMAKE="latest"
GCONF_DEBUG="no"
SCROLLKEEPER_UPDATE="no"

inherit autotools eutils gnome2 multilib

DESCRIPTION="Companion software for mugshot.org; also includes the ddm library"
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 sqlite xulrunner"

RDEPEND=">=dev-libs/glib-2.6
	>=dev-libs/dbus-glib-0.71
	>=dev-libs/libpcre-6.3
	media-libs/jpeg
	>=gnome-base/gnome-desktop-2.10
	>=gnome-base/gnome-vfs-2
	>=net-libs/loudmouth-1.2.2
	>=net-misc/curl-7.13.1
	x11-libs/cairo
	>=x11-libs/gtk+-2.6
	x11-libs/libXScrnSaver
	x11-libs/pango
	firefox? ( !xulrunner? (
		>=www-client/mozilla-firefox-1.5 <www-client/mozilla-firefox-2.0.1 ) )
	sqlite? ( >=dev-db/sqlite-3.3 )
	xulrunner? ( net-libs/xulrunner )"

DEPEND=">=dev-util/pkgconfig-0.19
	>=gnome-base/gconf-2
	${RDEPEND}"

FIREDIRS="/usr/$(get_libdir)/mozilla-firefox"

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.42-libxpcom.patch" || die "epatch failed"
	epatch "${FILESDIR}/${PN}-1.1.56-use-firefox.patch" || die "epatch failed"
	eautoreconf
	if use firefox || use xulrunner ; then
		G2CONF="--enable-firefox"
		if use xulrunner ; then
			G2CONF="${G2CONF} --with-gecko-sdk=/usr/$(get_libdir)/xulrunner"
		else
			G2CONF="${G2CONF} --with-gecko-sdk=/usr/$(get_libdir)/mozilla-firefox"
		fi
		sed -e "s:GET_LIBDIR:$(get_libdir):" \
			"${FILESDIR}/${P}-firefox-update.sh" > "${S}/firefox-update.sh"
		# support mozilla-firefox-bin if we are compiling for x86
		if [ "${ARCH}" = "x86" -o "${ABI}" = "x86" ] ; then
			FIREDIRS="${FIREDIRS} /opt/firefox"
		fi
		sed -e "s:FIREDIRS:${FIREDIRS}:" -i "${S}/firefox-update.sh"
	else
		G2CONF="--disable-firefox"
	fi
	# external hippo-canvas seems to be deprecated now?
	G2CONF="${G2CONF} $(use_with sqlite) --with-included-canvas"
}

src_install() {
	gnome2_src_install

	# this replaces the broken pkg_prerm logic we had before, which removed the 
	# firefox extensions on every upgrade.
	if use firefox || use xulrunner ; then
		einfo "Installing firefox extension."
		for d in ${FIREDIRS} ; do
			if [ -e "$d/firefox-bin" -a -d "$d/extensions" ] ; then
				dosym "/usr/$(get_libdir)/mugshot/firefox" "${d}/extensions/firefox@mugshot.org"
			fi
		done
	fi
}

pkg_postinst () {
	gnome2_pkg_postinst

	if use firefox || use xulrunner ; then
		# pkg_prerm logic was broken in older ebuilds
		elog
		elog "If you are upgrading from <net-misc/mugshot-1.1.58 please run"
		elog " /usr/share/firefox-update.sh install"
		elog "to properly install the firefox extension."
		elog
		elog "Please restart firefox in order to use the mugshot extension."
	fi
	elog
	elog "net-misc/mugshot does not (yet) support logging in via mozilla-firefox-3"
	elog "If you use firefox 3, try logging into mugshot.org using epiphany."
}