File MozillaSunbird.spec of Package MozillaSunbird
#
# spec file for package MozillaSunbird (Version 0.9)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2006-2009 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 http://bugs.opensuse.org/
#
Name: MozillaSunbird
BuildRequires: gcc-c++ libgnomeui-devel libidl-devel orbit-devel unzip update-desktop-files zip
%if %suse_version > 1020
BuildRequires: fdupes
%endif
%if %suse_version > 1100
BuildRequires: nss-shared-helper-devel
%endif
# fix broken SLES9 requirements
%if %suse_version == 910
BuildRequires: freetype2-devel gnome-vfs2 libgnome libgnomeui pkgconfig popt-devel
%endif
%if %suse_version > 930
BuildRequires: mozilla-nspr-devel
%endif
%if %suse_version > 1010 || 0%{?opensuse_bs}
BuildRequires: mozilla-nss-devel
%endif
License: GPL v2 or later ; LGPL v2.1 or later ; MPL ..
Version: 0.9
Release: 2
Summary: Mozilla's Calendar Application
Url: http://www.mozilla.org/projects/calendar/
Group: Productivity/Office/Organizers
Source: sunbird-%{version}-source.tar.bz2
Source1: sunbird.desktop
Source2: l10n-%{version}.tar.bz2
Source3: MozillaSunbird-rpmlintrc
Source4: cvs-update.sh
Patch1: mozilla-gcc4.3-fixes.patch
Patch2: mozilla-path_len.patch
Patch3: mozilla-gcc44.patch
Patch4: nss-opt.patch
Patch5: sunbird-shared-nssdb.patch
Patch8: abuild.patch
Patch9: locale.patch
Patch11: missing-return.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: libstdc++ fileutils textutils /bin/sh
%define _unpackaged_files_terminate_build 0
%define releasedate 2008092400
%define progname sunbird
%define progdir %{_prefix}/%_lib/%{progname}
%define my_provides /tmp/my-provides
%define my_requires /tmp/my-requires
%description
The Sunbird Project is a redesign of the Mozilla Calendar component.
The goal is to produce a cross-platform stand-alone calendar application
based on Mozilla's XUL user interface language. At the moment, Sunbird
is a project name. It is not official and may change in the future. The
intended user is someone who uses Mozilla Firefox and Mozilla
Thunderbird and wants a calendar application based on Mozilla.
Authors:
--------
Mozilla Foundation <drivers@mozilla.org>
%package translations
License: GPL v2 or later ; LGPL v2.1 or later ; MPL ..
Summary: Translations of Mozilla Sunbird
Provides: locale(%{name}:ca;cs;da;de;es_AR;es_ES;eu;fr;ga_IE;hu;is;it;ja;ka;ko;lt;nb_NO;nl;pl;pt_BR;pt_PT;ro;ru;sk;sl;sv_SE;uk;zh_CN;zh_TW)
Group: Productivity/Office/Organizers
PreReq: %{name} = %{version}
%description translations
This package contains the additional languages for Sunbird.
The Sunbird Project is a redesign of the Mozilla Calendar component.
The goal is to produce a cross-platform stand-alone calendar
application based on Mozilla's XUL user interface language. At the
moment, the Sunbird name is a project name. It is not official and may
change in the future.
The intended user is someone who uses Mozilla Firefox and Mozilla
Thunderbird and wants a calendar application based on Mozilla.
Authors:
--------
Mozilla Foundation <drivers@mozilla.org>
%prep
%setup -n mozilla -b 2 -q
%patch1
%patch2 -p1
%patch3
%patch4
%patch5
%patch8 -p1
%patch9
%patch11
%build
export SUSE_ASNEEDED=0
export MOZ_BUILD_DATE=%{releasedate}
export MOZILLA_OFFICIAL=1
export BUILD_OFFICIAL=1
export CFLAGS="$RPM_OPT_FLAGS -Os -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"
export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
cat << EOF > $MOZCONFIG
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
. \$topsrcdir/calendar/sunbird/config/mozconfig
ac_add_options --prefix=%{_prefix}
ac_add_options --libdir=%{_libdir}
ac_add_options --sysconfdir=%{_sysconfdir}
ac_add_options --mandir=%{_mandir}
ac_add_options --includedir=%{_includedir}
ac_add_options --enable-optimize
ac_add_options --with-system-jpeg
ac_add_options --with-system-png
ac_add_options --with-system-zlib
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-xft
ac_add_options --disable-tests
ac_add_options --disable-freetype2
ac_add_options --disable-installer
ac_add_options --enable-static
ac_add_options --disable-shared
ac_add_options --enable-logging
ac_add_options --enable-official-branding
#ac_add_options --enable-debug
EOF
%if %suse_version > 930
cat << EOF >> $MOZCONFIG
ac_add_options --with-system-nspr
ac_add_options --enable-system-cairo
EOF
%endif
%if %suse_version > 1010 || 0%{?opensuse_bs}
cat << EOF >> $MOZCONFIG
ac_add_options --with-system-nss
EOF
%endif
make -f client.mk build
%install
make -C xpinstall/packager STRIP=/bin/true
# copy tree into RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{progdir}
cp -rf $RPM_BUILD_DIR/mozilla/dist/%{progname}/* $RPM_BUILD_ROOT%{progdir}
mkdir $RPM_BUILD_ROOT%{_bindir}
ln -sf ../..%{progdir}/%{progname} $RPM_BUILD_ROOT%{_bindir}/%{progname}
# install additional locales
echo %defattr\(-,root,root\) > %{_tmppath}/translations.list
for locale in $(awk '{ print $1; }' calendar/locales/shipped-locales); do
case $locale in
ja-JP-mac|en-US)
;;
*)
make -C calendar/locales libs-$locale
cp dist/xpi-stage/locale-$locale/chrome/$locale.jar \
dist/xpi-stage/locale-$locale/chrome/calendar-$locale.jar \
$RPM_BUILD_ROOT/%{progdir}/chrome
cp dist/xpi-stage/locale-$locale/chrome/$locale.manifest \
dist/xpi-stage/locale-$locale/chrome/calendar-$locale.manifest \
$RPM_BUILD_ROOT/%{progdir}/chrome
echo %{progdir}/chrome/$locale.jar >> %{_tmppath}/translations.list
echo %{progdir}/chrome/$locale.manifest >> %{_tmppath}/translations.list
echo %{progdir}/chrome/calendar-$locale.jar >> %{_tmppath}/translations.list
echo %{progdir}/chrome/calendar-$locale.manifest >> %{_tmppath}/translations.list
esac
done
# freedesktop definition
mkdir -p $RPM_BUILD_ROOT/usr/share/applications/
install -m 644 %{SOURCE1} \
$RPM_BUILD_ROOT/usr/share/applications
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/
cp -f $RPM_BUILD_ROOT%{progdir}/chrome/icons/default/default.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/%{progname}.xpm
%suse_update_desktop_file %{progname} Office Calendar GTK
# remove spurious executable bits
find $RPM_BUILD_ROOT%{_libdir}/sunbird -name "*.js" -o -name "*.xpm" | xargs chmod a-x
# modify provides and requires lists
%if %suse_version == 1000 || %suse_version == 1010
cat << EOF > %{my_provides}
grep -vE "libnss3.so|libnssckbi.so|libsmime3.so|libsoftokn3.so|libssl3.so|libfreebl3.so" | %{__find_provides}
EOF
chmod 755 %{my_provides}
%define __find_provides %{my_provides}
cat << EOF > %{my_requires}
grep -vE "libnss3.so|libnssckbi.so|libsmime3.so|libsoftokn3.so|libssl3.so|libfreebl3.so|sunbird-bin" | %{__find_requires}
EOF
chmod 755 %{my_requires}
%define __find_requires %{my_requires}
%endif
%if %suse_version > 1020
%fdupes $RPM_BUILD_ROOT%{progdir}
%fdupes $RPM_BUILD_ROOT%{_datadir}
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%if %suse_version == 1000 || %suse_version == 1010
rm -f %{my_provides}
rm -f %{my_requires}
%endif
rm -rf %{_tmppath}/translations.list
%files
%defattr(-,root,root)
%{_bindir}/%{progname}
%attr(644,root,root) %{_datadir}/pixmaps/%{progname}.xpm
%attr(644,root,root) %{_datadir}/applications/%{progname}.desktop
%dir %{progdir}
%dir %{progdir}/chrome/
%{progdir}/chrome/icons/
%{progdir}/chrome/calendar-en-US.*
%{progdir}/chrome/calendar.*
%{progdir}/chrome/classic.*
%{progdir}/chrome/comm.*
%{progdir}/chrome/en-US.*
%{progdir}/chrome/pippki.*
%{progdir}/chrome/toolkit.*
%{progdir}/components/
%{progdir}/defaults/
%{progdir}/extensions/
%{progdir}/greprefs/
%{progdir}/icons/
%{progdir}/js/
%{progdir}/res/
# NSPR
%if %suse_version <= 930
%{progdir}/libnspr4.so
%{progdir}/libplc4.so
%{progdir}/libplds4.so
%endif
# NSS
%if %suse_version <= 1010 && !0%{?opensuse_bs}
%{progdir}/libnss3.so
%{progdir}/libnssckbi.so
%{progdir}/libsmime3.so
%{progdir}/libsoftokn3.chk
%{progdir}/libsoftokn3.so
%{progdir}/libfreebl3.chk
%{progdir}/libfreebl3.so
%{progdir}/libssl3.so
%endif
#
%{progdir}/libmozjs.so
%{progdir}/libxpcom_compat.so
%{progdir}/libxpcom_core.so
%{progdir}/libxpcom.so
%{progdir}/libxpistub.so
%{progdir}/LICENSE
%{progdir}/mozilla-xremote-client
%{progdir}/README.txt
%{progdir}/run-mozilla.sh
%{progdir}/%{progname}
%{progdir}/%{progname}-bin
%exclude %{progdir}/updater
%exclude %{progdir}/updater.ini
%{progdir}/xpicleanup
%{progdir}/dependentlibs.list
%files translations -f %{_tmppath}/translations.list
%defattr(-,root,root)
%changelog