Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > 3707a7d4795a36bcb2d7f704df572885 > files > 11

iceape-2.46-1.mga5.src.rpm

%define epoch_mozilla 0
#warning : always end release date with 00
# (it should be the hour of build but it is not significant for rpm)
%define releasedate 2016122200
%define oversion         %{version}%{?beta:b%beta}
%define dirversion       %{oversion}
%define mozillalibdir %{_libdir}/iceape-%{dirversion}
%define mozillaplugindir %{_libdir}/mozilla/plugins
%define enable_l10n      1
%define build_debug      0
%define build_gre	 0
%define _fixperms	 true
# define to beta number if prerelease
#define beta             1

%define toolkit		 cairo-gtk2

# Build a mozilla with debug enabled
%{?_with_mydebug: %global build_debug 1}
%{?_without_mydebug: %global build_debug 0}

# Install gre.conf
%{?_with_gre: %global build_gre 1}
%{?_without_gre: %global build_gre 0}

%global __provides_exclude libaccessibility.so|libappcomps.so|libauth.so|libautoconfig.so|libcaps.so|libchrome.so|libcomposer.so|libcookie.so|libdbusservice.so|libdocshell.so|libeditor.so|libembedcomponents.so|libenigmime.so|libfileview.so|libgfx_gtk.so|libgfxps.so|libgfxpsshar.so|libgkgfx.so|libgklayout.so|libgkplugin.so|libgtkembedmoz.so|libgtkxtbin.so|libhtmlpars.so|libi18n.so|libimgicon.so|libimglib2.so|libjar50.so|libjsd.so|libjsj.so|libldap50.so|libmork.so|libmozfind.so|libmozjs.so|libmozldap.so|libmsgbaseutil.so|libnecko.so|libnecko2.so|libnkgnomevfs.so|libnsappshell.so|libnsprefm.so|libnullplugin.so|liboji.so|libp3p.so|libpermissions.so|libpipboot.so|libpipnss.so|libpippki.so|libpref.so|libprldap50.so|libprofile.so|librdf.so|libremoteservice.so|libschemavalidation.so|libsearchservice.so|libsql.so|libsroaming.so|libstoragecomps.so|libsystem-pref.so|libtransformiix.so|libtxmgr.so|libtypeaheadfind.so|libuconv.so|libucvmath.so|libuniversalchardet.so|libunixprintplugin.so|libwallet.so|libwalletviewers.so|libwebbrwsr.so|libwebsrvcs.so|libwidget_gtk2.so|libxforms.so|libxmlextras.so|libxpcom.so|libxpcom_compat.so|libxpcom_compat_c.so|libxpcom_core.so|libxpconnect.so|libxpinstall.so|libxpistub.so|libxremoteservice|libaddrbook.so|libbayesflt.so|libimpComm4xMail.so|libimport.so|libimpText.so|libldap60.so|libldif60.so|liblocalmail.so|libmailnews.so|libmailview.so|libmimeemitter.so|libmime.so|libmozalloc.so|libmozgnome.so|libmsgbaseutil.so|libmsgcompose.so|libmsgdb.so|libmsgimap.so|libmsgmdn.so|libmsgnews.so|libmsgsmime.so|libvcard.so|libmyspell.so|libprldap60.so|libspellchecker.so|libssldap60.so|libsuite.so|libxul.so|libfake.so|libmozsandbox.so
%global __requires_exclude libaccessibility.so|libappcomps.so|libauth.so|libautoconfig.so|libcaps.so|libchrome.so|libcomposer.so|libcookie.so|libdbusservice.so|libdocshell.so|libeditor.so|libembedcomponents.so|libenigmime.so|libfileview.so|libgfx_gtk.so|libgfxps.so|libgfxpsshar.so|libgkgfx.so|libgklayout.so|libgkplugin.so|libgtkembedmoz.so|libgtkxtbin.so|libhtmlpars.so|libi18n.so|libimgicon.so|libimglib2.so|libjar50.so|libjsd.so|libjsj.so|libldap50.so|libmork.so|libmozfind.so|libmozjs.so|libmozldap.so|libmsgbaseutil.so|libnecko.so|libnecko2.so|libnkgnomevfs.so|libnsappshell.so|libnsprefm.so|libnullplugin.so|liboji.so|libp3p.so|libpermissions.so|libpipboot.so|libpipnss.so|libpippki.so|libpref.so|libprldap50.so|libprofile.so|librdf.so|libremoteservice.so|libschemavalidation.so|libsearchservice.so|libsql.so|libsroaming.so|libstoragecomps.so|libsystem-pref.so|libtransformiix.so|libtxmgr.so|libtypeaheadfind.so|libuconv.so|libucvmath.so|libuniversalchardet.so|libunixprintplugin.so|libwallet.so|libwalletviewers.so|libwebbrwsr.so|libwebsrvcs.so|libwidget_gtk2.so|libxforms.so|libxmlextras.so|libxpcom.so|libxpcom_compat.so|libxpcom_compat_c.so|libxpcom_core.so|libxpconnect.so|libxpinstall.so|libxpistub.so|libxremoteservice|libaddrbook.so|libbayesflt.so|libimpComm4xMail.so|libimport.so|libimpText.so|libldap60.so|libldif60.so|liblocalmail.so|libmailnews.so|libmailview.so|libmimeemitter.so|libmime.so|libmozalloc.so|libmozgnome.so|libmsgbaseutil.so|libmsgcompose.so|libmsgdb.so|libmsgimap.so|libmsgmdn.so|libmsgnews.so|libmsgsmime.so|libvcard.so|libmyspell.so|libprldap60.so|libspellchecker.so|libssldap60.so|libsuite.so|libxul.so|libfake.so|libmozsandbox.so

