File MozillaSunbird.spec of Package MozillaSunbird
#
# spec file for package MozillaSunbird (Version 0.9.99)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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/
#
# norootforbuild
%define xulrunner mozilla-xulrunner191
Name: MozillaSunbird
BuildRequires: autoconf213 fdupes gcc-c++ libgnomeui-devel mozilla-nss-devel python startup-notification-devel unzip update-desktop-files zip
%if %suse_version > 1100
BuildRequires: nss-shared-helper-devel
%endif
%if 0%{?xulrunner:1}
BuildRequires: %xulrunner-devel
%endif
License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Version: 0.9.99
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: %{name}-rpmlintrc
Source4: create-tar.sh
Source5: find-external-requires.sh
Source6: suse-default-prefs.js
Patch1: mozilla-installdir.patch
Patch2: sunbird-shared-nssdb.patch
Patch3: sunbird-system-proxy.patch
Patch4: sunbird-libxul-sdk.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: mozilla-nspr >= %(rpm -q --queryformat '%{VERSION}' mozilla-nspr)
Requires: mozilla-nss >= %(rpm -q --queryformat '%{VERSION}' mozilla-nss)
%if 0%{?xulrunner:1}
Requires: %xulrunner
%endif
%define releasedate 2009122200
%define progname sunbird
%define progdir %{_libdir}/%{progname}
%define lightning 1
%define _use_internal_dependency_generator 0
%define __find_requires sh %{SOURCE5}
%global provfind sh -c "grep -v '.so' | %__find_provides"
%global __find_provides %provfind
%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.
%package translations
License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary: Translations for Mozilla Sunbird
Provides: locale(%{name}:ca;cs;da;de;es_AR;es_ES;et;eu;gl;fr;fy_NL;ga_IE;id;he;hu;is;it;ja;ka;ko;lt;nb_NO;nl;nn_NO;pa_IN;pl;pt-BR;pt_PT;ro;ru;si;sk;ta_LK;tr;vi;zh_CN)
Group: System/Localization
PreReq: %{name} = %{version}
%description translations
This package contains several optional languages for Sunbird.
%if %lightning
%package -n lightning
License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Summary: Calendar extension for SeaMonkey and Thunderbird
Group: Productivity/Office/Organizers
%description -n lightning
Addon for SeaMonkey and Thunderbird to provide calendaring functionality.
%endif
%prep
%setup -n sunbird -b 2 -q
pushd mozilla
%patch1 -p1
popd
#%patch2
#%patch3 -p1 #disabled because of l10n impact
%patch4 -p1
%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"
%if 0%{?xulrunner:1}
SDKDIR=$(pkg-config --variable=sdkdir libxul)
%endif
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}
mk_add_options MOZ_MILESTONE_RELEASE=1
ac_add_options --enable-application=calendar
ac_add_options --enable-calendar
ac_add_options --prefix=%{_prefix}
ac_add_options --libdir=%{_libdir}
ac_add_options --enable-optimize
ac_add_options --disable-tests
ac_add_options --disable-installer
ac_add_options --disable-updater
ac_add_options --disable-crashreporter
ac_add_options --disable-ogg
ac_add_options --enable-startup-notification
ac_add_options --enable-official-branding
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
#ac_add_options --enable-debug
ac_add_options --with-l10n-base=../l10n
EOF
%if 0%{?xulrunner:1}
cat << EOF >> $MOZCONFIG
ac_add_options --with-libxul-sdk=$SDKDIR
EOF
%else
cat << EOF >> $MOZCONFIG
ac_add_options --enable-static
ac_add_options --disable-shared
EOF
%endif
%if %suse_version > 1110
cat << EOF >> $MOZCONFIG
ac_add_options --enable-system-cairo
EOF
%endif
make -f client.mk build
%install
make -C calendar/installer STRIP=/bin/true
# copy tree into RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{progdir}
cp -rf $RPM_BUILD_DIR/sunbird/mozilla/dist/%{progname}/* \
$RPM_BUILD_ROOT%{progdir}
%if 0%{?xulrunner:1}
cp %{SOURCE6} $RPM_BUILD_ROOT%{progdir}/defaults/preferences/all-opensuse.js
%else
cp %{SOURCE6} $RPM_BUILD_ROOT%{progdir}/defaults/pref/all-opensuse.js
%endif
# install additional locales
rm -f %{_tmppath}/translations.*
for locale in $(awk '{ print $1; }' calendar/locales/shipped-locales); do
case $locale in
ja-JP-mac|en-US)
# locales not to be included in translations package
;;
*)
make -C calendar/locales libs-$locale || continue
%if %lightning
make -C calendar/lightning/locales AB_CD=$locale XPI_NAME=locale-$locale || continue
%endif
cp mozilla/dist/xpi-stage/locale-$locale/chrome/$locale.jar \
mozilla/dist/xpi-stage/locale-$locale/chrome/calendar-$locale.jar \
mozilla/dist/xpi-stage/locale-$locale/chrome/sunbird-$locale.jar \
$RPM_BUILD_ROOT/%{progdir}/chrome
cp mozilla/dist/xpi-stage/locale-$locale/chrome/$locale.manifest \
mozilla/dist/xpi-stage/locale-$locale/chrome/calendar-$locale.manifest \
mozilla/dist/xpi-stage/locale-$locale/chrome/sunbird-$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
echo %{progdir}/chrome/sunbird-$locale.jar >> %{_tmppath}/translations.list
echo %{progdir}/chrome/sunbird-$locale.manifest >> %{_tmppath}/translations.list
esac
done
# link startscript
mkdir --parents $RPM_BUILD_ROOT%{_bindir}/
ln -s %{_libdir}/%{progname}/%{progname} $RPM_BUILD_ROOT%{_bindir}/
# 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/mozicon128.png $RPM_BUILD_ROOT/usr/share/pixmaps/%{progname}.png
%suse_update_desktop_file %{progname} Office Calendar GTK
# remove spurious executable bits
find $RPM_BUILD_ROOT%{_libdir}/sunbird -name "*.js" -o -name "*.xpm" -o -name "*.png" | xargs chmod a-x
# Lightning
%if %lightning
_tbaddondir=$RPM_BUILD_ROOT%{_libdir}/mozilla/extensions/\{3550f703-e582-4d05-9a08-453d09bdfdc6\}
_smaddondir=$RPM_BUILD_ROOT%{_libdir}/mozilla/extensions/\{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a\}
mkdir -p $_tbaddondir/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}
mkdir -p $_smaddondir
cp -rL mozilla/dist/xpi-stage/lightning/* \
$_tbaddondir/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}
(cd $_smaddondir ; \
ln -s ../\{3550f703-e582-4d05-9a08-453d09bdfdc6\}/\{e2fda1a4-762b-4020-b5ad-a41df1933103\} )
find $RPM_BUILD_ROOT%{_libdir}/mozilla -name "*.js" -o -name "*.xpm" -o -name "*.png" -o -name "*.sqlite" | xargs chmod a-x
cp mozilla/dist/xpi-stage/locale-*/chrome/calendar-* \
mozilla/dist/xpi-stage/locale-*/chrome/lightning-* \
$_tbaddondir/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/chrome/
%fdupes $RPM_BUILD_ROOT%{_libdir}/mozilla
%endif
# fdupes
%fdupes $RPM_BUILD_ROOT%{progdir}
%fdupes $RPM_BUILD_ROOT%{_datadir}
# remove unneeded stuff
rm $RPM_BUILD_ROOT%{progdir}/removed-files
rm -rf $RPM_BUILD_ROOT%{progdir}/dictionaries
rm -rf $RPM_BUILD_ROOT%{progdir}/plugins
rm -r $RPM_BUILD_ROOT%{progdir}/LICENSE
rm -r $RPM_BUILD_ROOT%{progdir}/README.txt
%if 0%{?xulrunner:1}
rm $RPM_BUILD_ROOT%{progdir}/run-mozilla.sh
%endif
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{_tmppath}/translations.*
%files
%defattr(-,root,root)
%{_bindir}/%{progname}
%attr(644,root,root) %{_datadir}/pixmaps/%{progname}.png
%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/en-US.*
%{progdir}/chrome/sunbird-en-US.*
%{progdir}/chrome/sunbird.*
%{progdir}/calendar-js/
%{progdir}/components/
%{progdir}/defaults/
%{progdir}/extensions/
%{progdir}/modules/
%{progdir}/application.ini
%{progdir}/%{progname}
%if ! 0%{?xulrunner:1}
%{progdir}/chrome/classic.*
%{progdir}/chrome/comm.*
%{progdir}/chrome/pippki.*
%{progdir}/chrome/toolkit.*
%{progdir}/greprefs/
%{progdir}/res/
%{progdir}/dependentlibs.list
%{progdir}/libmozjs.so
%{progdir}/libsqlite3.so
%{progdir}/libxpcom_core.so
%{progdir}/libxpcom.so
%{progdir}/mozilla-xremote-client
%{progdir}/run-mozilla.sh
%{progdir}/%{progname}-bin
%{progdir}/platform.ini
%endif
%files translations -f %{_tmppath}/translations.list
%defattr(-,root,root)
%if %lightning
%files -n lightning
%defattr(-,root,root)
%{_libdir}/mozilla/
%endif
%changelog