File libqt4-sql-plugins.spec of Package libqt4

#
# 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 freeglut-devel freetype2-devel gcc-c++ libjpeg-devel libpng-devel mysql-devel pkgconfig postgresql-devel sqlite-devel unixODBC-devel libqt4
%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-BEGIN
Version:        4.2.90
Release:        1
%define x11_free  -x11-opensource-src-
%define rversion 4.3.0beta
Source:         qt%x11_free%rversion.tar.bz2
Source10:       qt4config.desktop
Source11:       designer4.desktop
Source12:       linguist4.desktop
Source13:       assistant4.desktop
Patch2:         qt-never-strip.diff
Patch3:         plastik-default.diff
Patch5:         lib64.patch
Patch6:         use-freetype-default.diff
Patch18:        fix-string-literal-comparison.diff
Patch20:        qt-font-choose.diff
Patch21:        0142-uic3-wordWrapAttribute.diff
Patch24:        qt4-pedantic-headers.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define common_options -fast -no-separate-debug-info -shared -xkb -tablet -xrender -xrandr -xinerama -xshape -sm -no-nas-sound -no-rpath -system-libjpeg -system-libpng -accessibility -cups -stl -nis -system-zlib -qt-gif -prefix /usr -L %_libdir -libdir %_libdir -docdir %_docdir/libqt4 -examplesdir %_docdir/libqt4/examples -demosdir %_libdir/qt4/demos -plugindir %plugindir -translationdir /usr/share/qt4/translations -iconv -sysconfdir /etc/settings -datadir /usr/share/qt4/ -no-pch

%description
Qt is a set of libraries for developing applications.

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



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

%prep
%define plugindir %_libdir/qt4/plugins
%setup -q -n qt%x11_free%rversion
%patch2
%patch3
%patch5
%patch6
%patch18
%patch20
%patch21
%patch24
# be sure not to use them
rm -rf src/3rdparty/{libjpeg,freetype,libpng,zlib}
# COMMON-END
# COMMON-END

%package -n libqt4-sql-sqlite
Group:          Development/Libraries/C and C++
Summary:        Qt 4 sqlite plugin
Obsoletes:      qt-sql-sqlite
Provides:       qt-sql-sqlite

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



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

%package -n libqt4-sql-unixODBC
Group:          Development/Libraries/C and C++
Summary:        Qt 4 unixODBC plugin
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
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
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/
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
for f in mkspecs/linux-g*/qmake.conf; do
  sed -i -e "/QMAKE_CFLAGS_RELEASE[ \t]*=/s,\$, $RPM_OPT_FLAGS," $f
done
sed -i -e "s,^CXXFLAGS[ \t]*=,& $RPM_OPT_FLAGS," qmake/Makefile.unix
echo yes | ./configure %common_options -system-sqlite \
   -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/ \
   -plugin-sql-sqlite
make %{?jobs:-j%jobs} sub-src

%install
export QTDIR=$PWD
make INSTALL_ROOT=$RPM_BUILD_ROOT sub-src-install_subtargets
rm -f $RPM_BUILD_ROOT/usr/share/qt/mkspecs/*/qmake.conf.orig
# 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-sqlite
%defattr(-,root,root,755)
%dir %plugindir/sqldrivers

%plugindir/sqldrivers/libqsqlite*.so

%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