/[gentoo-x86]/www-client/seamonkey-bin/seamonkey-bin-2.6.1.ebuild
Gentoo

Contents of /www-client/seamonkey-bin/seamonkey-bin-2.6.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Tue Feb 21 05:19:33 2012 UTC (6 years, 3 months ago) by jdhore
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Remove old.

(Portage version: 2.2.0_alpha87/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey-bin/seamonkey-bin-2.6.1.ebuild,v 1.5 2012/02/12 23:24:02 anarchy Exp $
4
5 EAPI="4"
6
7 inherit eutils multilib mozextension pax-utils nsplugins fdo-mime gnome2-utils
8
9 LANGS=(be ca cs de en-GB en-US es-AR es-ES fi fr gl hu it
10 ja lt nb-NO nl pl pt-PT ru sk sv-SE tr zh-CN)
11
12 MY_PV="${PV/_alpha/a}"
13 MY_P="${PN}-${MY_PV}"
14 MY_PN="${PN/-bin}"
15
16 DESCRIPTION="Mozilla Application Suite - web browser, email, HTML editor, IRC"
17 FTP_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${MY_PN}/releases/"
18 SRC_URI="
19 amd64? ( ${FTP_URI}/${MY_PV}/contrib/seamonkey-${MY_PV}.en-US.linux-x86_64.tar.bz2 -> ${PN}_x86_64-${PV}.tar.bz2 )
20 x86? ( ${FTP_URI}/${MY_PV}/linux-i686/en-US/seamonkey-${MY_PV}.tar.bz2 -> ${PN}_i686-${PV}.tar.bz2 )"
21 HOMEPAGE="http://www.seamonkey-project.org/"
22 RESTRICT="strip"
23 QA_EXECSTACK="opt/seamonkey/*"
24
25 KEYWORDS="-* amd64 x86"
26 SLOT="0"
27 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
28 IUSE="startup-notification"
29
30 DEPEND="app-arch/unzip"
31 RDEPEND="dev-libs/dbus-glib
32 >=media-libs/alsa-lib-1.0.16
33 >=x11-libs/gtk+-2.10:2
34 x11-libs/libXrender
35 x11-libs/libXt
36 x11-libs/libXmu"
37
38 S="${WORKDIR}/seamonkey"
39
40 for X in "${LANGS[@]}" ; do
41 # en and en_US are handled internally
42 if [[ ${X} != en ]] && [[ ${X} != en-US ]]; then
43 SRC_URI="${SRC_URI}
44 linguas_${X/-/_}? (
45 ${FTP_URI}/${MY_PV}/langpack/seamonkey-${MY_PV}.${X}.langpack.xpi -> ${P/-bin/}-${X}.xpi )"
46 fi
47 IUSE="${IUSE} linguas_${X/-/_}"
48 # Install all the specific locale xpis if there's no generic locale xpi
49 # Example: there's no pt.xpi, so install all pt-*.xpi
50 if ! has ${X%%-*} "${LANGS[@]}"; then
51 SRC_URI="${SRC_URI}
52 linguas_${X%%-*}? (
53 ${FTP_URI}/${MY_PV}/langpack/seamonkey-${MY_PV}.${X}.langpack.xpi -> ${P/-bin/}-${X}.xpi )"
54 IUSE="${IUSE} linguas_${X%%-*}"
55 fi
56 done
57
58 linguas() {
59 # Generate the list of language packs called "linguas"
60 # This list is used to install the xpi language packs
61 local LINGUA
62 for LINGUA in ${LINGUAS}; do
63 if has ${LINGUA} en en_US; then
64 # For mozilla products, en and en_US are handled internally
65 continue
66 # If this language is supported by ${P},
67 elif has ${LINGUA} "${LANGS[@]//-/_}"; then
68 # Add the language to linguas, if it isn't already there
69 has ${LINGUA//_/-} "${linguas[@]}" || linguas+=(${LINGUA//_/-})
70 continue
71 # For each short LINGUA that isn't in LANGS,
72 # add *all* long LANGS to the linguas list
73 elif ! has ${LINGUA%%-*} "${LANGS[@]}"; then
74 for LANG in "${LANGS[@]}"; do
75 if [[ ${LANG} == ${LINGUA}-* ]]; then
76 has ${LANG} "${linguas[@]}" || linguas+=(${LANG})
77 continue 2
78 fi
79 done
80 fi
81 ewarn "Sorry, but ${P} does not support the ${LINGUA} locale"
82 done
83 }
84
85 src_unpack() {
86 unpack ${A}
87
88 linguas
89 for X in "${linguas[@]}"; do
90 # FIXME: Add support for unpacking xpis to portage
91 [[ ${X} != "en" ]] && xpi_unpack "${P/-bin/}-${X}.xpi"
92 done
93 if [[ "${linguas[*]}" != "" && "${linguas[*]}" != "en" ]]; then
94 einfo "Selected language packs (first will be default): ${linguas[*]}"
95 fi
96 }
97
98 src_install() {
99 declare MOZILLA_FIVE_HOME=/opt/seamonkey
100
101 # Install seamonkey in /opt
102 dodir ${MOZILLA_FIVE_HOME%/*}
103 mv "${S}" "${D}${MOZILLA_FIVE_HOME}"
104
105 linguas
106 for X in "${linguas[@]}"; do
107 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P/-bin/}-${X}"
108 done
109
110 local LANG=${linguas%% *}
111 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
112 elog "Setting default locale to ${LANG}"
113 echo "pref(\"general.useragent.locale\", \"${LANG}\");" \
114 >> "${D}${MOZILLA_FIVE_HOME}"/defaults/pref/${PN}-prefs.js || \
115 die "sed failed to change locale"
116 fi
117
118 # Create /usr/bin/seamonkey-bin
119 dodir /usr/bin/
120 cat <<EOF >"${D}"/usr/bin/seamonkey-bin
121 #!/bin/sh
122 unset LD_PRELOAD
123 exec /opt/seamonkey/seamonkey "\$@"
124 EOF
125 fperms 0755 /usr/bin/seamonkey-bin
126
127 # Install icon and .desktop for menu entry
128 doicon "${FILESDIR}/icon/${PN}.png"
129 domenu "${FILESDIR}/icon/${PN}.desktop"
130
131 if use startup-notification; then
132 echo "StartupNotify=true" >> "${D}"/usr/share/applications/${PN}.desktop
133 fi
134
135 # revdep-rebuild entry
136 insinto /etc/revdep-rebuild
137 doins "${FILESDIR}"/10${PN} || die
138
139 # Handle plugins dir through nsplugins.eclass
140 share_plugins_dir
141
142 # Required in order to use plugins and even run seamonkey on hardened.
143 pax-mark m "${ED}"/${MOZILLA_FIVE_HOME}/{seamonkey,seamonkey-bin,plugin-container}
144 }
145
146 pkg_preinst() {
147 gnome2_icon_savelist
148 }
149
150 pkg_postinst() {
151 # Update mimedb for the new .desktop file
152 fdo-mime_desktop_database_update
153 gnome2_icon_cache_update
154 }
155
156 pkg_postrm() {
157 gnome2_icon_cache_update
158 }

  ViewVC Help
Powered by ViewVC 1.1.20