File seamonkey.spec of Package seamonkey.import4113

# spec file for package seamonkey
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#               2006-2011 Wolfgang Rosenauer
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           seamonkey
BuildRequires:  autoconf213 fdupes gcc-c++ libgnomeui-devel libidl-devel python startup-notification-devel unzip update-desktop-files zip
%if %suse_version > 1030
BuildRequires:  hunspell-devel
%if %suse_version > 1100
BuildRequires:  nss-shared-helper-devel
License:        GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Provides:       web_browser
Version:        2.0.12
Release:        0.<RELEASE2>
Summary:        The successor of the Mozilla Application Suite
Group:          Productivity/Networking/Web/Browsers
Source:         seamonkey-%{version}-source.tar.bz2
Source1:        seamonkey-desktop.tar.bz2
Source4:        suse-default-prefs.js
Source5:        l10n-%{version}.tar.bz2
Source6:        search-addons.tar.bz2
Source7:        seamonkey-rpmlintrc
Patch1:         seamonkey-ua-locale.patch
Patch3:         mozilla-nongnome-proxies.patch
Patch4:         mozilla-path_len.patch
Patch5:         mozilla-startup-notification.patch
Patch6:         mozilla-shared-nss-db.patch
Patch7:         seamonkey-shared-nss-db.patch
Patch8:         seamonkey-no-update.patch
Patch9:         mozilla-gtkfilepicker-buttonorder.patch
Patch10:        mozilla-system-hunspell.patch.bz2
Patch11:        mozilla-prefer_plugin_pref.patch
Patch12:        mozilla-cairo-lcd.patch
Patch13:        mozilla-ua-locale.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         /bin/sh coreutils
Provides:       seamonkey-mail = %{version}
Obsoletes:      seamonkey-mail <= 2.0
Provides:       seamonkey-spellchecker = %{version}
Obsoletes:      seamonkey-spellchecker <= 2.0
%define releasedate 2011012100
%define progname %{name}
%define prefix /usr
%define progdir %_libdir/%{progname}
%define libgssapi
### build options
%define has_system_cairo 0
### build options end
%define _use_internal_dependency_generator 0
%define __find_requires sh %{SOURCE8}
%global provfind sh -c "grep -v '.so' | %__find_provides"
%global __find_provides %provfind
# the following conditions are always met in Factory by definition
# so using %opensuse_bs is secure for now
BuildRequires:  mozilla-nspr-devel
PreReq:         mozilla-nspr >= %(rpm -q --queryformat '%{VERSION}' mozilla-nspr)
BuildRequires:  mozilla-nss-devel >= 3.12.8
PreReq:         mozilla-nss >= %(rpm -q --queryformat '%{VERSION}' mozilla-nss)

Originally based on the Netscape Communicator source, the SeaMonkey
project grew to be the most advanced web browser currently available.
It supports new techniques like CSS2, MathML, SVG, XML, transparent
PNGs, and its look is fully theme-able.

%package irc
License:        GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary:        IRC for SeaMonkey
Group:          Productivity/Networking/IRC
PreReq:         %{name} = %{version}

%description irc
An IRC Client (Chatzilla) for SeaMonkey.

%package venkman
License:        GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary:        The SeaMonkey JavaScript Debugger
Group:          Development/Tools/Debuggers
PreReq:         %{name} = %{version}

%description venkman
A javascript debugger for the SeaMonkey web browser.

%package dom-inspector
License:        GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary:        The SeaMonkey DOM Inspector
Group:          Development/Tools/Navigators
PreReq:         %{name} = %{version}

%description dom-inspector
This is a tool that allows you to inspect the DOM for web pages in
SeaMonkey. This is of great use to people who are doing SeaMonkey
chrome development or web page development.

%package translations-common
License:        GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary:        Common translations for SeaMonkey
Provides:       locale(%{name}:ca;cs;de;es_AR;es_ES;;fr;hu;it;ja;nb_NO;nl;pl;pt_PT;ru;sv_SE)
Group:          System/Localization
PreReq:         %{name} = %{version}

