# $Header: /magellan-cvs/smage/mozilla/mozilla-1.7.12-r3.smage2,v 1.6 2006/05/31 16:21:25 niro Exp $ PNAME="seamonkey" PVER="1.0.2" PBUILD="r1" PCATEGORIE="net-www" STATE="unstable" DESCRIPTION="Mozilla all in one browser." HOMEPAGE="http://www.mozilla.org/products/mozilla1x/" DEPEND=">= virtual/glibc >= virtual/x11 >= sys-libs/zlib-1.2.1 >= media-libs/libmng-1.0.5 >= media-libs/fontconfig-2.2 >= media-libs/libjpeg-6b >= media-libs/libpng-1.2.8 >= dev-libs/glib2-2.8 >= dev-libs/expat-1.95.6 >= dev-libs/libidl-0.8.4 >= app-arch/zip-2.3 >= app-arch/unzip-5.50 >= x11-libs/pango-1.10 >= x11-libs/gtk2+-2.8 >= app-crypt/gnupg-1.2.4" SDEPEND=">= dev-util/pkgconfig-0.15.0" SRCFILE="${PNAME}-${PVER}-source.tar.bz2" SRCDIR="${BUILDDIR}/mozilla" SRC_ENIGMAIL="enigmail-0.94.0.tar.gz" SRC_IPC="ipc-1.1.3.tar.gz" SRCDIR="${BUILDDIR}/mozilla" sminclude mozilla SRC_URI=( mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRC_ENIGMAIL} mirror://${PNAME}/${SRC_IPC} mirror://${PNAME}/${PNAME}-1.7.5-stackgrowth.patch mirror://${PNAME}/${PNAME}-1.3-fix-RAW-target.patch mirror://${PNAME}/mozilla-1.7.3-4ft2.patch mirror://${PNAME}/mozilla-rebuild-databases.pl mirror://${PNAME}/google.src mirror://${PNAME}/xft.js "mirror://${PNAME}/icon/mozilla-icon.png icon" "mirror://${PNAME}/icon/mozilla.desktop icon" mirror://${PNAME}/${PNAME}-1.7.12-nss-gcc4.patch mirror://${PNAME}/${PNAME}-1.7.12-amd64-compile.patch mirror://${PNAME}/${PNAME}-1.7.12-amd64-gcc4-crash-fix.patch ) # set by configure (plus USE_AUTOCONF=1), but useful for NSPR export MOZILLA_CLIENT=1 export BUILD_OPT=1 export NO_STATIC_LIB=1 export USE_PTHREADS=1 # now strip optimization from CFLAGS so it doesn't end up in the # compile string export CFLAGS="${CFLAGS/-O*/}" export CXXFLAGS="${CFLAGS}" # needed to build without warnings on gcc-3 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated" src_prepare() { munpack ${SRCFILE} || die # enigmail plugin munpack ${SRC_ENIGMAIL} ${SRCDIR}/mailnews/extensions ||die munpack ${SRC_IPC} ${SRCDIR}/extensions ||die cd ${SRCDIR} # fix stack growth logic mpatch -Np0 ${PNAME}-1.7.5-stackgrowth.patch || die # fix logic error when using RAW target # (23 Feb 2003) mpatch -Np1 ${PNAME}-1.3-fix-RAW-target.patch || die # patch out ft caching code since the API changed between releases of # freetype; this enables freetype-2.1.8+ compat. # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65 mpatch -Np0 mozilla-1.7.3-4ft2.patch || die # fix compilation with gcc4 mpatch -Np1 ${PNAME}-1.7.12-nss-gcc4.patch || die # x86_64 compile fixes if [[ ${ARCH} = x86_64 ]] then mpatch -Np1 ${PNAME}-1.7.12-amd64-compile.patch || die mpatch -Np1 ${PNAME}-1.7.12-amd64-gcc4-crash-fix.patch || die fi # branding the source with our tags sed -i "s|0000000000|Magellan Linux|" xpfe/global/build.dtd.in || die # fix scripts that call for /usr/local/bin/perl sed -i -e '1s,usr/local/bin,usr/bin,' security/nss/cmd/smimetools/smime || die WANT_AUTOCONF=2.1 autoconf || die # rebuild makefiles cd ${SRCDIR}/extensions/ipc || die makemake || die cd ${SRCDIR}/mailnews/extensions/enigmail || die makemake2 || die } src_compile() { cd ${SRCDIR} # setup .mozconfig : >.mozconfig || die # set optimization level based on CFLAGS if [[ ${ARCH} = x86_64 ]] then # opts may cause segfaults on 64bit arches mozconf_add --enable-optimize=-O1 export CFLAGS="${CFLAGS} -fPIC" export CXXFLAGS="${CXXFLAGS} -fPIC" else mozconf_add --enable-optimize=-O2 fi # enable compat mode for plugins build with gcc2 mozconf_add --enable-old-abi-compat-wrappers # we don't need the installer mozconf_add --disable-installer # issue all warnings demanded by strict ANSI C mozconf_add --disable-pedantic # enable crypto support (Personal Security Manager) mozconf_add --enable-crypto # want system jpeg, pngm, zlib but the provided nspr should be used mozconf_add --with-system-jpeg mozconf_add --with-system-png mozconf_add --with-system-zlib mozconf_add --without-system-nspr # enable gtk2 as default mozconf_add --enable-default-toolkit=gtk2 # ipv6 support mozconf_add --enable-ipv6 # want xinerama mozconf_add --enable-xinerama # no xprint mozconf_add --disable-xprint # want truetype fonts mozconf_add --enable-freetype2 mozconf_add --enable-freetypetest # disable debug build && enable stripping mozconf_add --disable-debug mozconf_add --disable-tests mozconf_add --enable-reorder mozconf_add --enable-strip mozconf_add --enable-strip-libs if [[ ${ARCH} = i*86 ]] then # optimze build for x86 mozconf_add --enable-elf-dynstr-gc fi # enable xft2 mozconf_add --enable-xft ######### # enable default extensions mozconf_add --enable-extensions=default # both needed to build galeon mozconf_add --enable-oji mozconf_add --enable-mathml # no develop mozconf_add --disable-jsd mozconf_add --disable-xpctools mozconf_add --enable-extensions=-venkman # no gnome-vfs mozconf_add --disable-gnomevfs mozconf_add --enable-extensions=-gnomevfs # enable irc extension mozconf_add --enable-extensions=irc # enable xmlterm extension mozconf_add --enable-extensions=xmlterm # enable mozilla-calendar mozconf_add --enable-calendar # no ldap mozconf_add --disable-ldap mozconf_add --disable-ldap-experimental # svg support; needs cairo mozconf_add --disable-svg mozconf_add --disable-svg-renderer-cairo # were to go mozconf_add --prefix=/usr/$(mlibdir)/mozilla mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/seamonkey # resolve multiple --enable-extensions down to one rebuild_extension_list # now run configure ./configure || die # removes extraneous CFLAGS # to reduce RAM requirements while compiling mozilla_remove_cflags || die mmake || die # build the NSS/SSL support # fix #include problem cd ${SRCDIR}/security/coreconf || die echo 'INCLUDES += -I$(DIST)/include/nspr -I$(DIST)/include/dbm'\ >>headers.mk make || die cd ${SRCDIR}/security/nss || die make moz_import || die make || die # enigmail cd ${SRCDIR}/extensions/ipc || die make || die cd ${SRCDIR}/mailnews/extensions/enigmail || die make || die } src_install() { cd ${SRCDIR} # install, don't create tarball install -d ${BINDIR}/usr/$(mlibdir) || die cd ${SRCDIR}/xpinstall/packager make MOZ_PKG_FORMAT="RAW" TAR_CREATE_FLAGS="-chf" > /dev/null || die mv -f ${SRCDIR}/dist/mozilla ${BINDIR}/usr/$(mlibdir)/mozilla || die # needed directories (must be run here or the move above breaks) install -d ${BINDIR}/etc/env.d || die install -d ${BINDIR}/usr/bin || die install -d ${BINDIR}/usr/include || die install -d ${BINDIR}/usr/$(mlibdir)/mozilla/include/{idl,nss} || die install -d ${BINDIR}/usr/$(mlibdir)/mozilla/{icons,searchplugins} || die install -d ${BINDIR}/usr/$(mlibdir)/pkgconfig || die install -d ${BINDIR}/usr/share/{applications,pixmaps} || die # copy the include and idl files cd ${SRCDIR}/dist cp -LfR include/* ${BINDIR}/usr/$(mlibdir)/mozilla/include || die cp -LfR idl/* ${BINDIR}/usr/$(mlibdir)/mozilla/include/idl || die ln -snf /usr/$(mlibdir)/mozilla/include ${BINDIR}/usr/include/mozilla || die # install the development tools in /usr mv ${BINDIR}/usr/$(mlibdir)/mozilla/{xpcshell,xpidl,xpt_dump,xpt_link} \ ${BINDIR}/usr/bin || die # install the NSS/SSL libs, headers and tools # install the headers ('make install' do not work for headers ...) if [ -d ${SRCDIR}/dist/public/nss ] then install -m0644 ${SRCDIR}/dist/public/nss/*.h \ ${BINDIR}/usr/$(mlibdir)/mozilla/include/nss || die fi if [ -d ${SRCDIR}/dist/public/seccmd ] then install -m0644 ${SRCDIR}/dist/public/seccmd/*.h \ ${BINDIR}/usr/$(mlibdir)/mozilla/include/nss || die fi if [ -d ${SRCDIR}/dist/public/security ] then install -m0644 ${SRCDIR}/dist/public/security/*.h \ ${BINDIR}/usr/$(mlibdir)/mozilla/include/nss || die fi # these come with zlib ... rm -f ${BINDIR}/usr/$(mlibdir)/mozilla/include/nss/{zconf.h,zlib.h} || die cd ${SRCDIR}/security/nss mkdir -p ${BUILDDIR}/nss/{bin,lib} export SOURCE_BIN_DIR=${BUILDDIR}/nss/bin export SOURCE_LIB_DIR=${BUILDDIR}/nss/lib make install || die # gets installed as symbolic links ... cp -Lf ${BUILDDIR}/nss/bin/* ${BINDIR}/usr/bin || die cp -Lf ${BUILDDIR}/nss/lib/* ${BINDIR}/usr/$(mlibdir)/mozilla || die # need to unset these incase we want to rebuild, else the build # gets newked. unset SOURCE_LIB_DIR unset SOURCE_BIN_DIR cd ${SRCDIR}/build/unix # fix mozilla-config and install it sed -i -e "s|/usr/$(mlibdir)/mozilla-${PVER}|/usr/$(mlibdir)/mozilla|g" \ -e "s|/usr/include/mozilla-${PVER}|/usr/$(mlibdir)/mozilla/include|g" \ -e "s|/usr/share/idl/mozilla-${PVER}|/usr/$(mlibdir)/mozilla/idl|g" \ -e "s|\(echo -L.*\)\($\)|\1 -Wl,-rpath,/usr/$(mlibdir)/mozilla\2|" \ mozilla-config || die install -m0755 -o root -g root mozilla-config \ ${BINDIR}/usr/$(mlibdir)/mozilla || die # fix pkgconfig files and install them for x in *.pc; do if [[ -f ${x} ]]; then sed -i -e "s|^libdir=.*|libdir=/usr/$(mlibdir)/mozilla|" \ -e "s|^includedir=.*|includedir=/usr/$(mlibdir)/mozilla/include|" \ -e "s|^idldir=.*|idldir=/usr/$(mlibdir)/mozilla/idl|" \ -e "s|\(Libs:.*\)\($\)|\1 -Wl,-rpath,\${libdir}\2|" \ ${x} || die install -m0644 ${x} ${BINDIR}/usr/$(mlibdir)/pkgconfig || die fi done cd ${SRCDIR} ln -snf /usr/$(mlibdir)/mozilla/mozilla ${BINDIR}/usr/bin/mozilla || die # environment echo "LDPATH=/usr/$(mlibdir)/mozilla MOZILLA_FIVE_HOME=/usr/$(mlibdir)/mozilla CONFIG_PROTECT=/usr/$(mlibdir)/mozilla/defaults/pref" \ > ${BINDIR}/etc/env.d/10mozilla || die # docs minstalldocs LEGAL LICENSE README/mozilla/README* || die # install rebuild script install -m0755 -o root -g root \ ${SOURCEDIR}/${PNAME}/mozilla-rebuild-databases.pl \ ${BINDIR}/usr/$(mlibdir)/mozilla || die # fix libdir sed -e 's|/lib/|/'"$(mlibdir)"'/|g' \ ${BINDIR}/usr/$(mlibdir)/mozilla/mozilla-rebuild-databases.pl || die # update Google search plugin to use UTF8 charset ... install -m0644 ${SOURCEDIR}/${PNAME}/google.src \ ${BINDIR}/usr/$(mlibdir)/mozilla/searchplugins || die if [[ -f "${BUILDDIR}/.xft" ]]; then # We are using Xft, so change the default font install -d ${BINDIR}/usr/$(mlibdir)/mozilla/defaults/pref || die install -m0644 ${SOURCEDIR}/${PNAME}/xft.js \ ${BINDIR}/usr/$(mlibdir)/mozilla/defaults/pref || die fi # fix icons to look the same everywhere install -m0644 ${SRCDIR}/widget/src/gtk/mozicon16.xpm \ ${BINDIR}/usr/$(mlibdir)/mozilla/icons || die install -m0644 ${SRCDIR}/widget/src/gtk/mozicon50.xpm \ ${BINDIR}/usr/$(mlibdir)/mozilla/icons || die # install icon and .desktop for menu entry install -m0644 ${SOURCEDIR}/${PNAME}/icon/mozilla-icon.png \ ${BINDIR}/usr/share/pixmaps || die install -m0644 ${SOURCEDIR}/${PNAME}/icon/mozilla.desktop \ ${BINDIR}/usr/share/applications || die # take care of non root execution # (seems the problem is that not all files are readible by the user) chmod -R g+r,o+r ${BINDIR}/usr/$(mlibdir)/mozilla || die find ${BINDIR}/usr/$(mlibdir)/mozilla/ -type d -exec chmod 0755 {} \; || : } postinstall() { # update environment; needed for REGXPCOM env-rebuild source ${MROOT}/etc/profile # mozillas mozilla_five_home export MOZILLA_FIVE_HOME="${MROOT}/usr/$(mlibdir)/mozilla" # register mozilla echo "Registering Components and Chrome..." ${MOZILLA_FIVE_HOME}/mozilla-rebuild-databases.pl # fix permissions of component registry chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat # fix directory permissions find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || : # fix permissions on chrome files find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || : }