File MozillaFirefox-branding-SLED.spec of Package MozillaFirefox-branding-SLED

#
# spec file for package MozillaFirefox-branding-SLED
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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

BuildRequires:  MozillaFirefox gconf2-devel

Name:           MozillaFirefox-branding-SLED
License:        BSD3c(or similar)
Version:        3.5
Release:        14
Summary:        SLED branding of MozillaFirefox
Group:          Productivity/Networking/Web/Browsers
Source1:        search-addons.tar.bz2
Source2:        bookmarks.html.suse
Source3:        firefox-suse-default-prefs.js
Source4:        firefox.schemas
Source5:        distribution.ini.in
Source6:        %{name}-COPYING
Provides:       MozillaFirefox-branding = %{version}
PreReq:         MozillaFirefox >= 3.5
Conflicts:      otherproviders(MozillaFirefox-branding)
Supplements:    packageand(MozillaFirefox:branding-SLED)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# set the default home page according to bnc#461752
%if %suse_version == 1010
%define sle_version 10
%define default_home_page http://www.novell.com/linux/%{sle_version}.html
%endif
%if %suse_version == 1110
%define sle_version 11
%define default_home_page http://www.novell.com/linux/%{sle_version}
%endif
%define progdir %{_prefix}/%_lib/firefox
%define libgssapi libgssapi_krb5.so.2
%if %suse_version > 1020
%define gnome_confdir %{_sysconfdir}
%gconf_schemas_prereq
%else
PreReq:         gconf2
%define gnome_confdir %{_sysconfdir}/opt/gnome
%define gnome_dir     /opt/gnome
%endif

%description
This package provides SLE Look and Feel for MozillaFirefox.

%prep
cp -a %{SOURCE6} COPYING

%build

%install
install -d $RPM_BUILD_ROOT%{progdir}
# custom bookmarks
install -d $RPM_BUILD_ROOT%{progdir}/defaults/profile
install -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{progdir}/defaults/profile/bookmarks.html
# apply SUSE defaults
install -d $RPM_BUILD_ROOT%{progdir}/defaults/preferences
sed -e 's,GSSAPI,%{libgssapi},g' \
   %{SOURCE3} > suse-default-prefs
install -m0644 suse-default-prefs $RPM_BUILD_ROOT%{progdir}/defaults/preferences/firefox-SLE.js
rm suse-default-prefs
# distribution.ini
install -d $RPM_BUILD_ROOT%{progdir}/distribution
sed -e 's,%VERSION%,%{sle_version},g' \
   %{SOURCE5} > distribution.ini
install -m 0644 distribution.ini $RPM_BUILD_ROOT%{progdir}/distribution/
# search plugins
install -d $RPM_BUILD_ROOT%{progdir}/searchplugins
(cd $RPM_BUILD_ROOT%{progdir}/searchplugins ; tar xjf %{SOURCE1})
# browserconfig.properties
cat << EOF >> suse-browserconfig.properties
browser.startup.homepage=%{default_home_page}
browser.startup.homepage_reset=%{default_home_page}
EOF
install -m0644 suse-browserconfig.properties $RPM_BUILD_ROOT%{progdir}/browserconfig.properties
rm suse-browserconfig.properties
# SCHEMA File
mkdir -p $RPM_BUILD_ROOT%{gnome_confdir}/gconf/schemas
install -m 644 %{SOURCE4} \
               $RPM_BUILD_ROOT%{gnome_confdir}/gconf/schemas/
%if %suse_version > 1020
%find_gconf_schemas
%endif

%clean
rm -rf $RPM_BUILD_ROOT
%if %suse_version > 1020

%pre -f %{name}.schemas_pre

%preun -f %{name}.schemas_preun

%posttrans -f %{name}.schemas_posttrans
%endif
%if %suse_version <= 1020

%post
if [ ! -f /.buildenv ]; then
  export GCONF_CONFIG_SOURCE=`%{gnome_dir}/bin/gconftool-2 --get-default-source`
  %{gnome_dir}/bin/gconftool-2 --makefile-install-rule %{gnome_confdir}/gconf/schemas/firefox.schemas > /dev/null 2>&1
fi
%endif
%if %suse_version > 1020

%files -f %{name}.schemas_list
%defattr(-,root,root)
%else

%files
%defattr(-,root,root)
%{gnome_confdir}/gconf/schemas/firefox.schemas
%endif
%doc COPYING
%dir %{progdir}/defaults/preferences
%{progdir}/defaults/preferences/firefox-SLE.js
%dir %{progdir}/defaults/profile/
%{progdir}/defaults/profile/bookmarks.html
%{progdir}/browserconfig.properties
%{progdir}/searchplugins/*
%{progdir}/distribution/

%changelog
openSUSE Build Service is sponsored by