Name:      iceape
Summary:   IceApe, the all-in-one internet application suite
Version:   2.46
Release:   %mkrel 1
License:   MPL
# debian iceape: http://git.debian.org/?p=pkg-mozilla/iceape.git
Source0:   ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/source/seamonkey-%{oversion}.source.tar.xz
%if %{enable_l10n}
Source99:  locale.alias
%define l10ns be ca cs de en-GB en-US es-AR es-ES fi fr gl hu it ja lt nb-NO nl pl pt-PT ru sk sv-SE tr uk zh-CN zh-TW
# not up-to-date: el-GR eu-ES he-IL hi-IN ka ne-NP pt-BR ur-PK

Source101: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.be.langpack.xpi
Source102: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.ca.langpack.xpi
Source103: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.cs.langpack.xpi
Source104: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.de.langpack.xpi
Source105: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.en-GB.langpack.xpi
Source106: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.en-US.langpack.xpi
Source107: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.es-AR.langpack.xpi
Source108: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.es-ES.langpack.xpi
Source109: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.fi.langpack.xpi
Source110: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.fr.langpack.xpi
Source111: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.gl.langpack.xpi
Source112: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.hu.langpack.xpi
Source113: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.it.langpack.xpi
Source115: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.ja.langpack.xpi
Source116: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.lt.langpack.xpi
Source117: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.nb-NO.langpack.xpi
Source118: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.nl.langpack.xpi
Source119: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.pl.langpack.xpi
Source120: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.pt-PT.langpack.xpi
Source121: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.ru.langpack.xpi
Source122: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.sk.langpack.xpi
Source123: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.sv-SE.langpack.xpi
Source124: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.tr.langpack.xpi
Source125: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.uk.langpack.xpi
Source126: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.zh-CN.langpack.xpi
Source127: ftp://ftp.mozilla.org/pub/seamonkey/releases/%{version}/langpack/seamonkey-%{oversion}.zh-TW.langpack.xpi
%endif
# (fc) 0.9.8-1mdk fix loading of file through command line (contributed by Chmouel) ,
# set MOZ_PLUGIN_PATH to $HOME/.mozilla/plugins, autodetect locale, add -splash parameter
Source10:  iceape-2.0.12-sh.in
Source25:  mozilla-make-package.pl
Source26:  iceape-rebuild-databases.pl.in
Source27:  mozilla-xpcom-exclude-list
Source28:  mozilla-psm-exclude-list
# (cjw) iceape logo, icon etc. - taken from debian package but icon was modified
Source29:  iceape-branding-2.31.tar
# duckduckgo search engine
Source30:  firefox-searchengines-duckduckgo.xml

Patch7:    mozilla-browser-home-page.patch
# (cjw) fix opt flags passing to mozilla subdir's configure script
#Patch305:  seamonkey-2.0-configure-optflags-fix.patch
# (cjw) rename to iceape, patch from debian package
Patch310:  iceape-2.5-branding.patch
# (cjw) build against system ogg libs
Patch322:  iceape-2.12-system-ogg.patch
# (cjw) fix webrtc build with system ogg libs
Patch324:  iceape-2.16-webrtc-system-opus.patch
Patch327:  iceape-2.25-libpng-version.patch
# (cjw) set layers.offmainthreadcomposition.enabled to false to fix crashes
#       set full-screen-api.enabled to true to allow full screen videos
Patch333:  iceape-2.39-crash-and-fullscreen-settings.patch
# enable more "old" configure options
Patch337:  iceape-2.46-extra-config-options.patch
# next: 338

Epoch:     %{epoch_mozilla}
Provides:  seamonkey = %{epoch}:%{version}-%{release}
Obsoletes: seamonkey
Conflicts: j2re = 1.4.0-beta3
Conflicts: j2sdk = 1.4.0-beta3
Conflicts: oxygen-gtk < 1.4.6-2

BuildRequires:	autoconf2.1
BuildRequires:	doxygen
BuildRequires:  gtk+2-devel >= 2.4.0
BuildRequires:	librsvg
BuildRequires:  krb-devel
BuildRequires:	libalsa-devel
BuildRequires:	libcurl-devel
BuildRequires:	libIDL-devel
BuildRequires:	libbzip2-devel
BuildRequires:	pkgconfig(cairo) >= 1.10
BuildRequires:	libevent-devel
BuildRequires:	libhunspell-devel
BuildRequires:	pkgconfig(gconf-2.0) >= 1.2.1
BuildRequires:	dbus-glib-devel
BuildRequires:	pkgconfig(gobject-2.0)
BuildRequires:	libjpeg-devel
BuildRequires:	libnotify-devel
BuildRequires:	libevent-devel
BuildRequires:	libffi-devel >= 3.0.9
%if %distro_release < 6
# use bundled libsqlite
%else
BuildRequires:  libsqlite3-devel >= 3.8.11.1
%endif
BuildRequires:	gstreamer1.0-devel
BuildRequires:	libgstreamer1.0-plugins-base-devel
BuildRequires:	libpixman-1-devel >= 0.19.2
BuildRequires:	libpng-devel >= 2:1.4.1
%if %distro_release < 6
# use bundled libvpx
%else
BuildRequires:  libvpx-devel
%endif
BuildRequires:	pkgconfig(ogg)
BuildRequires:	pkgconfig(vorbis)
BuildRequires:	pkgconfig(theoradec)
BuildRequires:	pkgconfig(opus)
%if %distro_release < 6
# use bundled icu
%else
BuildRequires:	pkgconfig(icu-i18n)
%endif
BuildRequires:	pkgconfig(libpulse)
BuildRequires:  libproxy-devel
BuildRequires:	startup-notification-devel >= 0.8
BuildRequires:  libxft-devel
BuildRequires:	libxt-devel
BuildRequires:	mesagl-devel
BuildRequires:	makedepend
BuildRequires:	python
BuildRequires:	python-virtualenv
BuildRequires:	python-setuptools
BuildRequires:	tcsh
BuildRequires:	wget
BuildRequires:	yasm
BuildRequires:	zip

