| 1 |
# Copyright 1999-2006 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/seamonkey-1.0.5.ebuild,v 1.6 2006/10/25 04:04:06 tsunam Exp $ |
| 4 |
|
| 5 |
unset ALLOWED_FLAGS # Stupid extra-functions.sh ... bug 49179 |
| 6 |
inherit flag-o-matic toolchain-funcs eutils mozcoreconf mozconfig-2 mozilla-launcher makeedit multilib autotools |
| 7 |
|
| 8 |
PVER="0.2" |
| 9 |
EMVER="0.94.0" |
| 10 |
|
| 11 |
DESCRIPTION="Mozilla Application Suite - web browser, email, HTML editor, IRC" |
| 12 |
HOMEPAGE="http://www.mozilla.org" |
| 13 |
SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/${PN}/releases/${PV}/${P}.source.tar.bz2 |
| 14 |
mirror://gentoo/${P}-patches-${PVER}.tar.bz2 |
| 15 |
http://dev.gentoo.org/~kloeri/dist/${P}-patches-${PVER}.tar.bz2 |
| 16 |
crypt? ( !moznomail? ( http://www.mozilla-enigmail.org/downloads/src/enigmail-${EMVER}.tar.gz ) )" |
| 17 |
|
| 18 |
KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ~ppc64 x86 ~x86-fbsd" |
| 19 |
SLOT="0" |
| 20 |
LICENSE="MPL-1.1 NPL-1.1" |
| 21 |
IUSE="java ldap mozcalendar mozdevelop moznocompose moznoirc moznomail moznoroaming postgres crypt" |
| 22 |
|
| 23 |
RDEPEND="java? ( virtual/jre ) |
| 24 |
>=www-client/mozilla-launcher-1.47 |
| 25 |
>=dev-libs/nss-3.10 |
| 26 |
>=dev-libs/nspr-4.6.1 |
| 27 |
crypt? ( !moznomail? ( >=app-crypt/gnupg-1.4 ) )" |
| 28 |
|
| 29 |
DEPEND="${RDEPEND} |
| 30 |
~sys-devel/autoconf-2.13 |
| 31 |
java? ( >=dev-java/java-config-0.2.0 ) |
| 32 |
dev-lang/perl |
| 33 |
postgres? ( >=dev-db/postgresql-7.2.0 ) |
| 34 |
!www-client/mozilla" |
| 35 |
|
| 36 |
S=${WORKDIR}/mozilla |
| 37 |
|
| 38 |
src_unpack() { |
| 39 |
unpack ${P}.source.tar.bz2 ${P}-patches-${PVER}.tar.bz2 |
| 40 |
|
| 41 |
cd ${S} || die "cd failed" |
| 42 |
EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch ${WORKDIR}/patch |
| 43 |
|
| 44 |
# Unpack the enigmail plugin |
| 45 |
if use crypt && ! use moznomail; then |
| 46 |
cd ${S}/mailnews/extensions || die |
| 47 |
unpack enigmail-${EMVER}.tar.gz |
| 48 |
cd ${S}/mailnews/extensions/enigmail || die "cd failed" |
| 49 |
makemake2 |
| 50 |
fi |
| 51 |
|
| 52 |
# Fix scripts that call for /usr/local/bin/perl #51916 |
| 53 |
ebegin "Patching smime to call perl from /usr/bin" |
| 54 |
sed -i -e '1s,usr/local/bin,usr/bin,' ${S}/security/nss/cmd/smimetools/smime |
| 55 |
eend $? || die "sed failed" |
| 56 |
|
| 57 |
# Fix a compilation issue using the 32-bit userland with 64-bit kernel on |
| 58 |
# PowerPC, because with that configuration, mozilla detects a ppc64 system. |
| 59 |
# -- hansmi, 2005-10-02 |
| 60 |
if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then |
| 61 |
sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \ |
| 62 |
${S}/configure.in |
| 63 |
sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \ |
| 64 |
${S}/security/coreconf/arch.mk |
| 65 |
fi |
| 66 |
|
| 67 |
cd ${S} |
| 68 |
# Needed by some of the patches |
| 69 |
WANT_AUTOCONF=2.1 eautoreconf || die "Failed running eautoreconf" |
| 70 |
} |
| 71 |
|
| 72 |
src_compile() { |
| 73 |
declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} |
| 74 |
|
| 75 |
#################################### |
| 76 |
# |
| 77 |
# mozconfig, CFLAGS and CXXFLAGS setup |
| 78 |
# |
| 79 |
#################################### |
| 80 |
mozconfig_init |
| 81 |
mozconfig_config |
| 82 |
|
| 83 |
mozconfig_annotate 'gentoo' --enable-canvas |
| 84 |
mozconfig_annotate 'gentoo' --with-system-nspr |
| 85 |
mozconfig_annotate 'gentoo' --with-system-nss |
| 86 |
|
| 87 |
# Bug 60668: Galeon doesn't build without oji enabled, so enable it |
| 88 |
# regardless of java setting. |
| 89 |
mozconfig_annotate 'galeon' --enable-oji --enable-mathml |
| 90 |
|
| 91 |
# Other moz-specific settings |
| 92 |
mozconfig_use_enable mozdevelop jsd |
| 93 |
mozconfig_use_enable mozdevelop xpctools |
| 94 |
mozconfig_use_extension mozdevelop venkman |
| 95 |
|
| 96 |
if use moznoirc; then |
| 97 |
mozconfig_annotate '+moznocompose +moznoirc' --enable-extensions=-irc |
| 98 |
fi |
| 99 |
|
| 100 |
if use moznoroaming ; then |
| 101 |
mozconfig_annotate '+moznoroaming' --enable-extensions=-sroaming |
| 102 |
fi |
| 103 |
|
| 104 |
if use postgres ; then |
| 105 |
mozconfig_annotate '+postgres' --enable-extensions=sql |
| 106 |
export MOZ_ENABLE_PGSQL=1 |
| 107 |
export MOZ_PGSQL_INCLUDES=/usr/include |
| 108 |
export MOZ_PGSQL_LIBS=/usr/$(get_libdir) |
| 109 |
fi |
| 110 |
|
| 111 |
mozconfig_use_enable mozcalendar calendar |
| 112 |
mozconfig_use_enable ldap |
| 113 |
mozconfig_use_enable ldap ldap-experimental |
| 114 |
mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME} |
| 115 |
mozconfig_annotate '' --with-user-appdir=.mozilla |
| 116 |
|
| 117 |
if use moznomail && ! use mozcalendar; then |
| 118 |
mozconfig_annotate "+moznomail -mozcalendar" --disable-mailnews |
| 119 |
fi |
| 120 |
|
| 121 |
if use moznocompose && ! use mozcalendar; then |
| 122 |
if use moznoirc && use moznomail; then |
| 123 |
mozconfig_annotate "+moznocompose" --disable-composer |
| 124 |
fi |
| 125 |
fi |
| 126 |
|
| 127 |
# Finalize and report settings |
| 128 |
mozconfig_final |
| 129 |
|
| 130 |
# hardened GCC uses -fstack-protector-all by default, which breaks us |
| 131 |
gcc-specs-ssp && append-flags -fno-stack-protector-all |
| 132 |
replace-flags -fstack-protector-all -fstack-protector |
| 133 |
|
| 134 |
append-flags -freorder-blocks -fno-reorder-functions |
| 135 |
|
| 136 |
#################################### |
| 137 |
# |
| 138 |
# Configure and build |
| 139 |
# |
| 140 |
#################################### |
| 141 |
|
| 142 |
CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \ |
| 143 |
CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \ |
| 144 |
econf || die |
| 145 |
|
| 146 |
# It would be great if we could pass these in via CPPFLAGS or CFLAGS prior |
| 147 |
# to econf, but the quotes cause configure to fail. |
| 148 |
sed -i -e \ |
| 149 |
's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \ |
| 150 |
${S}/config/autoconf.mk \ |
| 151 |
${S}/xpfe/global/buildconfig.html |
| 152 |
|
| 153 |
# This removes extraneous CFLAGS from the Makefiles to reduce RAM |
| 154 |
# requirements while compiling |
| 155 |
edit_makefiles |
| 156 |
|
| 157 |
emake || die |
| 158 |
|
| 159 |
#################################### |
| 160 |
# |
| 161 |
# Build Enigmail extension |
| 162 |
# |
| 163 |
#################################### |
| 164 |
|
| 165 |
if use crypt && ! use moznomail; then |
| 166 |
emake -C ${S}/mailnews/extensions/enigmail || die "make enigmail failed" |
| 167 |
fi |
| 168 |
} |
| 169 |
|
| 170 |
src_install() { |
| 171 |
declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} |
| 172 |
|
| 173 |
# Most of the installation happens here |
| 174 |
dodir ${MOZILLA_FIVE_HOME} |
| 175 |
cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME} |
| 176 |
|
| 177 |
# Create directory structure to support portage-installed extensions. |
| 178 |
# See update_chrome() in mozilla-launcher |
| 179 |
keepdir ${MOZILLA_FIVE_HOME}/chrome.d |
| 180 |
keepdir ${MOZILLA_FIVE_HOME}/extensions.d |
| 181 |
cp ${D}${MOZILLA_FIVE_HOME}/chrome/installed-chrome.txt \ |
| 182 |
${D}${MOZILLA_FIVE_HOME}/chrome.d/0_base-chrome.txt |
| 183 |
|
| 184 |
# Create /usr/bin/mozilla |
| 185 |
install_mozilla_launcher_stub seamonkey ${MOZILLA_FIVE_HOME} |
| 186 |
|
| 187 |
# Install icon and .desktop for menu entry |
| 188 |
insinto /usr/share/pixmaps |
| 189 |
doins ${FILESDIR}/icon/${PN}.png |
| 190 |
|
| 191 |
# Fix bug 54179: Install .desktop file into /usr/share/applications |
| 192 |
# instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis) |
| 193 |
insinto /usr/share/applications |
| 194 |
doins ${FILESDIR}/icon/${PN}.desktop |
| 195 |
|
| 196 |
# Fix icons to look the same everywhere |
| 197 |
insinto ${MOZILLA_FIVE_HOME}/icons |
| 198 |
doins ${S}/widget/src/gtk/mozicon16.xpm |
| 199 |
doins ${S}/widget/src/gtk/mozicon50.xpm |
| 200 |
|
| 201 |
#################################### |
| 202 |
# |
| 203 |
# Install files necessary for applications to build against mozilla |
| 204 |
# |
| 205 |
#################################### |
| 206 |
|
| 207 |
einfo "Installing includes and idl files..." |
| 208 |
dodir ${MOZILLA_FIVE_HOME}/{include,idl} /usr/include |
| 209 |
cd ${S}/dist |
| 210 |
cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include |
| 211 |
cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl |
| 212 |
|
| 213 |
# Fix mozilla-config and install it |
| 214 |
exeinto ${MOZILLA_FIVE_HOME} |
| 215 |
doexe ${S}/build/unix/${PN}-config |
| 216 |
|
| 217 |
# Fix pkgconfig files and install them |
| 218 |
insinto /usr/$(get_libdir)/pkgconfig |
| 219 |
for x in ${S}/build/unix/*.pc; do |
| 220 |
doins ${x} |
| 221 |
done |
| 222 |
|
| 223 |
# Install env.d snippet, which isn't necessary for running mozilla, but |
| 224 |
# might be necessary for programs linked against firefox |
| 225 |
insinto /etc/env.d |
| 226 |
doins ${FILESDIR}/10${PN} |
| 227 |
dosed "s|/usr/lib|/usr/$(get_libdir)|" /etc/env.d/10${PN} |
| 228 |
|
| 229 |
# Install rebuild script since mozilla-bin doesn't support registration yet |
| 230 |
exeinto ${MOZILLA_FIVE_HOME} |
| 231 |
doexe ${FILESDIR}/${PN}-rebuild-databases.pl |
| 232 |
dosed -e 's|/lib/|/'"$(get_libdir)"'/|g' \ |
| 233 |
${MOZILLA_FIVE_HOME}/${PN}-rebuild-databases.pl |
| 234 |
|
| 235 |
# Install docs |
| 236 |
dodoc ${S}/{LEGAL,LICENSE} |
| 237 |
|
| 238 |
# Update Google search plugin to use UTF8 charset ... |
| 239 |
insinto ${MOZILLA_FIVE_HOME}/searchplugins |
| 240 |
doins ${FILESDIR}/google.src |
| 241 |
} |
| 242 |
|
| 243 |
pkg_preinst() { |
| 244 |
declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} |
| 245 |
|
| 246 |
# Remove entire installed instance to solve various problems, |
| 247 |
# for example see bug 27719 |
| 248 |
rm -rf ${ROOT}${MOZILLA_FIVE_HOME} |
| 249 |
} |
| 250 |
|
| 251 |
pkg_postinst() { |
| 252 |
declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} |
| 253 |
|
| 254 |
# Update the component registry |
| 255 |
MOZILLA_LIBDIR=${ROOT}${MOZILLA_FIVE_HOME} MOZILLA_LAUNCHER=${PN} \ |
| 256 |
/usr/libexec/mozilla-launcher -register |
| 257 |
|
| 258 |
# This should be called in the postinst and postrm of all the |
| 259 |
# mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and |
| 260 |
# thunderbird-bin ebuilds. |
| 261 |
update_mozilla_launcher_symlinks |
| 262 |
} |
| 263 |
|
| 264 |
pkg_postrm() { |
| 265 |
declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} |
| 266 |
|
| 267 |
# Update the component registry |
| 268 |
if [[ -x ${MOZILLA_FIVE_HOME}/${PN}-bin ]]; then |
| 269 |
MOZILLA_LIBDIR=${ROOT}${MOZILLA_FIVE_HOME} MOZILLA_LAUNCHER=${PN} \ |
| 270 |
/usr/libexec/mozilla-launcher -register |
| 271 |
fi |
| 272 |
|
| 273 |
update_mozilla_launcher_symlinks |
| 274 |
} |