/[gentoo-x86]/app-office/mozilla-sunbird/mozilla-sunbird-0.3.ebuild
Gentoo

Contents of /app-office/mozilla-sunbird/mozilla-sunbird-0.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Mar 2 19:16:29 2007 UTC (7 years, 4 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove mozbranding and add bindist, enabling branding by default, bug 168409, and remove old
(Portage version: 2.1.2-r13)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-office/mozilla-sunbird/mozilla-sunbird-0.3.ebuild,v 1.1 2007/02/15 21:09:16 armin76 Exp $
4
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
8
9 LANGS="ca cs da de es-ES eu fr ga-IE hu it mn nl pl ru sk sl"
10
11 MY_PN="${PN/mozilla-}"
12 MY_P="${MY_PN}-${PV}"
13 DESCRIPTION="The Mozilla Sunbird Calendar"
14 HOMEPAGE="http://www.mozilla.org/projects/calendar/sunbird.html"
15 IUSE=""
16 SRC_URI="http://releases.mozilla.org/pub/mozilla.org/calendar/${MY_PN}/releases/${PV}/source/${MY_P}.source.tar.bz2"
17
18 # These are in
19 #
20 # http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/${PV}/langpacks/
21 #
22 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
23 for X in ${LANGS} ; do
24 SRC_URI="${SRC_URI}
25 linguas_${X/-/_}? ( http://releases.mozilla.org/pub/mozilla.org/calendar/${MY_PN}/releases/${PV}/langpacks/${MY_PN}-${PV}.${X}.langpack.xpi )"
26 IUSE="${IUSE} linguas_${X/-/_}"
27 # english is handled internally
28 done
29
30 KEYWORDS="-* ~x86 ~amd64"
31 SLOT="0"
32 LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
33
34 RDEPEND=">=www-client/mozilla-launcher-1.44
35 >=dev-libs/nss-3.10"
36
37 S="${WORKDIR}/mozilla"
38
39 linguas() {
40 local LANG SLANG
41 for LANG in ${LINGUAS}; do
42 if has ${LANG} en en_US; then
43 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
44 continue
45 elif has ${LANG} ${LANGS//-/_}; then
46 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
47 continue
48 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
49 for X in ${LANGS}; do
50 if [[ "${X}" == "${LANG}-"* ]] && != *" ${X} "* ]]; then
51 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
52 continue 2
53 fi
54 done
55 fi
56 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
57 done
58 einfo "Selected language packs (first will be default): $linguas"
59 }
60
61 pkg_setup(){
62 if ! built_with_use x11-libs/cairo X; then
63 eerror "Cairo is not built with X useflag."
64 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
65 die "Cairo needs X"
66 fi
67
68 use moznopango && warn_mozilla_launcher_stub
69 }
70
71 src_unpack() {
72 unpack ${A%bz2*}bz2
73
74 linguas
75 for X in ${linguas}; do
76 [[ ${X} != "en" ]] && xpi_unpack "${MY_PN}-${PV}.${X}.langpack.xpi"
77 done
78
79 cd "${S}"
80 epatch "${FILESDIR}/${P}-add-missing-LDFLAGS.patch"
81
82 eautoreconf
83 }
84
85 src_compile() {
86 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
87
88 ####################################
89 #
90 # mozconfig, CFLAGS and CXXFLAGS setup
91 #
92 ####################################
93
94 mozconfig_init
95 mozconfig_config
96
97 mozconfig_annotate '' --enable-application=calendar
98 mozconfig_annotate '' --enable-extensions=default
99 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
100 mozconfig_annotate '' --with-system-nss
101 mozconfig_annotate '' --with-system-nspr
102
103 # Add build variables
104 mozconfig_build_opts
105
106 # Finalize and report settings
107 mozconfig_final
108
109 # hardened GCC uses -fstack-protector-all by default, which breaks us
110 gcc-specs-ssp && append-flags -fno-stack-protector-all
111 replace-flags -fstack-protector-all -fstack-protector
112
113 ####################################
114 #
115 # Configure and build
116 #
117 ####################################
118
119 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
120 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
121 econf || die
122
123 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
124 # to econf, but the quotes cause configure to fail.
125 sed -i -e \
126 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
127 ${S}/config/autoconf.mk \
128 ${S}/nsprpub/config/autoconf.mk \
129 ${S}/xpfe/global/buildconfig.html
130
131 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
132 # requirements while compiling
133 edit_makefiles
134
135 emake -j1 || die
136 }
137
138 pkg_preinst() {
139 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
140
141 einfo "Removing old installs though some really ugly code. It potentially"
142 einfo "eliminates any problems during the install, however suggestions to"
143 einfo "replace this are highly welcome. Send comments and suggestions to"
144 einfo "mozilla@gentoo.org."
145 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
146 }
147
148 src_install() {
149 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
150
151 # Most of the installation happens here
152 dodir "${MOZILLA_FIVE_HOME}"
153 cp -RL "${S}/dist/bin/"* "${D}${MOZILLA_FIVE_HOME}" || die "Copy of files failed"
154
155 linguas
156 for X in ${linguas}; do
157 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${MY_PN}-${PV}.${X}.langpack"
158 done
159
160 local LANG=${linguas%% *}
161 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
162 einfo "Setting default locale to ${LANG}"
163 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
164 "${MOZILLA_FIVE_HOME}"/defaults/pref/sunbird.js \
165 "${MOZILLA_FIVE_HOME}"/defaults/pref/sunbird-l10n.js || \
166 die "sed failed to change locale"
167 fi
168
169 # Create /usr/bin/sunbird
170 install_mozilla_launcher_stub sunbird "${MOZILLA_FIVE_HOME}"
171
172 # Install icon and .desktop for menu entry
173 doicon "${FILESDIR}"/icon/${PN}-unbranded-icon.png
174 newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
175 ${PN}.desktop
176 }
177
178 pkg_postinst() {
179 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
180
181 # This should be called in the postinst and postrm of all the
182 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
183 # thunderbird-bin ebuilds.
184 update_mozilla_launcher_symlinks
185 }
186
187 pkg_postrm() {
188 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
189
190 update_mozilla_launcher_symlinks
191 }

  ViewVC Help
Powered by ViewVC 1.1.20