BuildRequires:	rootcerts >= 20060621
# -static for libcrmf.a
BuildRequires:  nss-static-devel

#Requires(post):		%{lib_nspr_name}
#Requires(postun):	%{lib_nspr_name}
Requires(post):		perl psmisc
Requires(postun):	perl psmisc
#Requires:	%{lib_nss_name}
Requires:	indexhtml
Requires:	gtk+2 >= 2.4.0
# mozilla apps now dlopen gstreamer libraries, so no automatic dependencies anymore
Requires:	gstreamer1.0-libav
# if we use gstreamer0.10 instead:
#Requires:	gstreamer0.10-ffmpeg

BuildRequires:	pango >= 1.5.0

Group:		Networking/WWW
Url:		http://www.seamonkey-project.org/
Obsoletes:	mozilla-xpcom mozilla-browser mozilla-psm mozilla-ctl mozilla
Provides:	mozilla-xpcom = 0:1.8-1mdk
Provides:	mozilla-browser = 0:1.8-1mdk
Provides:	mozilla-psm = 0:1.8-1mdk
Provides:	mozilla-ctl = 0:1.8-1mdk
Provides:	webclient
Provides:	mozilla = 0:1.8-1mdk
Obsoletes:	mozilla

Provides:	%{name}-mail = %{epoch_mozilla}:%{version}-%{release}
Obsoletes:	%{name}-mail
Provides:		mozilla-mail = 0:1.8-1mdk
Obsoletes:		mozilla-mail
Provides:		seamonkey-mail = %{epoch}:%{version}-%{release}
Obsoletes:		seamonkey-mail

Provides:	%{name}-irc = %{epoch_mozilla}:%{version}-%{release}
Obsoletes:	%{name}-irc
Provides:		mozilla-chatzilla mozilla-chat mozilla-irc = 0:1.8-1mdk
Obsoletes:		mozilla-chatzilla mozilla-chat mozilla-irc
Provides:		seamonkey-irc = %{epoch}:%{version}-%{release}
Obsoletes:		seamonkey-irc

Provides:	%{name}-js-debugger = %{epoch_mozilla}:%{version}-%{release}
Obsoletes:	%{name}-js-debugger
Provides:		mozilla-js-debugger = 0:1.8-1mdk
Obsoletes:		mozilla-js-debugger
Provides:		seamonkey-js-debugger = %{epoch}:%{version}-%{release}
Obsoletes:		seamonkey-js-debugger

Provides:	%{name}-dom-inspector = %{epoch_mozilla}:%{version}-%{release}
Obsoletes:	%{name}-dom-inspector
Provides:		mozilla-dom-inspector = 0:1.8-1mdk
Obsoletes:		mozilla-dom-inspector
Provides:		seamonkey-dom-inspector = %{epoch}:%{version}-%{release}
Obsoletes:		seamonkey-dom-inspector

Provides:	%{name}-spellchecker = %{epoch_mozilla}:%{version}-%{release}
Obsoletes:	%{name}-spellchecker
%if %distro_release < 2
Requires:		myspell-dictionary
%else
Requires:		hunspell-dictionary
%endif
Provides:		mozilla-spellchecker = 0:1.8-1mdk
Obsoletes:		mozilla-spellchecker
Provides:		seamonkey-spellchecker = %{epoch}:%{version}-%{release}
Obsoletes:		seamonkey-spellchecker

%description
The Iceape Internet Suite is a derivative of the Seamonkey Internet Suite
that is not branded with mozilla trademarks and therefore suitable
for free distribution. The Seamonkey Internet Suite is a set of Internet
oriented applications. It is the continuation of the Mozilla Suite after it
has been abandoned in favor of Firefox and Thunderbird.

This packages contains the web browser ("navigator"),
a WYSIWYG HTML editor ("composer"), and also:
"mail": an e-mail client, news reader, and address book
"irc": the chatzilla IRC client

%prep
%setup -q -c %{name}-%{version}
#setup -q -T -D -n %{name}-%{version}/comm-%{?beta:beta}%{!?beta:release}
%setup -q -T -D -n %{name}-%{version}/seamonkey-%{version}%{?beta:beta}%{?beta}
echo %version > suite/config/version.txt

%patch7 -p1 -b .browser-home-page


