A new user interface for you!

File qtwebkit.spec of Package qtwebkit

%bcond_with qt4_import

Name: qtwebkit
Version: 2.0
Release: 3%{?dist}
Summary: Qt WebKit bindings
Group: System Environment/Libraries
License: LGPLv2 with exceptions or GPLv3 with exceptions
URL: http://trac.webkit.org/wiki/QtWebKit
## start with, http://gitorious.org/webkit/qtwebkit/archive-tarball/460b651c
Source0: qtwebkit-2.0-460b651c.tar.xz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

# debian/kubuntu patches
Patch0: 0001_fix_symbols_visibility_for_webcore.diff
Patch1: 01_lflags_as-needed.diff
Patch2: 02_add_nostrip_for_debug_packages.diff
Patch3: 03_hide_std_symbols.diff
Patch4: 04_enable_debug_information.diff
Patch5: 05_sparc_unaligned_access.diff
Patch6: 06_kfreebsd_strnstr.diff
Patch7: 07_s390_stabs_format_debugging_information.diff
Patch8: 08_powerpc_s390_no_gc_sections.diff
Patch9: webkit-qtwebkit-2.0-shared.patch
Patch20: kubuntu_01_phonon.diff

BuildRequires: bison
BuildRequires: chrpath
BuildRequires: flex
BuildRequires: gperf
BuildRequires: libicu-devel
BuildRequires: pcre-devel
BuildRequires: phonon-devel
BuildRequires: qt4-devel
BuildRequires: sqlite-devel

BuildRequires: cpp
BuildRequires: gcc-c++
BuildRequires: make

Requires: qt4%{?_isa} >= %{_qt4_version}
%global phonon_ver %(pkg-config --modversion phonon 2>/dev/null || echo 4.4.3)
Requires: phonon%{?_isa} >= %{phonon_ver}

Obsoletes: qt-webkit < 2:4.7.1
Obsoletes: WebKit-qt < 1.0.0-1
Provides: WebKit-qt = 1.0.0-1


%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: qt4-devel
Provides: qt4-webkit-devel = %{version}-%{release}
Provides: qt4-webkit-devel%{?_isa} = %{version}-%{release}
Obsoletes: qt-webkit-devel < 2:4.7.1
Obsoletes: WebKit-qt-devel < 1.0.0-1
Provides:  WebKit-qt-devel = 1.0.0-1

%description devel

%setup -q -n webkit-qtwebkit 

%patch0 -p1 -b 0001_fix_symbols_visibility_for_webcore
%patch1 -p1 -b .01_lflags_as-needed
%patch2 -p1 -b .02_add_nostrip_for_debug_packages
%patch3 -p1 -b .03_hide_std_symbols
%patch4 -p1 -b .04_enable_debug_information
%patch9 -p1 -b .shared

%patch20 -p1 -b .kubuntu_01_phonon

# hack around lame build script that insists this be present
mkdir WebKitLibraries


PATH=%{_qt4_bindir}:$PATH; export PATH
QTDIR=%{_qt4_prefix}; export QTDIR

WebKitTools/Scripts/build-webkit --qmake=%{_qt4_qmake} --qt --release --makeargs="%{?_smp_mflags}"

rm -rf %{buildroot} 

make install INSTALL_ROOT=%{buildroot} -C WebKitBuild/Release

## HACK, there has to be a better way
chrpath ---list %{buildroot}%{_qt4_libdir}/libQtWebKit.so.4.7.0 || \
  chrpath --delete %{buildroot}%{_qt4_libdir}/libQtWebKit.so.4.7.0

rm -rf %{buildroot} 

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files devel

* Thu Jan 20 2011 Paulo Roma <roma@lcg.ufrj.br> - 2.0-3
- added %%bcond_with qt4_import

* Mon Nov 08 2010 Than Ngo <than@redhat.com> - 2.0-2
- fix webkit to export symbol correctly

* Tue Nov 02 2010 Rex Dieter <rdieter@fedoraproject.org> 2.0-1
- 2.0 (as released with qt-4.7.0)

* Thu Sep 09 2010 Rex Dieter <rdieter@fedoraproject.org> 2.0-0.1.week32
- first try, borrowing a lot from debian/kubuntu packaging