File libqt4-sql-plugins.spec.in of Package libQtWebKit-devel

#
# spec file for package qt-sql-plugins (Version 4.1.3)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild
# nodebuginfo

Name:           libqt4-sql-plugins
BuildRequires:  cups-devel
BuildRequires:  pkgconfig unixODBC-devel libmysqlclient-devel postgresql-devel
BuildRequires:  libqt4-devel
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif
URL:            http://www.trolltech.com
License:        QPL, GPL
Group:          System/Libraries
Autoreqprov:    on
Summary:        Qt 4 SQL related libraries
# COMMON-BEGIN
# COMMON-END

%package -n libqt4-sql-unixODBC
Group:          Development/Libraries/C and C++
Summary:        Qt 4 unixODBC plugin
Requires:       libqt4-sql = %version
Provides:       libqt4_sql_backend  = %version
Obsoletes:      qt-sql-unixODBC
Provides:       qt-sql-unixODBC

%description -n libqt4-sql-unixODBC
Qt unixODBC plugin to support databases via unixODBC within Qt
applications.



Authors:
--------
    Troll Tech AS, Norway

%package -n libqt4-sql-postgresql
Group:          Development/Libraries/C and C++
Summary:        Qt 4 PostgreSQL plugin
Requires:       libqt4-sql = %version
Provides:       libqt4_sql_backend  = %version
Obsoletes:      qt-sql-postgresql
Provides:       qt-sql-postgresql

%description -n libqt4-sql-postgresql
Qt SQL plugin to support PostgreSQL servers in Qt applications.



Authors:
--------
    Troll Tech AS, Norway

%package -n libqt4-sql-mysql
Group:          Development/Libraries/C and C++
Summary:        Qt 4 MySQL support
Requires:       libqt4-sql = %version
Provides:       libqt4_sql_backend  = %version
Obsoletes:      qt-sql-mysql
Provides:       qt-sql-mysql

%description -n libqt4-sql-mysql
A plugin to support MySQL server in Qt applications.



Authors:
--------
    Troll Tech AS, Norway

%build
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 -no-webkit -no-xmlpatterns -nomake examples \
   -plugin-sql-psql -I/usr/include -I/usr/include/pgsql/ -I/usr/include/pgsql/server \
   -plugin-sql-odbc \
   -plugin-sql-mysql -I/usr/include/mysql/ -no-sql-sqlite -no-sql-sqlite2
make %{?jobs:-j%jobs} sub-src

%install
export QTDIR=$PWD
make INSTALL_ROOT=$RPM_BUILD_ROOT -C src install_subtargets
# 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' {} \;
rm -rf $RPM_BUILD_ROOT/usr/include
rm -rf $RPM_BUILD_ROOT/usr/%_lib/pkgconfig
mkdir $RPM_BUILD_ROOT/%_libdir/backup
mv $RPM_BUILD_ROOT/%_libdir/libQtSql*.so.* $RPM_BUILD_ROOT/%_libdir/backup
rm -f $RPM_BUILD_ROOT/%_libdir/lib*
mv $RPM_BUILD_ROOT/%_libdir/backup/libQtSql*.so.* $RPM_BUILD_ROOT/%_libdir
rmdir $RPM_BUILD_ROOT/%_libdir/backup
rm -rf $RPM_BUILD_ROOT/usr/bin
for i in $RPM_BUILD_ROOT/%plugindir/*; do
  case "$i" in
    *sqldriv*): ;;
    *) rm -rf $i
  esac
done
rm -f $RPM_BUILD_ROOT/%_libdir/libQtSql*

%clean
rm -rf $RPM_BUILD_ROOT

%files -n libqt4-sql-unixODBC
%defattr(-,root,root,755)
%dir %plugindir/sqldrivers

%plugindir/sqldrivers/libqsqlodbc*.so

%files -n libqt4-sql-postgresql
%defattr(-,root,root,755)
%dir %plugindir/sqldrivers

%plugindir/sqldrivers/libqsqlpsql*.so

%files -n libqt4-sql-mysql
%defattr(-,root,root,755)
%dir %plugindir/sqldrivers

%plugindir/sqldrivers/libqsqlmysql*.so

%changelog -n libqt4-sql-plugins
openSUSE Build Service is sponsored by