%description translations-common
This package contains several optional languages for the user interface
of SeaMonkey.

%package translations-other
License:        GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary:        Extra translations for SeaMonkey
Provides:       locale(%{name}:be;gl;ka;lt;sk;tr)
Group:          System/Localization
PreReq:         %{name} = %{version}

%description translations-other
This package contains several optional languages for the user interface
of SeaMonkey.

%setup -n seamonkey -b 1 -b 5 -q
# mozilla patches
pushd mozilla
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch9 -p1
pushd extensions
%patch11 -p1
%patch12 -p1
%patch13 -p1
# comm patches
%patch1 -p1
%patch7 -p1
%patch8 -p1

export MOZ_BUILD_DATE=%{releasedate}
export CFLAGS="$RPM_OPT_FLAGS -Os -fno-strict-aliasing"
export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZ_MILESTONE_RELEASE=1
mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
ac_add_options --enable-application=suite
ac_add_options --libdir=%{progdir}
ac_add_options --prefix=%{prefix}
ac_add_options --with-l10n-base=../l10n
ac_add_options --disable-tests
ac_add_options --enable-optimize
ac_add_options --disable-debug --disable-dtd-debug
ac_add_options --enable-static
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
# ac_add_options--with-system-png # no apng support
ac_add_options --enable-ldap-experimental
ac_add_options --disable-installer
ac_add_options --disable-mochitest
ac_add_options --disable-crashreporter
ac_add_options --enable-startup-notification
#ac_add_options --enable-system-mozldap
%if %suse_version > 1030
cat << EOF >> $MOZCONFIG
ac_add_options --enable-system-hunspell
%if %has_system_cairo
cat << EOF >> $MOZCONFIG
ac_add_options --enable-system-cairo 
make -f build

