470 lines
16 KiB
RPMSpec
470 lines
16 KiB
RPMSpec
#
|
|
# spec file for package chromium
|
|
#
|
|
# Copyright (c) 2012 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/
|
|
#
|
|
|
|
|
|
%define svn_revision 174615M
|
|
|
|
Name: chromium
|
|
Version: 26.0.1371.0
|
|
Release: 0
|
|
Summary: Google's opens source browser project
|
|
License: BSD-3-Clause and LGPL-2.1+
|
|
Group: Productivity/Networking/Web/Browsers
|
|
Url: http://code.google.com/p/chromium/
|
|
Source0: %{name}.%{version}.svn%{svn_revision}.tar.bz2
|
|
%if 0%{?suse_version} == 1140
|
|
Source1: %{name}.easy
|
|
Source2: %{name}-rpmlintrc
|
|
%endif
|
|
Source20: chromium-vendor.patch.in
|
|
Source30: master_preferences
|
|
Source31: default_bookmarks.html
|
|
Source99: chrome-wrapper
|
|
Source100: chromium-browser.sh
|
|
Source101: chromium-browser.desktop
|
|
Source102: chromium-browser.xml
|
|
Source103: chromium.default
|
|
Source104: chromium-icons.tar.bz2
|
|
Provides: chromium-based-browser = %{version}
|
|
Provides: chromium-browser = %{version}
|
|
Provides: browser(npapi)
|
|
Obsoletes: chromium-browser < %{version}
|
|
# There is no v8 for ppc and thus chromium won't run on ppc
|
|
ExcludeArch: ppc ppc64
|
|
|
|
## Start Patches
|
|
# Many changes to the gyp systems so we can use system libraries
|
|
# PATCH-FIX-OPENSUSE Test sources have been removed to shrink the tarball
|
|
Patch1: chromium-23.0.1245-no-test-sources.patch
|
|
# PATCH-FIX-OPENSUSE removes build part for courgette
|
|
Patch13: chromium-no-courgette.patch
|
|
# PATCH-FIX-OPENSUSE enables reading of the master preference
|
|
Patch14: chromium-master-prefs-path.patch
|
|
# PATCH-FIX-OPENSUSE Fix some includes specifically for the GCC version used
|
|
Patch20: chromium-gcc-fixes.patch
|
|
# PATCH-FIX-OPENSUSE remove the rpath in the libraries
|
|
Patch62: chromium-norpath.patch
|
|
# PATCH-FIX-UPSTREAM Add more charset aliases
|
|
Patch64: chromium-more-codec-aliases.patch
|
|
# PATCH-FIX-OPENSUSE Compile the sandbox with -fPIE settings
|
|
Patch66: chromium-sandbox-pie.patch
|
|
# PATCH-FIX-OPENSUSE Compile with the standard gold linker
|
|
Patch67: chromium_use_gold.patch
|
|
# PATCH-FIX-OPENSUSE Fix build with glibc 2.16
|
|
Patch69: chromium-siginfo.patch
|
|
|
|
BuildRequires: Mesa-devel
|
|
BuildRequires: alsa-devel
|
|
BuildRequires: binutils-gold
|
|
BuildRequires: bison
|
|
BuildRequires: cups-devel
|
|
BuildRequires: desktop-file-utils
|
|
BuildRequires: fdupes
|
|
BuildRequires: flex
|
|
BuildRequires: freetype2-devel
|
|
BuildRequires: gcc
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: gperf
|
|
BuildRequires: hunspell-devel
|
|
BuildRequires: krb5-devel
|
|
BuildRequires: libgnutls-devel
|
|
BuildRequires: libspeechd-devel
|
|
BuildRequires: libstdc++-devel
|
|
BuildRequires: lzma
|
|
BuildRequires: mozilla-nspr-devel
|
|
BuildRequires: mozilla-nss-devel
|
|
BuildRequires: pam-devel
|
|
BuildRequires: pkg-config
|
|
BuildRequires: subversion
|
|
%if 0%{?suse_version} > 1210
|
|
BuildRequires: perl-Switch
|
|
%else
|
|
BuildRequires: perl(Switch)
|
|
%endif
|
|
BuildRequires: dbus-1-glib-devel
|
|
BuildRequires: hicolor-icon-theme
|
|
BuildRequires: libbz2-devel
|
|
BuildRequires: libelf-devel
|
|
BuildRequires: libexpat-devel
|
|
BuildRequires: libgcrypt-devel
|
|
BuildRequires: libgnome-keyring-devel
|
|
BuildRequires: libicu-devel >= 4.0
|
|
BuildRequires: libpulse-devel
|
|
BuildRequires: pciutils-devel
|
|
BuildRequires: python
|
|
BuildRequires: python-devel
|
|
BuildRequires: python-xml
|
|
BuildRequires: sqlite3-devel
|
|
BuildRequires: update-desktop-files
|
|
BuildRequires: wdiff
|
|
BuildRequires: pkgconfig(cairo) >= 1.6
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
BuildRequires: pkgconfig(gconf-2.0)
|
|
BuildRequires: pkgconfig(glib-2.0)
|
|
BuildRequires: pkgconfig(gtk+-2.0)
|
|
BuildRequires: pkgconfig(webkit-1.0)
|
|
BuildRequires: pkgconfig(x11)
|
|
BuildRequires: pkgconfig(xcomposite)
|
|
BuildRequires: pkgconfig(xcursor)
|
|
BuildRequires: pkgconfig(xext)
|
|
BuildRequires: pkgconfig(xfixes)
|
|
BuildRequires: pkgconfig(xi)
|
|
BuildRequires: pkgconfig(xrandr)
|
|
BuildRequires: pkgconfig(xrender)
|
|
BuildRequires: pkgconfig(xscrnsaver)
|
|
BuildRequires: pkgconfig(xt)
|
|
%if 0%{?suse_version} < 1210
|
|
BuildRequires: libudev-devel
|
|
%endif
|
|
# For NaCl
|
|
%ifarch x86_64
|
|
BuildRequires: gcc-c++-32bit
|
|
BuildRequires: glibc-32bit
|
|
%endif
|
|
|
|
Requires: alsa
|
|
Requires: ffmpegsumo
|
|
Requires: hicolor-icon-theme
|
|
Requires: update-alternatives
|
|
Requires: xdg-utils
|
|
|
|
Requires(pre): permissions
|
|
|
|
Recommends: Chromium-password = %{version}
|
|
Requires: %{name}-suid-helper = %{version}
|
|
|
|
# Recommends the chromium-ffmpeg library (available from packman)
|
|
Recommends: chromium-ffmpeg = %{version}
|
|
|
|
%description
|
|
Chromium is the open-source project behind Google Chrome. We invite you to join us in our effort to help build a safer, faster, and more stable way for all Internet users to experience the web, and to create a powerful platform for developing a new generation of web applications.
|
|
|
|
%package ffmpegsumo
|
|
Summary: Library to provide ffmpeg support to Chromium
|
|
License: BSD-3-Clause and LGPL-2.1+
|
|
Group: Productivity/Networking/Web/Browsers
|
|
Provides: ffmpegsumo
|
|
Conflicts: chromium-ffmpeg
|
|
|
|
%description ffmpegsumo
|
|
The is the multimedia codec library for Chromium. It is based on the internal ffmpeg source code and contains only the open source codecs from ffmpeg. Proprietary codecs (e.g. H.264) are not part of this library, but are provided in an external package
|
|
|
|
%package desktop-kde
|
|
|
|
Summary: Update to chromium to use KDE's kwallet to store passwords
|
|
License: BSD-3-Clause and LGPL-2.1+
|
|
Group: Productivity/Networking/Web/Browsers
|
|
Supplements: packageand(chromium:kdebase4-session)
|
|
Conflicts: chromium-desktop-gnome
|
|
Provides: Chromium-password = %{version}
|
|
Requires(post): chromium = %{version}
|
|
|
|
%description desktop-kde
|
|
By using the openSUSE update-alternatives the password store for Chromium is changed to utilize
|
|
KDE's kwallet. Please be aware that by this change the old password are no longer accessible and
|
|
are also not converted to kwallet.
|
|
|
|
%package desktop-gnome
|
|
|
|
Summary: Update to chromium to use Gnome keyring to store passwords
|
|
License: BSD-3-Clause and LGPL-2.1+
|
|
Group: Productivity/Networking/Web/Browsers
|
|
Supplements: packageand(chromium:gnome-session)
|
|
Conflicts: chromium-desktop-kde
|
|
Provides: Chromium-password = %{version}
|
|
Requires(post): chromium = %{version}
|
|
Requires: libgnome
|
|
|
|
%description desktop-gnome
|
|
By using the openSUSE update-alternatives the password store for Chromium is changed to utilize
|
|
Gnome's Keyring. Please be aware that by this change the old password are no longer accessible and
|
|
are also not converted to Gnome's Keyring.
|
|
|
|
%package suid-helper
|
|
|
|
Summary: A suid helper to let a process willingly drop privileges on Linux
|
|
License: BSD-3-Clause and LGPL-2.1+
|
|
Group: Productivity/Networking/Web/Browsers
|
|
Url: http://code.google.com/p/setuid-sandbox/
|
|
Requires(pre): permissions
|
|
|
|
%description suid-helper
|
|
t will allow a process to execute a target executable that will be able to drop privileges:
|
|
|
|
* The suid sandbox will create a new PID namespace or will switch uid/gid to isolate the process
|
|
* a helper process, sharing the filesystem view of the existing process, will be created. It
|
|
will accept a request to chroot() the process to an empty directory
|
|
|
|
This is convenient because an executable can be launched, load libraries and open files and get
|
|
chroot()-ed to an empty directory when it wants to drop filesystem access.
|
|
|
|
%package -n chromedriver
|
|
|
|
Summary: WebDriver for Google Chrome/Chromium
|
|
License: BSD-3-Clause
|
|
Group: Development/Tools/Other
|
|
Url: http://code.google.com/p/chromedriver/
|
|
|
|
%description -n chromedriver
|
|
WebDriver is an open source tool for automated testing of webapps across many browsers. It provides capabilities for navigating to web pages, user input, JavaScript execution, and more. ChromeDriver is a standalone server which implements WebDriver's wire protocol for Chromium. It is being developed by members of the Chromium and WebDriver teams.
|
|
|
|
%prep
|
|
%setup -q -n %{name}
|
|
|
|
%patch1 -p1
|
|
%patch62 -p1
|
|
%patch64
|
|
%patch13 -p1
|
|
%patch14 -p1
|
|
%patch20 -p1
|
|
%patch66 -p1
|
|
%patch67 -p1
|
|
%patch69 -p1
|
|
|
|
echo "svn%{svn_revision}" > src/build/LASTCHANGE.in
|
|
|
|
# apply vendor patch after substitution
|
|
sed "s:RPM_VERSION:%{version}:" %{SOURCE20} | patch -p0
|
|
|
|
# Make sure that the requires legal files can be found
|
|
cp -a src/AUTHORS src/LICENSE .
|
|
|
|
%build
|
|
|
|
## create make files
|
|
|
|
PARSED_OPT_FLAGS=`echo \'%{optflags} -fPIC -fno-ipa-cp -fno-strict-aliasing \' | sed "s/ /',/g" | sed "s/',/', '/g"`
|
|
for i in src/build/common.gypi; do
|
|
sed -i "s|'-march=pentium4',||g" $i
|
|
%ifnarch x86_64
|
|
sed -i "s|'-mfpmath=sse',||g" $i
|
|
%endif
|
|
sed -i "s|'-O<(debug_optimize)',||g" $i
|
|
sed -i "s|'-m32',||g" $i
|
|
sed -i "s|'-fno-exceptions',|$PARSED_OPT_FLAGS|g" $i
|
|
sed -i "s|'-Werror'|'-Wno-error'|g" $i
|
|
done
|
|
# '
|
|
|
|
pushd src
|
|
|
|
./build/gyp_chromium -f make build/all.gyp \
|
|
-Dlinux_sandbox_path=%{_prefix}/lib/chrome_sandbox \
|
|
-Dlinux_sandbox_chrome_path=%{_libdir}/chromium/chromium \
|
|
-Duse_openssl=0 \
|
|
-Dbuild_ffmpegsumo=1 \
|
|
-Dremove_webcore_debug_symbols=1 \
|
|
-Dproprietary_codecs=1 \
|
|
-Dlinux_fpic=1 \
|
|
%ifnarch x86_64
|
|
-Ddisable_sse2=1 \
|
|
%endif
|
|
%ifarch x86_64
|
|
-Dtarget_arch=x64 \
|
|
%endif
|
|
%if 0%{?suse_version} == 1140
|
|
%ifnarch x86_64
|
|
-Dlinux_use_gold_flags=0 \
|
|
-Dlinux_use_gold_binary=0 \
|
|
%else
|
|
-Dlinux_use_gold_flags=1 \
|
|
-Dlinux_use_gold_binary=1 \
|
|
%endif
|
|
%else
|
|
-Dlinux_use_gold_flags=1 \
|
|
-Dlinux_use_gold_binary=1 \
|
|
%endif
|
|
-Djavascript_engine=v8
|
|
|
|
make -r %{?_smp_mflags} chrome V=1 BUILDTYPE=Release
|
|
|
|
# Build the required SUID_SANDBOX helper
|
|
make -r %{?_smp_mflags} chrome_sandbox V=1 BUILDTYPE=Release
|
|
|
|
# Build the ChromeDriver test suite
|
|
make -r %{?_smp_mflags} chromedriver V=1 BUILDTYPE=Release
|
|
|
|
popd
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{_libdir}/chromium/
|
|
%ifarch x86_64
|
|
mkdir -p %{buildroot}%{_prefix}/lib/
|
|
%endif
|
|
install -m 755 %{SOURCE100} %{buildroot}%{_libdir}/chromium/chromium-generic
|
|
# x86_64 capable systems need this
|
|
sed -i "s|/usr/lib/chromium|%{_libdir}/chromium|g" %{buildroot}%{_libdir}/chromium/chromium-generic
|
|
|
|
%if 0%{?suse_version} == 1140
|
|
# Set the permissions file for distro version equal or lower than 11.4. (bnc#718016)
|
|
mkdir -p %{buildroot}%{_sysconfdir}/permissions.d
|
|
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/permissions.d/chromium
|
|
%endif
|
|
|
|
#update the password-store settings for each alternative
|
|
sed "s|password-store=detect|password-store=kwallet|g" %{buildroot}%{_libdir}/chromium/chromium-generic > %{buildroot}%{_libdir}/chromium/chromium-kde
|
|
sed "s|password-store=detect|password-store=gnome|g" %{buildroot}%{_libdir}/chromium/chromium-generic > %{buildroot}%{_libdir}/chromium/chromium-gnome
|
|
mkdir -p %{buildroot}%{_mandir}/man1/
|
|
pushd src/out/Release
|
|
|
|
# Install the file /etc/default/chromium which defines the chromium flags
|
|
mkdir -p %{buildroot}%{_sysconfdir}/default
|
|
install -m 644 %{SOURCE103} %{buildroot}%{_sysconfdir}/default/chromium
|
|
|
|
cp -a chrome_sandbox %{buildroot}%{_prefix}/lib/
|
|
cp -a *.pak locales xdg-mime %{buildroot}%{_libdir}/chromium/
|
|
cp -a chromedriver %{buildroot}%{_libdir}/chromium/
|
|
|
|
# Patch xdg-settings to use the chromium version of xdg-mime as that the system one is not KDE4 compatible
|
|
sed "s|xdg-mime|%{_libdir}/chromium/xdg-mime|g" xdg-settings > %{buildroot}%{_libdir}/chromium/xdg-settings
|
|
|
|
cp -a resources.pak %{buildroot}%{_libdir}/chromium/
|
|
cp -a chrome %{buildroot}%{_libdir}/chromium/chromium
|
|
cp -a chrome.1 %{buildroot}%{_mandir}/man1/chrome.1
|
|
cp -a chrome.1 %{buildroot}%{_mandir}/man1/chromium.1
|
|
%fdupes %{buildroot}%{_mandir}/man1/
|
|
|
|
# NaCl
|
|
cp -a nacl_helper %{buildroot}%{_libdir}/chromium/
|
|
cp -a nacl_helper_bootstrap %{buildroot}%{_libdir}/chromium/
|
|
cp -a nacl_irt_*.nexe %{buildroot}%{_libdir}/chromium/
|
|
cp -a libppGoogleNaClPluginChrome.so %{buildroot}%{_libdir}/chromium/
|
|
|
|
#libffmpegsumo
|
|
cp -a libffmpegsumo.so %{buildroot}%{_libdir}/chromium/
|
|
popd
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/icons/
|
|
pushd %{buildroot}%{_datadir}/icons/
|
|
tar -xjf %{SOURCE104}
|
|
mv oxygen hicolor
|
|
popd
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/applications/
|
|
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE101}
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/gnome-control-center/default-apps/
|
|
cp -a %{SOURCE102} %{buildroot}%{_datadir}/gnome-control-center/default-apps/
|
|
|
|
# link to browser plugin path. Plugin patch doesn't work. Why?
|
|
mkdir -p %{buildroot}%{_libdir}/browser-plugins
|
|
pushd %{buildroot}%{_libdir}/%{name}
|
|
ln -s %{_libdir}/browser-plugins plugins
|
|
|
|
# Install the master_preferences file
|
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
|
|
install -m 0644 %{SOURCE30} %{buildroot}%{_sysconfdir}/%{name}
|
|
install -m 0644 %{SOURCE31} %{buildroot}%{_sysconfdir}/%{name}
|
|
|
|
%clean
|
|
rm -rf %{buildroot}
|
|
|
|
%pre
|
|
if [ -f %{_bindir}/chromium -a ! -L %{_bindir}/chromium ] ; then rm -f %{_bindir}/chromium
|
|
fi
|
|
|
|
# Add snipplets to update the GTK cache on package install.
|
|
|
|
%verifyscript suid-helper
|
|
%verify_permissions -e %{_prefix}/lib/chrome_sandbox
|
|
|
|
%post suid-helper
|
|
%set_permissions %{_prefix}/lib/chrome_sandbox
|
|
|
|
%post
|
|
%icon_theme_cache_post
|
|
%desktop_database_post
|
|
update-alternatives --install %{_bindir}/chromium chromium %{_libdir}/chromium/chromium-generic 10
|
|
|
|
%postun
|
|
%icon_theme_cache_postun
|
|
%desktop_database_postun
|
|
if [ $1 -eq 0 ]; then
|
|
update-alternatives --remove-all chromium
|
|
fi
|
|
|
|
%post desktop-kde
|
|
if [ ! -e /.buildenv ]; then
|
|
update-alternatives --install %{_bindir}/chromium chromium %{_libdir}/chromium/chromium-kde 15
|
|
update-alternatives --auto chromium
|
|
fi
|
|
|
|
%postun desktop-kde
|
|
if [ $1 -eq 0 -a ! -e /.buildenv ]; then
|
|
update-alternatives --remove chromium %{_libdir}/chromium/chromium-kde
|
|
update-alternatives --auto chromium
|
|
fi
|
|
|
|
%post desktop-gnome
|
|
if [ ! -e /.buildenv ]; then
|
|
update-alternatives --install %{_bindir}/chromium chromium %{_libdir}/chromium/chromium-gnome 15
|
|
update-alternatives --auto chromium
|
|
fi
|
|
|
|
%postun desktop-gnome
|
|
if [ $1 -eq 0 -a ! -e /.buildenv ]; then
|
|
update-alternatives --remove chromium %{_libdir}/chromium/chromium-gnome
|
|
update-alternatives --auto chromium
|
|
fi
|
|
|
|
# Files!
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc AUTHORS LICENSE
|
|
%config %{_sysconfdir}/%{name}
|
|
%config %{_sysconfdir}/default/chromium
|
|
%dir %{_datadir}/gnome-control-center
|
|
%dir %{_datadir}/gnome-control-center/default-apps
|
|
%dir %{_libdir}/chromium/
|
|
%{_libdir}/chromium/chromium
|
|
%{_libdir}/chromium/chromium-generic
|
|
%{_libdir}/chromium/plugins/
|
|
%{_libdir}/chromium/locales/
|
|
%{_libdir}/chromium/nacl_*
|
|
%{_libdir}/chromium/libppGoogleNaClPluginChrome.so
|
|
%attr(755,root,root) %{_libdir}/chromium/xdg-settings
|
|
%attr(755,root,root) %{_libdir}/chromium/xdg-mime
|
|
%{_libdir}/chromium/*.pak
|
|
%{_mandir}/man1/chrom*
|
|
%{_datadir}/applications/*.desktop
|
|
%{_datadir}/gnome-control-center/default-apps/chromium-browser.xml
|
|
%{_datadir}/icons/hicolor/
|
|
|
|
%files ffmpegsumo
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/chromium/libffmpegsumo.so
|
|
|
|
%files desktop-kde
|
|
%attr(755, root, root) %{_libdir}/chromium/chromium-kde
|
|
|
|
%files desktop-gnome
|
|
%attr(755, root, root) %{_libdir}/chromium/chromium-gnome
|
|
|
|
%files suid-helper
|
|
%defattr(-,root,root,-)
|
|
%if 0%{?suse_version} == 1140
|
|
%config %{_sysconfdir}/permissions.d/chromium
|
|
%endif
|
|
%verify(not mode) %{_prefix}/lib/chrome_sandbox
|
|
|
|
%files -n chromedriver
|
|
%defattr(-,root,root,-)
|
|
%{_libdir}/chromium/chromedriver
|
|
|
|
%changelog
|