File of Package libqt4

# spec file for package qt-sql-plugins (Version 4.5.2)
# Copyright (c) 2009 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

# norootforbuild
# nodebuginfo

Name:           libQtWebKit-devel
BuildRequires:  cups-devel freeglut-devel libjpeg-devel libpng-devel
BuildRequires:  libqt4-devel
%if 0%{?suse_version} > 1020
BuildRequires:  fdupes
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
License:        QPL, GPL
Group:          System/Libraries
Autoreqprov:    on
Summary:        Qt 4 SQL related libraries
Requires:       libQtWebKit4 = %(rpm -q --queryformat '%{VERSION}' libqt4-x11)
%requires_eq    libqt4-devel

%package -n libQtWebKit4
Group:          Development/Libraries/C and C++
Summary:        Qt 4 sqlite plugin
Requires:       libqt4-x11 = %version

%description -n libQtWebKit4
Qt 4 sqlite plugin to be able to use database functionality with Qt
applications without the need to setup a SQL server.

    Troll Tech AS, Norway

%package -n qt4-x11-tools
Group:          System/Libraries
Summary:        C++ Program Library, Core Components
Requires:       libqt4-x11 >= %version

%description -n qt4-x11-tools
Qt is a set of libraries for developing applications.

This package contains base tools, like string, xml, and network

    Troll Tech AS, Norway

%package -n libqt4-devel-doc
Group:          Documentation/HTML
Summary:        Qt documentation
Obsoletes:      qt-devel-doc
Provides:       qt-devel-doc
Requires:       %base_name = %version
Requires:       %base_name-devel-doc-data = %version
Requires:       %base_name-sql-sqlite >= %version

%description -n libqt4-devel-doc
The package contains documentation and examples to develop Qt
applications. The SuSE help provides a search function for this
documentation. The package includes also a tutorial and examples.

    Troll Tech AS, Norway

%ifarch ppc64
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mminimal-toc"
export QTDIR=$PWD
export PATH=$PWD/bin:$PATH
export LD_LIBRARY_PATH=$PWD/lib/
sed -i -e "/^QMAKE_CFLAGS_RELEASE[ \t]*+=/s,\$, $RPM_OPT_FLAGS," mkspecs/common/g++.conf
export MAKEFLAGS="%{?jobs:-j %jobs}"
echo yes | ./configure %common_options -webkit -xmlpatterns -no-sql-sqlite -no-sql-sqlite2 -no-sql-mysql
make %{?jobs:-j%jobs} sub-src
make %{?jobs:-j%jobs} -C tools/assistant
make %{?jobs:-j%jobs} -C src/3rdparty/webkit/WebCore
make %{?jobs:-j%jobs} -C src/xmlpatterns
make %{?jobs:-j%jobs} -C demos
make %{?jobs:-j%jobs} -C examples

export QTDIR=$PWD
make INSTALL_ROOT=$RPM_BUILD_ROOT -C tools/assistant install
make INSTALL_ROOT=$RPM_BUILD_ROOT -C src/3rdparty/webkit/WebCore install
make INSTALL_ROOT=$RPM_BUILD_ROOT -C src/xmlpatterns install
make INSTALL_ROOT=$RPM_BUILD_ROOT -C demos install
make INSTALL_ROOT=$RPM_BUILD_ROOT -C examples install
mv $RPM_BUILD_ROOT/%_libdir/qt4/examples/painting/svgviewer/svgviewer $RPM_BUILD_ROOT/%_bindir
mv $RPM_BUILD_ROOT/%_libdir/qt4/demos/browser/browser $RPM_BUILD_ROOT/%_bindir/qt4-browser
ln -s %_bindir/svgviewer $RPM_BUILD_ROOT/%_libdir/qt4/examples/painting/svgviewer/svgviewer
ln -s %_bindir/qt4-browser $RPM_BUILD_ROOT/%_libdir/qt4/demos/browser/browser

# reduce fileconflicts
for f in $(rpm -ql libqt4-devel) $(rpm -ql libqt4-x11) $(rpm -ql libqt4); do
  test -f $RPM_BUILD_ROOT/$f && rm $RPM_BUILD_ROOT/$f
find $RPM_BUILD_ROOT -type d -print0 | xargs -0 --no-run-if-empty rmdir --ignore-fail-on-non-empty

# argggh, qmake is such a piece of <censored>
mkdir -p $RPM_BUILD_ROOT/%_libdir/pkgconfig
find  $RPM_BUILD_ROOT/%_libdir -type f -name '*.pc' -exec mv {} $RPM_BUILD_ROOT/%_libdir/pkgconfig \;
# fix more qmake errors
mkdir -p $RPM_BUILD_ROOT/%_libdir/qt
find $RPM_BUILD_ROOT/%_libdir -type f -name '*la' -print -exec perl -pi -e 's, -L/usr/src/packages/BUILD/\S+,,g' {} \;
find $RPM_BUILD_ROOT/%_libdir/pkgconfig -type f -name '*pc' -print -exec perl -pi -e 's, -L/usr/src/packages/BUILD/\S+,,g' {} \;
mkdir -p $RPM_BUILD_ROOT/%_docdir/%base_name/
ln -s %_libdir/qt4/demos $RPM_BUILD_ROOT/%_docdir/%base_name/demos
ln -s %_libdir/qt4/examples $RPM_BUILD_ROOT/%_docdir/%base_name/examples

# packaged in %name-devel-doc-data
rm -rf $RPM_BUILD_ROOT/%_docdir/%base_name/{doc,html}
rm -f $RPM_BUILD_ROOT/%_libdir/libQt{3,A,C,G,H,N,S,T}*
rm -f $RPM_BUILD_ROOT/%_libdir/libQtXml.*
rm -rf $RPM_BUILD_ROOT/%_libdir/qt4/plugins
rm -rf $RPM_BUILD_ROOT/usr/share/qt4/translations
%if %suse_version > 1020
%fdupes $RPM_BUILD_ROOT/usr/include

%suse_update_desktop_file -i assistant4 Qt Development Documentation

# no baselibs supplements for older distros
%if %suse_version < 1110
  sed -i -e 's, supplements .*,,' $RPM_SOURCE_DIR/baselibs.conf

%if %suse_version > 910

%post -n libQtWebKit4 -p /sbin/ldconfig

%postun -n libQtWebKit4 -p /sbin/ldconfig

%if %suse_version > 910
%files -n libQtWebKit4


%files -n libqt4-devel-doc
%if %suse_version > 910
%dir %_docdir/%base_name

%files -n qt4-x11-tools

openSUSE Build Service is sponsored by