make -C suite/installer STRIP=/bin/true
# copy tree into RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{progdir}
cp -rf $RPM_BUILD_DIR/seamonkey/mozilla/dist/seamonkey/* $RPM_BUILD_ROOT%{progdir}
# remove some executable permissions
find $RPM_BUILD_ROOT%{progdir} -name "*.js" | xargs chmod a-x
rm -f %{_tmppath}/translations.*
for locale in $(awk '{ print $1; }' suite/locales/shipped-locales); do
  case $locale in
          # locales not to be included in translations package
          make -C suite/locales libs-$locale || continue
	  cp mozilla/dist/xpi-stage/locale-$locale/chrome/$locale.jar \
	  cp mozilla/dist/xpi-stage/locale-$locale/chrome/$locale.manifest \
	  #cp mozilla/dist/xpi-stage/chatzilla-$locale/chrome/chatzilla.jar \
	  #   $RPM_BUILD_ROOT%{progdir}/chrome/chatzilla-$locale.jar
	  #cp mozilla/dist/xpi-stage/chatzilla-$locale/chrome/chatzilla.manifest \
	  #   $RPM_BUILD_ROOT%{progdir}/chrome/chatzilla-$locale.manifest
	  #cp mozilla/dist/xpi-stage/venkman-$locale/chrome/venkman.jar \
	  #   $RPM_BUILD_ROOT%{progdir}/chrome/venkman-$locale.jar
	  #cp mozilla/dist/xpi-stage/venkman-$locale/chrome/venkman.jar \
	  #   $RPM_BUILD_ROOT%{progdir}/chrome/venkman-$locale.manifest
          # check against the fixed common list and sort into the right filelist
          for _match in ar ca cs da de en-GB es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do
            [ "$_match" = "$locale" ] && _matched=1
          [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
          echo %{progdir}/chrome/$locale.jar      >> %{_tmppath}/translations.$_l10ntarget
          echo %{progdir}/chrome/$locale.manifest >> %{_tmppath}/translations.$_l10ntarget
	  #echo %{progdir}/chrome/chatzilla-$locale.jar >> %{_tmppath}/translations.$_l10ntarget
	  #echo %{progdir}/chrome/chatzilla-$locale.manifest >> %{_tmppath}/translations.$_l10ntarget
	  #echo %{progdir}/chrome/venkman-$locale.jar >> %{_tmppath}/translations.$_l10ntarget
	  #echo %{progdir}/chrome/venkman-$locale.manifest >> %{_tmppath}/translations.$_l10ntarget
# overwrite the mozilla start-script and link it to /usr/bin
mkdir --parents $RPM_BUILD_ROOT%{_bindir}
sed "s:%%PREFIX:%{prefix}:g
s:%%APPNAME:seamonkey:g" \
   %{SOURCE3} > $RPM_BUILD_ROOT%{progdir}/%{progname}.sh 
chmod 755 $RPM_BUILD_ROOT%{progdir}/%{progname}.sh
ln -sf ../..%{progdir}/%{progname}.sh $RPM_BUILD_ROOT%{_bindir}/%{progname}
# apply SUSE defaults
sed -e 's,RPM_VERSION,%{version}-%{release},g
#s,GSSAPI,%{libgssapi},g' \
   %{SOURCE4} > suse-default-prefs
cp suse-default-prefs $RPM_BUILD_ROOT%{progdir}/defaults/pref/all-openSUSE.js
rm suse-default-prefs
# Desktop definition
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
install -m 644 $RPM_BUILD_DIR/*.desktop \
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/
install -m 644 $RPM_BUILD_DIR/*.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/
# install 
sed "s:%%PROGDIR:%{progdir}:g
s:%%APPNAME:%{progname}:g" \
   %{SOURCE2} > $RPM_BUILD_ROOT%{progdir}/
chmod 755 $RPM_BUILD_ROOT%{progdir}/
%suse_update_desktop_file seamonkey          Network WebBrowser GTK
%suse_update_desktop_file seamonkey-mail     Network Email GTK
%suse_update_desktop_file seamonkey-composer Network WebDevelopment GTK
# excludes
rm -f $RPM_BUILD_ROOT%{progdir}/license.txt
rm -f $RPM_BUILD_ROOT%{progdir}/README
rm -f $RPM_BUILD_ROOT%{progdir}/removed-files
rm -f $RPM_BUILD_ROOT%{progdir}/
rm -f $RPM_BUILD_ROOT%{progdir}/seamonkey
rm -f $RPM_BUILD_ROOT%{progdir}/updater
rm -f $RPM_BUILD_ROOT%{progdir}/updater.ini
rm -f $RPM_BUILD_ROOT%{progdir}/update.locale
rm -f $RPM_BUILD_ROOT%{progdir}/icons/updater.png
rm -f $RPM_BUILD_ROOT%{progdir}/dictionaries/*
# Some sites use different partitions for /usr/(lib|lib64) and /usr/share.  Since you
# can't create hardlinks across partitions, we'll do this more than once.
%fdupes $RPM_BUILD_ROOT%{progdir}
%fdupes $RPM_BUILD_ROOT%{_datadir}

rm -rf %{_tmppath}/translations.*

%{progdir}/ > /dev/null 2>&1
exit 0

rm -f %{progdir}/dictionaries/*
exit 0

%triggerin -- myspell-dictionary
%{progdir}/ > /dev/null 2>&1
exit 0

%triggerpostun -- myspell-dictionary
%{progdir}/ > /dev/null 2>&1
exit 0

%dir %{progdir}
%dir %{progdir}/dictionaries/
%dir %{progdir}/extensions/
%dir %{progdir}/chrome/

%files irc

%files venkman

%files dom-inspector

%files translations-common -f %{_tmppath}/translations.common

%files translations-other -f %{_tmppath}/translations.other

openSUSE Build Service is sponsored by