#patch305 -p1 -b .subdir-optflags
%patch310 -p1 -b .branding
%patch322 -p1 -b .system-ogg
%patch324 -p1 -b .webrtc-system-ogg
%patch327 -p1 -b .libpng-version
%patch333 -p1 -b .crash-and-fullscreen
%patch337 -p1 -b .extra-config-options

# remove all trademarked logos
rm -f suite/branding/nightly/icons/*/seamonkey.* \
      suite/branding/nightly/content/{logo.gif,icon64.png,about.png} \
      suite/branding/nightly/icons/gtk/{default.png,default16.png,default48.png,main-window.png,main-window16.png,main-window48.png} \
      suite/branding/nightly/icons/windows/{html-file.ico,main-window.ico,misc-file.ico} \
      suite/branding/nightly/package/mac/background.png \
      suite/themes/modern/communicator/brand/*.png \
      suite/themes/classic/communicator/brand/*.png

# add iceape branding files
mkdir mageia
pushd mageia
tar xf %{SOURCE29}
# needed for 2.19+
touch branding/moz.build
cat <<EOF >branding/moz.build
JAR_MANIFESTS += ['jar.mn']
EOF
popd

# borrow some standard seamonkey icons until we have our own
mkdir -p mageia/branding/icons/gtk
cp -n suite/branding/nightly/icons/gtk/*.png mageia/branding/icons/gtk/
# need to investigate if using this file is correct
mkdir -p mageia/branding/content
cp suite/branding/nightly/content/aboutRights.js mageia/branding/content/
cp suite/branding/nightly/content/aboutRights.xhtml mageia/branding/content/

# set up a simple non-animated throbber from the icon
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 32 -h 32 -a -o suite/themes/modern/communicator/brand/throbber-single.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 32 -h 32 -a -o suite/themes/modern/communicator/brand/throbber-anim.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 16 -h 16 -a -o suite/themes/modern/communicator/brand/throbber16-single.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 16 -h 16 -a -o suite/themes/modern/communicator/brand/throbber16-anim.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 32 -h 32 -a -o suite/themes/classic/communicator/brand/throbber-single.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 32 -h 32 -a -o suite/themes/classic/communicator/brand/throbber-anim.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 16 -h 16 -a -o suite/themes/classic/communicator/brand/throbber16-single.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 16 -h 16 -a -o suite/themes/classic/communicator/brand/throbber16-anim.png

# let jars get compressed
#__perl -p -i -e 's|\-0|\-9|g' config/make-jars.pl

# disable check for new versions
sed -i -re 's/("app.update.enabled", )true/\1false/' suite/browser/browser-prefs.js

%build
#needed by patch 178, 182 & 205 & 262
autoconf-2.13
#needed by patch 305, 321
pushd mozilla
autoconf-2.13
pushd js/src
autoconf-2.13
popd
popd


# needed to regenerate certdata.c
pushd mozilla/security/nss/lib/ckfw/builtins
rm -f certdata.txt
ln -s /etc/pki/tls/mozilla/certdata.txt
popd
export MOZ_BUILD_DATE="%{releasedate}"

OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -I/usr/include/pixman-1"
#cd build
#CONFIGURE_TOP=..
echo ac_add_options \
	--enable-application=suite \
	--disable-official-branding \
	--with-branding=./mageia/branding \
	--with-distribution-id=org.mageia \
	--with-pthreads \
	--enable-safe-browsing \
	--disable-updater \
	--enable-startup-notification \
	--enable-chrome-format=omni \
	--enable-optimize \
	--disable-strip \
%if %build_debug
	--enable-debug \
%else
	--disable-debug \
%endif
	--disable-tests \
	--disable-necko-wifi \
	--disable-crashreporter \
	--with-system-nspr \
	--with-system-nss \
	--with-default-mozilla-five-home=%{mozillalibdir} \
	--with-system-zlib \
	--enable-system-cairo \
	--with-system-bz2 \
	--with-system-jpeg \
	--with-system-libevent \
	--enable-system-ffi \
%if %distro_release < 6
	--disable-system-sqlite \
%else
	--enable-system-sqlite \
%endif
%if %distro_release < 6
	--without-system-libvpx \
%else
	--with-system-libvpx \
%endif
	--with-system-png \
	--with-system-ogg \
%if %distro_release < 6
	--without-system-icu \
%else
	--with-system-icu \
%endif
	--enable-system-hunspell \
	--enable-gio \
	--enable-libproxy \
	--mandir=%{_mandir} \
	--enable-default-toolkit=%{toolkit} \
>.mozconfig

%if 0
# old configure options currently not passed to old-configure script
	--enable-crypto \
	--enable-ipv6 \
	--enable-svg \
	--enable-xft \
	--enable-pango \
	--disable-gnomevfs \
	--enable-webm \
	--enable-xinerama \
	--enable-mathml \
	--enable-canvas \
	--enable-gstreamer=1.0 \
	--enable-libxul \
	--enable-svg-renderer-libart \
	--disable-cpp-exceptions \
	--disable-old-abi-compat-wrappers \
	--disable-pedantic \
	--disable-short-wchar \
	--disable-xprint \
%endif

make -f client.mk MOZ_OPTIMIZE_FLAGS="$OPT_FLAGS"
# MOZ_MAKE_FLAGS="%{_smp_mflags}"

%install
mkdir -p $RPM_BUILD_ROOT%{mozillalibdir}/plugins

cd obj-*
#makeinstall_std STRIP=/bin/true

pushd dist/bin/
tar chf - . | (cd $RPM_BUILD_ROOT%{mozillalibdir}/; tar xpf -)
popd
# put back symlink
rm -f $RPM_BUILD_ROOT%{mozillalibdir}/iceape
ln -s iceape-bin $RPM_BUILD_ROOT%{mozillalibdir}/iceape

# install l10n files
%if %{enable_l10n}
iceape_locale()
{
  find $1 -type f -exec \
    sed -ri \
      -e 's/(Name[ =]+"?)SeaMonkey/\1IceApe/' \
      -e 's/SeaMonkey([ -]Sync)/IceApe\1/g' \
      -e 's/(themes\.mozilla\.org\.name=.*)SeaMonkey/\1IceApe/' \
      -e 's/(extensions\.\{972ce4c6-7e08-4474-a285-3208198ce6fd\}\.name=.*)SeaMonkey/\1IceApe/' \
      -e 's/(migration\.properties:homePageStartDefault=.*)SeaMonkey/\1IceApe/' \
      -e 's/(migration\.properties:homePageStartCurrent=.*)SeaMonkey/\1IceApe/' \
      {} \;
}

cat %{SOURCE99} >$RPM_BUILD_ROOT%{mozillalibdir}/chrome/locale.alias
mkdir -p $RPM_BUILD_ROOT%{mozillalibdir}/extensions
pushd $RPM_BUILD_ROOT%{mozillalibdir}/extensions
for lang in %{l10ns}; do
  RPMLANG=$(echo $lang|cut -d '-' -f 1)
  l10ndir=langpack-${lang}@seamonkey.mozilla.org
  mkdir -p ${l10ndir}
  pushd ${l10ndir}
    unzip -o %{_sourcedir}/seamonkey-%{oversion}.${lang}.langpack.xpi
  popd
  echo "%lang($RPMLANG) %{mozillalibdir}/extensions/${l10ndir}" >> %{_tmppath}/mozilla.list
  iceape_locale ${l10ndir}
done
echo "%{mozillalibdir}/chrome/locale.alias" >> %{_tmppath}/mozilla.list
popd

#iceape_locale suite/locales/en-US
%endif

# build our initial component and chrome registry
# we don't need to do this anymore
pushd `pwd`
  cd $RPM_BUILD_ROOT%{mozillalibdir}
  # register our components
#  LD_LIBRARY_PATH=`pwd`/..:`pwd` MOZILLA_FIVE_HOME=`pwd` ./regxpcom
  # set up the default skin and locale to trigger the generation of
  # the user-locales and users-skins.rdf
  echo "skin,install,select,classic/1.0" >> chrome/installed-chrome.txt
  echo "locale,install,select,en-US" >> chrome/installed-chrome.txt
  # fix permissions of the chrome directories
  find . -type d -perm 0700 -exec chmod 755 {} \; || :
popd

# branding dir is outside build dir
cd ..

mkdir -p %{buildroot}%{_miconsdir} $RPM_BUILD_ROOT%{_liconsdir}
mkdir -p %{buildroot}%{_iconsdir}/hicolor/{16x16,32x32,48x48,64x64}/apps

rsvg-convert mageia/branding/iceape_icon_plain.svg -w 16 -h 16 -a -o %{buildroot}%{_miconsdir}/%{name}.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 32 -h 32 -a -o %{buildroot}%{_iconsdir}/%{name}.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 64 -h 64 -a -o %{buildroot}%{_liconsdir}/%{name}.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 16 -h 16 -a -o %{buildroot}%{_miconsdir}/%{name}-mail.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 32 -h 32 -a -o %{buildroot}%{_iconsdir}/%{name}-mail.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 64 -h 64 -a -o %{buildroot}%{_liconsdir}/%{name}-mail.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 16 -h 16 -a -o %{buildroot}%{_iconsdir}/hicolor/16x16/apps/%{name}.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 32 -h 32 -a -o %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{name}.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 48 -h 48 -a -o %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{name}.png
rsvg-convert mageia/branding/iceape_icon_plain.svg -w 64 -h 64 -a -o %{buildroot}%{_iconsdir}/hicolor/64x64/apps/%{name}.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 16 -h 16 -a -o %{buildroot}%{_iconsdir}/hicolor/16x16/apps/%{name}-mail.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 32 -h 32 -a -o %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{name}-mail.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 48 -h 48 -a -o %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{name}-mail.png
rsvg-convert mageia/branding/iceape_mail_icon_plain.svg -w 64 -h 64 -a -o %{buildroot}%{_iconsdir}/hicolor/64x64/apps/%{name}-mail.png

# install our mozilla.sh file
mkdir -p $RPM_BUILD_ROOT%{_bindir}
rm -f $RPM_BUILD_ROOT%{_bindir}/iceape
cat %{SOURCE10} | sed -e "s|ICEAPE_VERSION|%{dirversion}|g;s|LIBDIR|%{_libdir}|g" > $RPM_BUILD_ROOT%{_bindir}/iceape
chmod 755 $RPM_BUILD_ROOT%{_bindir}/iceape

# install our rebuild file
cat %{SOURCE26} | sed -e "s|ICEAPE_VERSION|%{dirversion}|g;s|LIBDIR|%{_libdir}|g" > \
  $RPM_BUILD_ROOT%{mozillalibdir}/iceape-rebuild-databases.pl

chmod 755 \
  $RPM_BUILD_ROOT%{mozillalibdir}/iceape-rebuild-databases.pl

# we own /usr/lib/mozilla/plugins which is the version-independent
# place that our plugins can be installed
mkdir -p $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins

%if %build_gre
# install the gre.conf file
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
echo [%{oversion}] >  $RPM_BUILD_ROOT%{_sysconfdir}/gre.conf
echo GRE_PATH=%{mozillalibdir} >> $RPM_BUILD_ROOT%{_sysconfdir}/gre.conf
%endif

# installs menu file
# NOTE: these desktop files are different from debian's, 
#       we might consider using those
install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/applications

# install bookmarks
rm -f $RPM_BUILD_ROOT%{mozillalibdir}/defaults/profile/bookmarks.html
ln -s ../../../../share/mga/bookmarks/mozilla/mozilla-download.html $RPM_BUILD_ROOT%{mozillalibdir}/defaults/profile/bookmarks.html

# duckduckgo
cp -f %{SOURCE30} %{buildroot}%{mozillalibdir}/searchplugins/duckduckgo.xml


cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=IceApe Navigator
Comment=Iceape Navigator web browser
Exec=%{_bindir}/iceape %u
Icon=iceape
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;Network;WebBrowser;
StartupWMClass=Iceape-bin
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-composer.desktop << EOF
[Desktop Entry]
Name=IceApe Composer
Comment=Iceape Composer HTML editor
Exec=%{_bindir}/iceape -edit %u
Icon=iceape
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;Network;WebDevelopment;
StartupWMClass=Iceape-bin
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-mail.desktop << EOF
[Desktop Entry]
Name=IceApe Mail
Comment=Iceape Mail & Newsgroups e-mail client
Exec=%{_bindir}/iceape -mail
Icon=iceape-mail
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;
StartupWMClass=Iceape-bin
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-addressbook.desktop << EOF
[Desktop Entry]
Name=IceApe Address Book
Comment=Iceape Address Book
Exec=%{_bindir}/iceape -addressbook
Icon=iceape
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;Office;Network;Email;
StartupWMClass=Iceape-bin
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-news.desktop << EOF
[Desktop Entry]
Name=IceApe News
Comment=Iceape Mail & Newsgroups news reader
Exec=%{_bindir}/iceape -news
Icon=iceape-mail
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;Network;News;
StartupWMClass=Iceape-bin
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-chat.desktop << EOF
[Desktop Entry]
Name=ChatZilla
Comment=Iceape IRC client
Exec=%{_bindir}/iceape -chat
Icon=iceape
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;Network;IRCClient;
StartupWMClass=Iceape-bin
EOF

# remove unpackaged files
#rm -rf $RPM_BUILD_ROOT%{mozillalibdir}/chrome/{cview,embed-sample,layoutdebug,tasks}.jar \
# $RPM_BUILD_ROOT%{mozillalibdir}/chrome/icons/default/{calendar-*,default}.xpm \
# $RPM_BUILD_ROOT%{mozillalibdir}/components/{accessproxy,content,iiextras,xmlsecurity,ipcd,profilesharingsetup,transmngr,ucnative,layout_debug}.xpt \
# $RPM_BUILD_ROOT%{mozillalibdir}/components/{libaccessproxy,libiiextras,libnkdatetime,libnkfinger,libembed_lite,libipcdc,libtransmngr_client,libgkdebug}.so \
# $RPM_BUILD_ROOT%{mozillalibdir}/defaults/profile/US/chrome/*example.css \
# $RPM_BUILD_ROOT%{mozillalibdir}/defaults/profile/chrome/*example.css \
# $RPM_BUILD_ROOT%{mozillalibdir}/res/{gfx/icon_0.gif,gfx/icon_1.gif}  \
# $RPM_BUILD_ROOT%{mozillalibdir}/res/rdf/*test* \
# $RPM_BUILD_ROOT%{mozillalibdir}/res/sample.unixpsfonts.properties  \
# $RPM_BUILD_ROOT%{mozillalibdir}/res/throbber  \
# $RPM_BUILD_ROOT%{mozillalibdir}/res/viewer.properties  \
# $RPM_BUILD_ROOT%{mozillalibdir}/{timebombgen,TestGtkEmbed*,libnullplugin.so,mozilla-ipcd,tmModuleTest,TestIPC} \
# $RPM_BUILD_ROOT%{mozillalibdir}/ipc/modules/{liblockmodule,libtestmodule,libtransmgr}.so \
# $RPM_BUILD_ROOT%{mozillalibdir}/{liblockmodule,libtestmodule,libtr\ansmngr}.so \
# $RPM_BUILD_ROOT%{mozillalibdir}/mozilla-installer-bin \
# $RPM_BUILD_ROOT%{mozillalibdir}/res/samples \

# hunspell/myspell dictionaries
rm -rf $RPM_BUILD_ROOT%{mozillalibdir}/dictionaries
%if %distro_release < 2
ln -s ../../share/dict/mozilla $RPM_BUILD_ROOT%{mozillalibdir}/dictionaries
%else
ln -s ../../share/hunspell $RPM_BUILD_ROOT%{mozillalibdir}/dictionaries
%endif

%clean
rm -rf $RPM_BUILD_ROOT
rm -f %{_tmppath}/mozilla*.list


%post
ulimit -c 0
# run ldconfig before regxpcom
/sbin/ldconfig >/dev/null 2>/dev/null

# we should only rebuild database for first install
# rebuild for update is done in postun
# but it seems we need we might need to do it twince
if [ -x %{mozillalibdir}/iceape-rebuild-databases.pl ]; then
    %{mozillalibdir}/iceape-rebuild-databases.pl
fi

# Default to paper size from locale setting
case `LC_ALL=$LC_MESSAGES /usr/bin/locale -k LC_PAPER | grep width` in
*216) paper="letter";;
*) paper="a4";;
esac
#perl -pi -e "s/^(pref\(\"print.postscript.paper_size\",[^\"]+)\"[a-z0-9]+\"/\1\"$paper\"/" \
#  %{mozillalibdir}/greprefs/all.js

%preun
if [ "$1" = "0" ]; then 
    /bin/rm -rf %{mozillalibdir}/chrome/overlayinfo
    /bin/rm -f %{mozillalibdir}/chrome/*.rdf
fi

%postun
# was this an upgrade?
if [ "$1" == "2" -a -x %{mozillalibdir}/iceape-rebuild-databases.pl ]; then
    %{mozillalibdir}/iceape-rebuild-databases.pl
fi


%files 
%attr(755,root,root) %{_bindir}/iceape
%{mozillalibdir}
%if %build_gre
%config(noreplace) %{_sysconfdir}/gre.conf
%endif
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}-composer.desktop
%{_miconsdir}/*.png
%{_iconsdir}/*.png
%{_liconsdir}/*.png
%{_iconsdir}/hicolor/*/apps/*.png
%dir %{_libdir}/mozilla
%dir %{mozillaplugindir}

%{_datadir}/applications/%{name}-mail.desktop
%{_datadir}/applications/%{name}-news.desktop
%{_datadir}/applications/%{name}-addressbook.desktop
%{_datadir}/applications/%{name}-chat.desktop



%changelog
* Mon Jan 30 2017 cjw <cjw> 0:2.46-1.mga5
+ Revision: 1084180
- 2.46
- use bundled icu and libvpx
- 2.40
- 2.39
- enable full screen API by default in prefs
- disable off-main-thread composition by default in prefs to prevent crashes
- build with bundled libsqlite
- 2.38
- 2.35

* Mon Mar 30 2015 cjw <cjw> 0:2.33.1-1.mga5
+ Revision: 819440
- 2.33.1

* Sun Jan 18 2015 cjw <cjw> 0:2.32-1.mga5
+ Revision: 811223
- 2.32
- use gstreamer1.0 instead of gstreamer0.10 for mpeg4 h.264+aac decoding since it appears to be more reliable

* Mon Dec 08 2014 cjw <cjw> 0:2.31-3.mga5
+ Revision: 802304
- relax conflict on oxygen-gtk, the crashes are gone with 1.4.6-2.mga5

* Sun Dec 07 2014 cjw <cjw> 0:2.31-2.mga5
+ Revision: 802072
- conflict with oxygen-gtk since its gtk2 theme causes iceape to crash when a menu is shown (mga #12978)

* Sat Dec 06 2014 cjw <cjw> 0:2.31-1.mga5
+ Revision: 801719
- 2.31
- depend on gstreamer0.10-ffmpeg instead of libgstreamer0.10_0
- disable calendar (lightning) bundled build - it looks like it does not work at all
- exclude more private library provides

* Sun Oct 19 2014 cjw <cjw> 0:2.30-1.mga5
+ Revision: 791947
- 2.30

* Wed Oct 15 2014 umeabot <umeabot> 0:2.29-3.mga5
+ Revision: 745670
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 0:2.29-2.mga5
+ Revision: 680435
- Mageia 5 Mass Rebuild

  + tv <tv>
    - use %%global for req/prov exclude
    - autoconvert to new prov/req excludes

* Sat Sep 13 2014 cjw <cjw> 0:2.29-1.mga5
+ Revision: 674942
- 2.29

* Mon Jun 16 2014 fwang <fwang> 0:2.26.1-1.mga5
+ Revision: 637521
- 2.16.1

* Mon Jun 09 2014 cjw <cjw> 0:2.26-1.mga5
+ Revision: 635286
- 2.26

  + tmb <tmb>
    - add jar.mn reference to moz.build in iceape-branding
    - rediff P322, P324, P326
    - update to 2.26

* Sun Apr 06 2014 wally <wally> 0:2.25-2.mga5
+ Revision: 612254
- rebuild for new icu

* Sun Mar 30 2014 cjw <cjw> 0:2.25-1.mga5
+ Revision: 610726
- 2.25
- patch326: fix build with system icu
- patch327: allow use of older libpng for mga3 update

* Sun Feb 09 2014 cjw <cjw> 0:2.24-1.mga5
+ Revision: 587069
- 2.24
- build against system icu libraries
- disable patch 325, not needed anymore

* Tue Nov 05 2013 cjw <cjw> 0:2.22-1.mga4
+ Revision: 549745
- 2.22
- disable parallel build because it fails
- add ugly requires on gstreamer libraries because mozilla code now dlopens them
- (re-)enable gstreamer by default
- patch324: re-add webrtc system opus patch
- drop patch313: system cairo support fixed upstream

* Thu Aug 22 2013 cjw <cjw> 0:2.20-1.mga4
+ Revision: 469311
- 2.20
- use client.mk for build

* Sat Aug 03 2013 cjw <cjw> 0:2.19-1.mga4
+ Revision: 463045
- 2.19

* Tue Jun 04 2013 fwang <fwang> 0:2.17-2.mga4
+ Revision: 437007
- rebuild for new libpng

* Tue Apr 09 2013 cjw <cjw> 0:2.17-1.mga3
+ Revision: 409301
- 2.17

  + fwang <fwang>
    - new version 2.16.1

* Sun Mar 03 2013 cjw <cjw> 0:2.16-1.mga3
+ Revision: 401214
- 2.16
- add duckduckgo searchengine
- drop system python virtualenv patch, the build works better without it
- drop patch323, implemented upstream
- patch324: fix webrtc build with system opus library
- don't disable webrtc

* Sat Jan 12 2013 umeabot <umeabot> 0:2.15-3.mga3
+ Revision: 354122
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Thu Jan 10 2013 cjw <cjw> 0:2.15-2.mga3
+ Revision: 344499
- patch322: build against system ogg/vorbis/theora/opus libraries
- patch323: don't use gstreamer for ogg media - doesn't work for opus
- disable webrtc for now, not yet fixed in system-ogg patch

* Wed Jan 09 2013 cjw <cjw> 0:2.15-1.mga3
+ Revision: 344121
- 2.15 final

* Mon Dec 24 2012 cjw <cjw> 0:2.15-0.b5.1.mga3
+ Revision: 334689
- 2.15 beta5
- disable debug packages because // in path names in gyp-generated makefiles for nrappkit/nICEr break debug package generation
- enable calendar
- rediff cairo patch

* Sun Dec 02 2012 cjw <cjw> 0:2.14.1-1.mga3
+ Revision: 324812
- 2.14.1

* Thu Nov 08 2012 cjw <cjw> 0:2.13.2-1.mga3
+ Revision: 316504
- 2.13.2
- drop patch317: fixed upstream
- drop patch320: included upstream
- patch321: fix nspr & nss version checks if library version has no micro version
- rediff patch319

* Mon Sep 24 2012 cjw <cjw> 0:2.12.1-0.1.mga3
+ Revision: 297079
- 2.12.1
- add more provides/requires exceptions

* Fri Aug 17 2012 cjw <cjw> 0:2.12-0.b4.1.mga3
+ Revision: 281715
- enable startup-notification
- 2.12b4
- add more provides/requires exceptions
- change urls back to upstream's own site
- build: make tools
- drop patch318 because plugin-container is now built
- patch319: use system virtualenv tool to fix build problems due to mageia multiarch support
- patch320: fix regression in gstreamer support (patch from upstream)

* Sun Jul 22 2012 cjw <cjw> 0:2.11-1.mga3
+ Revision: 273484
- new release 2.11
- merge all subpackages for easier maintenance
- disable plugin container by default (the binary is not built for some reason)
- clean up specfile a bit
- move iceape back to cauldron

  + doktor5000 <doktor5000>
    - dropping from cauldron as announced on -dev ml

* Fri Dec 23 2011 fwang <fwang> 0:2.6.1-1.mga2
+ Revision: 186569
- fix build with latest libpng
- drop old patches
- new version 2.6.1
- new version 2.6

* Wed Nov 23 2011 fwang <fwang> 0:2.5-1.mga2
+ Revision: 171260
- new version 2.5

* Fri Sep 30 2011 fwang <fwang> 0:2.4.1-1.mga2
+ Revision: 150475
- new version 2.4.1

* Sun Sep 25 2011 fwang <fwang> 0:2.4-1.mga2
+ Revision: 147658
- update file list
- fix str fmt
- drop enig tarball
- new version 2.4

* Sun Sep 11 2011 fwang <fwang> 0:2.3.3-2.mga2
+ Revision: 142368
- br system png

* Mon Sep 05 2011 fwang <fwang> 0:2.3.3-1.mga2
+ Revision: 138560
- new version 2.3.3

* Fri Sep 02 2011 fwang <fwang> 0:2.3.2-1.mga2
+ Revision: 137891
- fix internal version
- new version 2.3.2
- new version 2.3.1
- disable gnomevfs
- drop old patch
- new version 2.3

* Sun Jul 10 2011 cjw <cjw> 0:2.2-1.mga2
+ Revision: 121911
- add icons that might work in gnome-shell
- use configure2_5x
- update to version 2.2
- patch311: fix build

* Sun Jun 26 2011 fwang <fwang> 0:2.1-2.mga2
+ Revision: 113990
- rebuild for new hunspell

* Mon Jun 13 2011 cjw <cjw> 0:2.1-1.mga2
+ Revision: 105755
- iceape 2.1
- use internal libpng until mageia has libpng >= 1.4.1

* Sun May 15 2011 pterjan <pterjan> 0:2.0.14-2.mga1
+ Revision: 99006
- Rebuild for fixed find-requires

* Sat Apr 30 2011 cjw <cjw> 0:2.0.14-1.mga1
+ Revision: 93595
- 2.0.14

* Mon Apr 18 2011 cjw <cjw> 0:2.0.13-1.mga1
+ Revision: 87554
- 2.0.13
- update home page location

* Sun Apr 10 2011 cjw <cjw> 0:2.0.12-1.mga1
+ Revision: 82761
- imported package iceape