]> Pileus Git - ~andy/sunrise/blob - net-misc/mugshot/mugshot-1.1.95.ebuild
sunrise/ app-portage/elog-list/elog-list-0.0.6.ebuild: Update headers for 2010
[~andy/sunrise] / net-misc / mugshot / mugshot-1.1.95.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 GCONF_DEBUG="no"
6 SCROLLKEEPER_UPDATE="no"
7
8 inherit autotools eutils gnome2 multilib
9
10 DESCRIPTION="Companion software for mugshot.org"
11 HOMEPAGE="http://www.mugshot.org/"
12 SRC_URI="http://download.mugshot.org/client/sources/linux/${P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="firefox xulrunner"
18
19 RDEPEND=">=dev-libs/glib-2.6
20         >=dev-libs/dbus-glib-0.71
21         media-libs/jpeg
22         >=gnome-extra/desktop-data-model-1.2
23         >=net-misc/curl-7.13.1
24         >=sys-apps/dbus-1
25         x11-libs/cairo
26         >=x11-libs/gtk+-2.10
27         x11-libs/libXScrnSaver
28         >=x11-libs/hippo-canvas-0.2.30
29         x11-libs/pango
30         firefox? ( !xulrunner? ( www-client/mozilla-firefox ) )
31         xulrunner? ( net-libs/xulrunner )"
32
33 DEPEND=">=dev-util/pkgconfig-0.19
34         >=gnome-base/gconf-2
35         ${RDEPEND}"
36
37 FIREDIRS="/usr/$(get_libdir)/mozilla-firefox"
38
39 src_unpack() {
40         unpack ${A}
41         cd "${S}"
42         # configure looks in the wrong place for xpidl
43         sed -e 's:bin/xpidl:xpidl:' -i configure.ac
44         epatch "${FILESDIR}/${PN}-1.1.92-libxpcom.patch"
45         epatch "${FILESDIR}/${PN}-1.1.93-use-firefox.patch"
46         eautoreconf
47         if use firefox || use xulrunner ; then
48                 G2CONF="--enable-firefox"
49                 if use xulrunner ; then
50                         G2CONF="${G2CONF} --with-gecko-sdk=/usr/$(get_libdir)/xulrunner"
51                 else
52                         G2CONF="${G2CONF} --with-gecko-sdk=/usr/$(get_libdir)/mozilla-firefox"
53                 fi
54
55                 # use the correct libdir in the firefox-update.sh script
56                 sed -e "s:GET_LIBDIR:$(get_libdir):" \
57                         "${FILESDIR}/${PN}-1.1.58-firefox-update.sh" > "${S}/firefox-update.sh"
58
59                 # add support for (32-bit) mozilla-firefox-bin if our profile is
60                 # x86 or amd64 with a 32-bit userland
61                 if [ "${ARCH}" = "x86" -o "${ABI}" = "x86" ] ; then
62                         FIREDIRS="${FIREDIRS} /opt/firefox"
63                 fi
64                 sed -e "s:FIREDIRS:${FIREDIRS}:" -i "${S}/firefox-update.sh"
65         else
66                 G2CONF="--disable-firefox"
67         fi
68 }
69
70 src_install() {
71         gnome2_src_install
72
73         # this replaces the broken pkg_prerm logic we had before, which removed the
74         # firefox extensions on every upgrade.
75         if use firefox || use xulrunner ; then
76                 einfo "Installing firefox extension."
77                 for d in ${FIREDIRS} ; do
78                         if [ -e "$d/firefox-bin" -a -d "$d/extensions" ] ; then
79                                 dosym "/usr/$(get_libdir)/mugshot/firefox" "${d}/extensions/firefox@mugshot.org"
80                         fi
81                 done
82         fi
83 }
84
85 pkg_postinst () {
86         gnome2_pkg_postinst
87
88         if use firefox || use xulrunner ; then
89                 # pkg_prerm logic was broken in older ebuilds
90                 elog
91                 elog "If you are upgrading from <net-misc/mugshot-1.1.58 please run"
92                 elog " /usr/share/firefox-update.sh install"
93                 elog "to properly install the firefox extension."
94                 elog
95                 elog "Please restart firefox in order to use the mugshot extension."
96         fi
97 }