%define type everywhere-opensource-src
%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

# See http://bugzilla.redhat.com/223663
%define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9

Summary: Qt toolkit
Summary(ja): Qt ツールキット
Name: qt4
Version: 4.8.7
Release: 3%{?_dist_release}

# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
Group: System Environment/Libraries
URL: http://qt-project.org/

Source0: http://download.qt-project.org/official_releases/qt/4.8/%{version}/qt-%{type}-%{version}.tar.gz

# default Qt config file
Source4: Trolltech.conf
# header file to workaround multilib issue
Source5: qconfig-multilib.h

# desktop files
Source20: assistant.desktop.vine
Source21: designer.desktop.vine
Source22: linguist.desktop.vine
Source23: qdbusviewer.desktop.vine
Source24: qtdemo.desktop.vine
Source25: qtconfig.desktop.vine

# upstream qt4-logo, http://trolltech.com/images/products/qt/qt4-logo
Source30: hi128-app-qt4-logo.png
Source31: hi48-app-qt4-logo.png

# set default QMAKE_CFLAGS_RELEASE
Patch2: qt-everywhere-opensource-src-4.8.0-tp-multilib-optflags.patch

# get rid of timestamp which causes multilib problem
Patch4: qt-everywhere-opensource-src-4.8.5-uic_multilib.patch

# reduce debuginfo in qtwebkit (webcore)
Patch5: qt-everywhere-opensource-src-4.8.5-webcore_debuginfo.patch

# cups16 printer discovery
Patch6: qt-cupsEnumDests.patch

# prefer adwaita over gtk+ on DE_GNOME
# https://bugzilla.redhat.com/show_bug.cgi?id=1192453
Patch10: qt-prefer_adwaita_on_gnome.patch

# enable ft lcdfilter
Patch15: qt-x11-opensource-src-4.5.1-enable_ft_lcdfilter.patch

# may be upstreamable, not sure yet
# workaround for gdal/grass crashers wrt glib_eventloop null deref's
Patch23: qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck.patch

# hack out largely useless (to users) warnings about qdbusconnection
# (often in kde apps), keep an eye on https://git.reviewboard.kde.org/r/103699/
Patch25: qt-everywhere-opensource-src-4.8.3-qdbusconnection_no_debug.patch

# lrelease-qt4 tries to run qmake not qmake-qt4 (http://bugzilla.redhat.com/820767)
Patch26: qt-everywhere-opensource-src-4.8.1-linguist_qmake-qt4.patch

# enable debuginfo in libQt3Support
Patch27: qt-everywhere-opensource-src-4.8.1-qt3support_debuginfo.patch

# kde4/multilib QT_PLUGIN_PATH
Patch28: qt-everywhere-opensource-src-4.8.5-qt_plugin_path.patch

## upstreamable bits
# add support for pkgconfig's Requires.private to qmake
Patch50: qt-everywhere-opensource-src-4.8.4-qmake_pkgconfig_requires_private.patch

# FTBFS against newer firebird
Patch51: qt-everywhere-opensource-src-4.8.7-firebird.patch

# workaround major/minor macros possibly being defined already
Patch52: qt-everywhere-opensource-src-4.8.7-QT_VERSION_CHECK.patch

# fix invalid inline assembly in qatomic_{i386,x86_64}.h (de)ref implementations
Patch53: qt-x11-opensource-src-4.5.0-fix-qatomic-inline-asm.patch

# fix invalid assumptions about mysql_config --libs
# http://bugzilla.redhat.com/440673
Patch54: qt-everywhere-opensource-src-4.8.5-mysql_config.patch

# http://bugs.kde.org/show_bug.cgi?id=180051#c22
Patch55: qt-everywhere-opensource-src-4.6.2-cups.patch

# backport https://codereview.qt-project.org/#/c/205874/
Patch56: qt-everywhere-opensource-src-4.8.7-mariadb.patch

# use QMAKE_LFLAGS_RELEASE when building qmake
Patch57: qt-everywhere-opensource-src-4.8.7-qmake_LFLAGS.patch

# Fails to create debug build of Qt projects on mingw (rhbz#653674)
Patch64: qt-everywhere-opensource-src-4.8.5-QTBUG-14467.patch

# fix QTreeView crash triggered by KPackageKit (patch by David Faure)
Patch65: qt-everywhere-opensource-src-4.8.0-tp-qtreeview-kpackagekit-crash.patch

# fix the outdated standalone copy of JavaScriptCore
Patch67: qt-everywhere-opensource-src-4.8.6-s390.patch

# https://bugs.webkit.org/show_bug.cgi?id=63941
# -Wall + -Werror = fail
Patch68: qt-everywhere-opensource-src-4.8.3-no_Werror.patch

# revert qlist.h commit that seems to induce crashes in qDeleteAll<QList (QTBUG-22037)
Patch69: qt-everywhere-opensource-src-4.8.0-QTBUG-22037.patch

# Buttons in Qt applications not clickable when run under gnome-shell (#742658, QTBUG-21900)
Patch71:  qt-everywhere-opensource-src-4.8.5-QTBUG-21900.patch

# workaround
# sql/drivers/tds/qsql_tds.cpp:341:49: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Patch74: qt-everywhere-opensource-src-4.8.5-tds_no_strict_aliasing.patch

# add missing method for QBasicAtomicPointer on s390(x)
Patch76: qt-everywhere-opensource-src-4.8.0-s390-atomic.patch

# don't spam in release/no_debug mode if libicu is not present at runtime
Patch77: qt-everywhere-opensource-src-4.8.3-icu_no_debug.patch

# https://bugzilla.redhat.com/show_bug.cgi?id=810500
Patch81: qt-everywhere-opensource-src-4.8.2--assistant-crash.patch

# https://bugzilla.redhat.com/show_bug.cgi?id=694385
# https://bugs.kde.org/show_bug.cgi?id=249217
# https://bugreports.qt-project.org/browse/QTBUG-4862
# QDir::homePath() should account for an empty HOME environment variable on X11
Patch82: qt-everywhere-opensource-src-4.8.5-QTBUG-4862.patch

# poll support
Patch83: qt-4.8-poll.patch

# fix QTBUG-35459 (too low entityCharacterLimit=1024 for CVE-2013-4549)
Patch84: qt-everywhere-opensource-src-4.8.5-QTBUG-35459.patch

# systemtrayicon plugin support (for appindicators)
Patch86: qt-everywhere-opensource-src-4.8.6-systemtrayicon.patch

# fixes for LibreOffice from the upstream Qt bug tracker (#1105422):
Patch87: qt-everywhere-opensource-src-4.8.6-QTBUG-37380.patch
Patch88: qt-everywhere-opensource-src-4.8.6-QTBUG-34614.patch
Patch89: qt-everywhere-opensource-src-4.8.6-QTBUG-38585.patch

# build against the system clucene09-core
Patch90: qt-everywhere-opensource-src-4.8.6-system-clucene.patch

# fix arch autodetection for 64-bit MIPS
Patch91: qt-everywhere-opensource-src-4.8.7-mips64.patch

# fix build issue(s) with gcc6
Patch92: qt-everywhere-opensource-src-4.8.7-gcc6.patch

# support alsa-1.1.x
Patch93: qt-everywhere-opensource-src-4.8.7-alsa-1.1.patch

# support OpenSSL 1.1.x, from Debian (Gert Wollny, Dmitry Eremin-Solenikov)
# https://anonscm.debian.org/cgit/pkg-kde/qt/qt4-x11.git/tree/debian/patches/openssl_1.1.patch?h=experimental
# fixes for -openssl-linked by Kevin Kofler
Patch94: qt-everywhere-opensource-src-4.8.7-openssl-1.1.patch

# fix build with ICU >= 59, from OpenSUSE (Fabian Vogt)
# https://build.opensuse.org/package/view_file/KDE:Qt/libqt4/fix-build-icu59.patch?expand=1
Patch95: qt-everywhere-opensource-src-4.8.7-icu59.patch

# workaround qtscript failures when building with f28's gcc8
# https://bugzilla.redhat.com/show_bug.cgi?id=1580047
Patch96: qt-everywhere-opensource-src-4.8.7-gcc8_qtscript.patch

# upstream patches
# backported from Qt5 (essentially)
# http://bugzilla.redhat.com/702493
# https://bugreports.qt-project.org/browse/QTBUG-5545
Patch102: qt-everywhere-opensource-src-4.8.5-qgtkstyle_disable_gtk_theme_check.patch
# workaround for MOC issues with Boost headers (#756395)
# https://bugreports.qt-project.org/browse/QTBUG-22829
Patch113: qt-everywhere-opensource-src-4.8.6-QTBUG-22829.patch

# aarch64 support, https://bugreports.qt-project.org/browse/QTBUG-35442
Patch180: qt-aarch64.patch

# Fix problem caused by gcc 9 fixing a longstanding bug.
# https://github.com/qt/qtbase/commit/c35a3f519007af44c3b364b9af86f6a336f6411b.patch
Patch181: qt-everywhere-opensource-src-4.8.7-qforeach.patch

## upstream git

## security patches
# CVE-2018-19872 qt: malformed PPM image causing division by zero and crash in qppmhandler.cpp
Patch500: qt-everywhere-opensource-src-4.8.7-crash-in-qppmhandler.patch

# Vine Patches
# use system ca-bundle certs, http://bugzilla.redhat.com/521911
Patch1001: qt-everywhere-opensource-src-4.8.0-system_ca_certificates_vine.patch 

## optional plugin bits
# set to -no-sql-<driver> to disable
# set to -qt-sql-<driver> to enable *in* qt library
%define ibase -no-sql-ibase
%define mysql -plugin-sql-mysql
%define odbc -plugin-sql-odbc
%define psql -plugin-sql-psql
%define sqlite -plugin-sql-sqlite
%define tds -plugin-sql-tds

%define no_javascript_jit -no-javascript-jit

# don't build with phonon backend now
#define phonon -phonon
#define phonon_backend -phonon-backend
%define dbus -dbus-linked
%define graphicssystem -graphicssystem raster
# FIXME/TODO: use system webkit for assistant, examples/webkit, demos/browser
%define webkit -webkit
%define noopt -no-mmx -no-3dnow -no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon

# See http://bugzilla.redhat.com/196901
%define _qt4 %{name}
%define _qt4_prefix %{_libdir}/qt4
%define _qt4_bindir %{_qt4_prefix}/bin
# _qt4_datadir is not multilib clean, and hacks to workaround that breaks stuff.
#define _qt4_datadir %{_datadir}/qt4
%define _qt4_datadir %{_qt4_prefix}
%define _qt4_demosdir %{_qt4_prefix}/demos
%define _qt4_docdir %{_docdir}/qt4
%define _qt4_examplesdir %{_qt4_prefix}/examples
%define _qt4_headerdir %{_includedir} 
%define _qt4_importdir %{_qt4_prefix}/imports 
%define _qt4_libdir %{_libdir}
%define _qt4_plugindir %{_qt4_prefix}/plugins
%define _qt4_sysconfdir %{_sysconfdir}
%define _qt4_translationdir %{_datadir}/qt4/translations

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: alsa-lib-devel
BuildRequires: cups-devel >= 1.1.9
BuildRequires: dbus-devel >= 0.62
BuildRequires: desktop-file-utils
BuildRequires: findutils
BuildRequires: fontconfig-devel
BuildRequires: glib2-devel
BuildRequires: gtk2-devel
BuildRequires: libicu-devel
BuildRequires: libjpeg-devel
BuildRequires: libmng-devel
BuildRequires: libpng-devel >= 1.2.5
BuildRequires: libtiff-devel
BuildRequires: NetworkManager-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: pulseaudio-libs-devel
BuildRequires: rsync
BuildRequires: zlib-devel

# X11 dependencies
%define x_deps libICE-devel libSM-devel libXcursor-devel libXext-devel libXfixes-devel libXft-devel libXi-devel libXinerama-devel libXrandr-devel libXrender-devel libXt-devel libXtst-devel libXv-devel libX11-devel xorg-x11-proto-devel libGL-devel libGLU-devel
BuildRequires: %{x_deps}

%if "%{?ibase}" != "-no-sql-ibase"
BuildRequires: firebird-devel
%endif

%if "%{?mysql}" != "-no-sql-mysql"
BuildRequires: libmariadb-devel
%endif

%if "%{?phonon_backend}" == "-phonon-backend"
BuildRequires: gstreamer-devel >= 0.10
BuildRequires: gstreamer-plugins-base-devel >= 0.10
%endif

%if "%{?psql}" != "-no-sql-psql"
BuildRequires: libpq-devel
BuildRequires: krb5-devel libxslt-devel pam-devel 
BuildRequires: readline-devel
%endif

%if "%{?odbc}" != "-no-sql-odbc"
BuildRequires: unixODBC-devel
%endif

%if "%{?sqlite}" != "-no-sql-sqlite"
%define _system_sqlite -system-sqlite
BuildRequires: sqlite3-devel
%endif

%if "%{?tds}" != "-no-sql-tds"
BuildRequires: freetds-devel
%endif

Obsoletes: qt4-sqlite < 4.7.3
Provides:  qt4-sqlite = %{version}-%{release}

Obsoletes: qgtkstyle < 0.1
Provides:  qgtkstyle = 0.1-1

Provides:  WebKit-qt

Vendor: Project Vine
Distribution: Vine Linux

%description
Qt is a GUI software toolkit which simplifies the task of writing and
maintaining GUI (Graphical User Interface) applications
for the X Window System.

Qt is written in C++ and is fully object-oriented.

This package contains the shared library needed to run qt
applications, as well as the README files for qt.


%package config
Summary: Graphical configuration tool for programs using Qt 4 
Summary(ja): Qt 4 を使用するプログラムのためのグラフィカルな設定ツール
Group: User Interface/Desktops
Requires: %{name} = %{version}-%{release}
Requires(post): alternatives
Requires(postun): alternatives

%description config 
%{summary}.


%package designer
Summary: Interface designer (IDE) for the Qt toolkit
Summary(ja): Qt ツールキットのインターフェースデザイナ
Group: Applications/Development
Requires: %{name}-devel = %{version}-%{release}
Requires(post): alternatives
Requires(postun): alternatives

%description designer
The qt-designer package contains an User Interface designer tool
for the Qt toolkit.


%package devel
Summary: Development files for the Qt GUI toolkit.
Summary(ja): Qt ツールキットの開発用ファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{x_deps}
Requires: libpng-devel
Requires: libjpeg-devel
Requires: pkgconfig
Requires(post): alternatives
Requires(postun): alternatives
Provides:  WebKit-qt-devel

%description devel
This package contains the files necessary to develop
applications using the Qt toolkit.

# make a devel private subpkg or not?
%define private 0
%package devel-private
Summary: Private headers for Qt toolkit 
Group: Development/Libraries
BuildArch: noarch
Requires: %{name}-devel = %{version}-%{release}
Provides: qt-devel-private = %{version}-%{release}

%description devel-private
%{summary}.

%package doc
Summary: API documentation for Qt4
Summary(ja): Qt4 の API ドキュメント
Group: Documentation
Requires: %{name} = %{version}-%{release}
# Requires assistant
Requires: qt4-tools = %{version}-%{release}
BuildArch: noarch

%description doc
%{summary}.

%description doc -l ja
Qt4 の API ドキュメントです．


%package tools
Summary: Qt 4 development tools
Summary(ja): Qt 4 開発ツール集
Group: Development/Tools
Requires: %{name}-devel  = %{version}-%{release}
Requires: %{name}-sqlite = %{version}-%{release}
Requires(post): alternatives
Requires(postun): alternatives

%description tools
This package contains tools used to assist in Qt 4 development.


%define qvfb 0
%package qvfb
Summary: Virtual frame buffer for Qt for Embedded Linux
Group: Applications/Emulators
Requires: %{name} = %{version}-%{release}

%description qvfb
%{summary}.

%package ibase
Summary: IBase driver for Qt's SQL classes
Group:  System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Provides: qt-ibase = %{version}-%{release}

%description ibase
IBase driver for Qt's SQL classes (QSQL)

%package MySQL
Summary: MySQL drivers for Qt's SQL classes.
Summary(ja): Qt SQL 用の MySQL ドライバ
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Provides:  qt4-mysql = %{version}-%{release}

%description MySQL
MySQL driver for Qt's SQL classes (QSQL)

%package ODBC
Summary: ODBC drivers for Qt's SQL classes.
Summary(ja): Qt SQL 用の ODBC ドライバ
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Provides:  qt4-odbc = %{version}-%{release}

%description ODBC
ODBC driver for Qt's SQL classes (QSQL)

%package PostgreSQL
Summary: PostgreSQL drivers for Qt's SQL classes.
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Provides: qt4-postgresql = %{version}-%{release}

%description PostgreSQL
PostgreSQL driver for Qt's SQL classes (QSQL)

%package tds
Summary: TDS driver for Qt's SQL classes
Summary(ja): Qt SQL 用の TDS ドライバ
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Provides: qt-tds = %{version}-%{release}

%description tds
TDS driver for Qt's SQL classes (QSQL)

# compat32
%package -n compat32-%{name}
Summary: Qt toolkit
Summary(ja): Qt ツールキット
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
Qt is a GUI software toolkit which simplifies the task of writing and
maintaining GUI (Graphical User Interface) applications
for the X Window System.

Qt is written in C++ and is fully object-oriented.

This package contains the shared library needed to run qt
applications, as well as the README files for qt.

%package -n compat32-%{name}-devel
Summary: Development files and documentation for the Qt GUI toolkit.
Summary(ja): Qt ツールキットの開発用ファイル
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: compat32-%{name} = %{version}-%{release}

%description -n compat32-%{name}-devel
This package contains the files necessary to develop
applications using the Qt toolkit.


%prep
%setup -q -n qt-everywhere-opensource-src-%{version}

%patch4 -p1 -b .uic_multilib
%patch5 -p1 -b .webcore_debuginfo
# ie, where cups-1.6+ is present
%if 0%{?fedora} || 0%{?rhel} > 7
#patch6 -p1 -b .cupsEnumDests
%endif
%patch10 -p0 -b .prefer_adwaita_on_gnome
%patch15 -p1 -b .enable_ft_lcdfilter
%patch23 -p1 -b .glib_eventloop_nullcheck
%patch25 -p1 -b .qdbusconnection_no_debug
%patch26 -p1 -b .linguist_qtmake-qt4
%patch27 -p1 -b .qt3support_debuginfo
%patch28 -p1 -b .qt_plugin_path
%patch50 -p1 -b .qmake_pkgconfig_requires_private
%patch51 -p1 -b .firebird
%patch52 -p1 -b .QT_VERSION_CHECK
## TODO: still worth carrying?  if so, upstream it.
%patch53 -p1 -b .qatomic-inline-asm
## TODO: upstream me
%patch54 -p1 -b .mysql_config
%patch55 -p1 -b .cups-1
%patch56 -p1 -b .mariadb
%patch57 -p1 -b .qmake_LFLAGS
%patch64 -p1 -b .QTBUG-14467
%patch65 -p1 -b .qtreeview-kpackagekit-crash
%patch67 -p1 -b .s390
%patch68 -p1 -b .no_Werror
%patch69 -p1 -b .QTBUG-22037
%patch71 -p1 -b .QTBUG-21900
%patch74 -p1 -b .tds_no_strict_aliasing
%patch76 -p1 -b .s390-atomic
%patch77 -p1 -b .icu_no_debug
%patch81 -p1 -b .assistant-crash
%patch82 -p1 -b .QTBUG-4862
%patch83 -p1 -b .poll
%patch87 -p1 -b .QTBUG-37380
%patch88 -p0 -b .QTBUG-34614
%patch89 -p0 -b .QTBUG-38585

%if 0%{?system_clucene}
%patch90 -p1 -b .system_clucene
# delete bundled copy
rm -rf src/3rdparty/clucene
%endif
%patch91 -p1 -b .mips64
%patch92 -p1 -b .gcc6
%patch93 -p1 -b .alsa1.1
%patch94 -p1 -b .openssl1.1
%patch95 -p1 -b .icu59
%patch96 -p1 -b .gcc8_qtscript

# upstream patches
%patch102 -p1 -b .qgtkstyle_disable_gtk_theme_check
%patch113 -p1 -b .QTBUG-22829

%patch180 -p1 -b .aarch64
%patch181 -p1 -b .qforeach

# upstream git

# security fixes
%patch500 -p1 -b .malformed-ppb-image-causing-crash

# regression fixes for the security fixes
%patch84 -p1 -b .QTBUG-35459

%patch86 -p1 -b .systemtrayicon

%patch2 -p1 -b .multilib-optflags
# drop backup file(s), else they get installed too, http://bugzilla.redhat.com/639463
rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags

# Patches for Vine
%patch1001 -p1 -b .system_ca_certificates

# drop -fexceptions from $RPM_OPT_FLAGS
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`

%define platform linux-g++

# some 64bit platforms assume -64 suffix, https://bugzilla.redhat.com/569542
%if "%{?__isa_bits}"  == "64"
%define platform linux-g++-64
%endif

# https://bugzilla.redhat.com/478481
%ifarch x86_64
%define platform linux-g++
%endif

sed -i \
  -e "s|-O2|$RPM_OPT_FLAGS|g" \
  mkspecs/%{platform}/qmake.conf

sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 $RPM_LD_FLAGS|" \
  mkspecs/common/g++-unix.conf

# undefine QMAKE_STRIP, so we get useful -debuginfo pkgs
sed -i -e "s|^QMAKE_STRIP.*=.*|QMAKE_STRIP             =|" mkspecs/common/linux.conf 

# set correct lib path
if [ "%{_lib}" == "lib64" ] ; then
  sed -i -e "s,/usr/lib /lib,/usr/%{_lib} /%{_lib},g" config.tests/{unix,x11}/*.test
  sed -i -e "s,/lib /usr/lib,/%{_lib} /usr/%{_lib},g" config.tests/{unix,x11}/*.test
fi

# let makefile create missing .qm files, the .qm files should be included in qt upstream
for f in translations/*.ts ; do
  touch ${f%.ts}.qm
done

# desktop menu
sed -e 's:$(QTBIN):%{_qt4_bindir}:g' %{SOURCE20} > assistant.desktop
sed -e 's:$(QTBIN):%{_qt4_bindir}:g' %{SOURCE21} > designer.desktop
sed -e 's:$(QTBIN):%{_qt4_bindir}:g' %{SOURCE22} > linguist.desktop
sed -e 's:$(QTBIN):%{_qt4_bindir}:g' %{SOURCE23} > qdbusviewer.desktop
sed -e 's:$(QTBIN):%{_qt4_bindir}:g' %{SOURCE24} > qtdemo.desktop
sed -e 's:$(QTBIN):%{_qt4_bindir}:g' %{SOURCE25} > qtconfig.desktop

%build
CXXFLAGS="$CXXFLAGS -std=gnu++98"
CXXFLAGS="$CXXFLAGS -Wno-deprecated"
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS"

# build shared, threaded (default) libraries
./configure -v \
    -confirm-license \
    -opensource \
    -optimized-qmake \
    -prefix %{_qt4_prefix} \
    -bindir %{_qt4_bindir} \
    -datadir %{_qt4_datadir} \
    -demosdir %{_qt4_demosdir} \
    -docdir %{_qt4_docdir} \
    -examplesdir %{_qt4_examplesdir} \
    -headerdir %{_qt4_headerdir} \
    -importdir %{_qt4_importdir} \
    -libdir %{_qt4_libdir} \
    -plugindir %{_qt4_plugindir} \
    -sysconfdir %{_qt4_sysconfdir} \
    -translationdir %{_qt4_translationdir} \
    -platform %{platform} \
    -release \
    -shared \
    -cups \
    -fontconfig \
    -largefile \
    -gtkstyle \
    -no-rpath \
    -reduce-relocations \
    -no-separate-debug-info \
    %{?phonon} %{!?phonon:-no-phonon} \
    %{?phonon_backend} \
    %{?no_pch} \
    %{?no_javascript_jit} \
    -sm \
    -stl \
    -system-libmng \
    -system-libpng \
    -system-libjpeg \
    -system-libtiff \
    -system-zlib \
    -xinput \
    -xcursor \
    -xfixes \
    -xinerama \
    -xshape \
    -xrandr \
    -xrender \
    -xkb \
    -glib \
    -icu \
    -openssl-linked \
    -xmlpatterns \
    %{?dbus} %{!?dbus:-no-dbus} \
    %{?graphicssystem} \
    %{?webkit} %{!?webkit:-no-webkit } \
    %{?ibase} \
    %{?mysql} \
    %{?psql} \
    %{?odbc} \
    %{?sqlite} %{?_system_sqlite} \
    %{?tds} \
    -no-nas-sound \
    %{?noopt} \
    -nomake demos \
    -nomake examples

#  -plugin-sql-mysql -I/usr/include/mysql \
#  -plugin-sql-psql -I/usr/include/pgsql \

make %{?_smp_mflags}

# TODO: consider patching tools/tools.pro to enable building this by default
%{?qvfb:make %{?_smp_mflags} -C tools/qvfb}

# recreate .qm files
LD_LIBRARY_PATH=`pwd`/lib bin/lrelease translations/*.ts

%install
rm -rf $RPM_BUILD_ROOT

make install INSTALL_ROOT=$RPM_BUILD_ROOT

%if 0%{?qvfb}
make install INSTALL_ROOT=$RPM_BUILD_ROOT -C tools/qvfb
%find_lang qvfb --with-qt --without-mo
%else
rm -f $RPM_BUILD_ROOT%{_qt4_translationdir}/qvfb*.qm
%endif

%if 0%{?private}
# install private headers
# using rsync -R as easy way to preserve relative path names
# we're cheating and using %%_prefix (/usr) directly here
rsync -aR \
    include/Qt{Core,Declarative,Gui,Script}/private \
    src/{corelib,declarative,gui,script}/*/*_p.h \
    $RPM_BUILD_ROOT%{_prefix}/
%endif

#ln -s qt-%{version} $RPM_BUILD_ROOT%{_libdir}/qt4

# Add desktop file(s)
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install \
    --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
    --vendor="" \
    assistant.desktop designer.desktop linguist.desktop qdbusviewer.desktop qtconfig.desktop

## pkg-config
# strip extraneous dirs/libraries 
# safe ones
glib2_libs=$(pkg-config --libs glib-2.0 gobject-2.0 gthread-2.0)
ssl_libs=$(pkg-config --libs openssl)
for dep in \
  -laudio -ldbus-1 -lfreetype -lfontconfig ${glib2_libs} \
  -ljpeg -lm -lmng -lpng -lpulse -lpulse-mainloop-glib ${ssl_libs} -lsqlite3 -lz \
  -L/usr/X11R6/lib -L/usr/X11R6/%{_lib} -L%{_libdir} ; do
  sed -i -e "s|$dep ||g" $RPM_BUILD_ROOT%{_qt4_libdir}/lib*.la 
#  sed -i -e "s|$dep ||g" $RPM_BUILD_ROOT%{_qt4_libdir}/pkgconfig/*.pc
  sed -i -e "s|$dep ||g" $RPM_BUILD_ROOT%{_qt4_libdir}/*.prl
done
# riskier
for dep in -ldl -lphonon -lpthread -lICE -lSM -lX11 -lXcursor -lXext -lXfixes -lXft -lXinerama -lXi -lXrandr -lXrender -lXt ; do
  sed -i -e "s|$dep ||g" $RPM_BUILD_ROOT%{_qt4_libdir}/lib*.la 
#  sed -i -e "s|$dep ||g" $RPM_BUILD_ROOT%{_qt4_libdir}/pkgconfig/*.pc 
  sed -i -e "s|$dep ||g" $RPM_BUILD_ROOT%{_qt4_libdir}/*.prl
done

# nuke dangling reference(s) to $RPM_BUILD_ROOT
sed -i -e "/^QMAKE_PRL_BUILD_DIR/d" $RPM_BUILD_ROOT%{_qt4_libdir}/*.prl
sed -i -e "s|-L%{_builddir}/qt-everywhere-opensource-src-%{version}/lib||g" \
  $RPM_BUILD_ROOT%{_qt4_libdir}/pkgconfig/*.pc \
  $RPM_BUILD_ROOT%{_qt4_libdir}/*.prl

# .la files, die, die, die.
rm -f $RPM_BUILD_ROOT%{_qt4_libdir}/lib*.la

# let rpm handle binaries conflicts
mkdir -p $RPM_BUILD_ROOT%{_bindir}
for i in $RPM_BUILD_ROOT%{_qt4_bindir}/*; do
    ln -s ../%{_lib}/qt4/bin/`basename $i` $RPM_BUILD_ROOT/%{_bindir}
done

%ifarch %{multilib_archs}
# multilib: qconfig.h
  mv $RPM_BUILD_ROOT%{_qt4_headerdir}/Qt/qconfig.h $RPM_BUILD_ROOT%{_qt4_headerdir}/QtCore/qconfig-%{_arch}.h
  install -p -m644 -D %{SOURCE5} $RPM_BUILD_ROOT%{_qt4_headerdir}/QtCore/qconfig-multilib.h
  ln -sf qconfig-multilib.h $RPM_BUILD_ROOT%{_qt4_headerdir}/QtCore/qconfig.h
  ln -sf ../QtCore/qconfig.h $RPM_BUILD_ROOT%{_qt4_headerdir}/Qt/qconfig.h
%endif

%if "%{_qt4_libdir}" != "%{_libdir}"
    mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
    echo "%{_qt4_libdir}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/qt4.conf
%if %{build_compat32}
    echo "%{_qt4_libdir}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/qt4-i386.conf
%endif
%endif

# Trolltech.conf
install -p -m644 -D %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/Trolltech.conf

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64,128x128}/apps
# qt4-logo (generic) icons
install -p -m644 -D %{SOURCE30} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/qt4-logo.png
install -p -m644 -D %{SOURCE31} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/qt4-logo.png

# assistant icons
install -p -m644 -D tools/assistant/tools/assistant/images/assistant.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/assistant.png
install -p -m644 -D tools/assistant/tools/assistant/images/assistant-128.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/assistant.png
# designer icons
install -p -m644 -D tools/designer/src/designer/images/designer.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/designer.png
# linguist icons
for icon in tools/linguist/linguist/images/icons/linguist-*-32.png ; do
    size=$(echo $(basename ${icon}) | cut -d- -f2)
    install -p -m644 -D ${icon} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}x${size}/apps/linguist4.png
done
# qdbusviewer icons
install -p -m644 -D tools/qdbus/qdbusviewer/images/qdbusviewer.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/qdbusviewer.png
install -p -m644 -D tools/qdbus/qdbusviewer/images/qdbusviewer-128.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/qdbusviewer.png

# Qt.pc
cat > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/Qt.pc << EOF
prefix=%{_qt4_prefix}
bindir=%{_qt4_bindir}
datadir=%{_qt4_datadir}
demosdir=%{_qt4_demosdir}
docdir=%{_qt4_docdir}
examplesdir=%{_qt4_examplesdir}
headerdir=%{_qt4_headerdir}
importdir=%{_qt4_importdir}
libdir=%{_qt4_libdir}
moc=%{_qt4_bindir}/moc
plugindir=%{_qt4_plugindir}
qmake=%{_qt4_bindir}/qmake
sysconfdir=%{_qt4_sysconfdir}
translationdir=%{_qt4_translationdir}

Name: Qt
Description: Qt Configuration
Version: %{version}
EOF

# rpm macros
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.qt4 << EOF
%%_qt4 %{name}
%%_qt48 %{version}
%%_qt4_version %{version}
%%_qt4_prefix %%{_libdir}/qt4
%%_qt4_bindir %%{_qt4_prefix}/bin
%%_qt4_datadir %%{_qt4_prefix}
%%_qt4_demosdir %%{_qt4_prefix}/demos
%%_qt4_docdir %%{_docdir}/qt4
%%_qt4_examples %%{_qt4_prefix}/examples
%%_qt4_headerdir %%{_includedir}
%%_qt4_importdir %%{_qt4_prefix}/imports
%%_qt4_libdir %%{_libdir}
%%_qt4_plugindir %%{_qt4_prefix}/plugins
%%_qt4_qmake %%{_qt4_bindir}/qmake
%%_qt4_sysconfdir %%{_sysconfdir}
%%_qt4_translationdir %%{_datadir}/qt4/translations 
EOF

# create/own stuff under %%_qt4_plugindir
mkdir $RPM_BUILD_ROOT%{_qt4_plugindir}/crypto
mkdir $RPM_BUILD_ROOT%{_qt4_plugindir}/gui_platform
mkdir $RPM_BUILD_ROOT%{_qt4_plugindir}/styles

## nuke bundled phonon bits
rm -fv  $RPM_BUILD_ROOT%{_qt4_libdir}/libphonon.so*
rm -rfv $RPM_BUILD_ROOT%{_libdir}/pkgconfig/phonon.pc
# contents slightly different between phonon-4.3.1 and qt-4.5.0
rm -fv  $RPM_BUILD_ROOT%{_includedir}/phonon/phononnamespace.h
# contents dup'd but should remove just in case
rm -fv  $RPM_BUILD_ROOT%{_includedir}/phonon/*.h
rm -rfv $RPM_BUILD_ROOT%{_qt4_headerdir}/phonon*
rm -fv $RPM_BUILD_ROOT%{_datadir}/dbus-1/interfaces/org.kde.Phonon.AudioOutput.xml
rm -fv $RPM_BUILD_ROOT%{_qt4_plugindir}/designer/libphononwidgets.so
# backend
rm -fv $RPM_BUILD_ROOT%{_qt4_plugindir}/phonon_backend/*_gstreamer.so
rm -fv $RPM_BUILD_ROOT%{_datadir}/kde4/services/phononbackends/gstreamer.desktop
# nuke bundled webkit bits 
#rm -fv $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/modules/qt_webkit_version.pri
#rm -fv $RPM_BUILD_ROOT%{_qt4_headerdir}/Qt/qgraphicswebview.h
#rm -fv $RPM_BUILD_ROOT%{_qt4_headerdir}/Qt/qweb*.h
#rm -frv $RPM_BUILD_ROOT%{_qt4_headerdir}/QtWebKit/
#rm -frv $RPM_BUILD_ROOT%{_qt4_importdir}/QtWebKit/
#rm -fv $RPM_BUILD_ROOT%{_qt4_libdir}/libQtWebKit.*
#rm -fv $RPM_BUILD_ROOT%{_qt4_plugindir}/designer/libqwebview.so
#rm -fv $RPM_BUILD_ROOT%{_libdir}/pkgconfig/QtWebKit.pc
rm -frv $RPM_BUILD_ROOT%{_qt4_prefix}/tests/

# delete files to use alternatives
rm -f $RPM_BUILD_ROOT%{_bindir}/assistant
rm -f $RPM_BUILD_ROOT%{_bindir}/designer
rm -f $RPM_BUILD_ROOT%{_bindir}/linguist
rm -f $RPM_BUILD_ROOT%{_bindir}/lrelease
rm -f $RPM_BUILD_ROOT%{_bindir}/lupdate
rm -f $RPM_BUILD_ROOT%{_bindir}/moc
rm -f $RPM_BUILD_ROOT%{_bindir}/qmake
rm -f $RPM_BUILD_ROOT%{_bindir}/qtconfig
rm -f $RPM_BUILD_ROOT%{_bindir}/uic

# delete manifest
rm -f $RPM_BUILD_ROOT%{_qt4_demosdir}/demos-manifest.xml
rm -f $RPM_BUILD_ROOT%{_qt4_examplesdir}/examples-manifest.xml

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# If %{_libdir}/qt4 is symbolic link, remove it
# Is this safe?
if [ $1 -eq 2 -a -L %{_libdir}/qt4 ] ; then
    rm -f %{_libdir}/qt4 &> /dev/null ||:
fi

%post
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor &> /dev/null ||:

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null ||:

%postun
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &> /dev/null ||:
    gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null ||:
fi

%post config
/sbin/update-alternatives --install \
    %{_bindir}/qtconfig qtconfig %{_qt4_bindir}/qtconfig 20

%posttrans config
# fix broken symlink if it's there
if [ ! -f %{_bindir}/qtconfig ] ; then
    /sbin/update-alternatives --auto qtconfig
fi

%postun config
if [ $1 -eq 0 ] ; then
    /sbin/update-alternatives --remove qtconfig %{_qt4_bindir}/qtconfig
fi

%post designer
touch --no-create %{_datadir}/icons/hicolor &> /dev/null ||:
/sbin/update-alternatives --install \
    %{_bindir}/designer designer %{_qt4_bindir}/designer 20

%posttrans designer
gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null ||:
# fix broken symlink if it's there
if [ ! -f %{_bindir}/designer ] ; then
    /sbin/update-alternatives --auto designer
fi

%postun designer
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &> /dev/null ||:
    gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null ||:
    /sbin/update-alternatives --remove designer %{_qt4_bindir}/designer
fi

%post devel
/sbin/update-alternatives --install \
    %{_bindir}/qmake qmake %{_qt4_bindir}/qmake 20 \
    --slave %{_bindir}/moc \
        moc \
        %{_qt4_bindir}/moc \
    --slave %{_bindir}/uic \
        uic \
        %{_qt4_bindir}/uic \
    --slave %{_bindir}/lrelease \
        lrelease \
        %{_qt4_bindir}/lrelease \
    --slave %{_bindir}/lupdate \
        lupdate \
        %{_qt4_bindir}/lupdate

%posttrans devel
# fix broken symlink if it's there
if [ ! -f %{_bindir}/qmake ] ; then
    /sbin/update-alternatives --auto qmake
fi

%postun devel
if [ $1 -eq 0 ] ; then
    /sbin/update-alternatives --remove qmake %{_qt4_bindir}/qmake
fi

%post tools
/sbin/update-alternatives --install \
    %{_bindir}/assistant assistant %{_qt4_bindir}/assistant 20 
/sbin/update-alternatives --install \
    %{_bindir}/linguist  linguist  %{_qt4_bindir}/linguist 20

%posttrans tools
# fix broken symlink if it's there
if [ ! -f %{_bindir}/assistant ] ; then
    /sbin/update-alternatives --auto assistant
fi
if [ ! -f %{_bindir}/linguist ] ; then
    /sbin/update-alternatives --auto linguist
fi

%postun tools
if [ $1 -eq 0 ] ; then
    /sbin/update-alternatives --remove assistant %{_qt4_bindir}/assistant
    /sbin/update-alternatives --remove linguist %{_qt4_bindir}/linguist
fi

%pre -n compat32-%{name}
# If %{_libdir}/qt4 is symbolic link, remove it
# Is this safe?
if [ $1 -eq 2 -a -L %{_libdir}/qt4 ] ; then
    rm -f %{_libdir}/qt4 &> /dev/null ||:
fi

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README LGPL_EXCEPTION.txt LICENSE.LGPL LICENSE.GPL3
%config(noreplace) %{_sysconfdir}/Trolltech.conf
%if "%{_qt4_libdir}" != "%{_libdir}"
%config %{_sysconfdir}/ld.so.conf.d/qt4.conf
%endif
%{_bindir}/qdbus
#%dir %{_qt4_prefix}
%dir %{_qt4_bindir}
%{_qt4_bindir}/qdbus
%if "%{_qt4_libdir}" != "%{_libdir}"
%dir %{_qt4_libdir}
%endif
%{_qt4_libdir}/libQt*.so.*
%dir %{_qt4_importdir}
%dir %{_qt4_importdir}/Qt
%{_qt4_importdir}/Qt/*
%dir %{_qt4_importdir}/QtWebKit
%{_qt4_importdir}/QtWebKit/*
%dir %{_qt4_plugindir}
%dir %{_qt4_plugindir}/accessible
%{_qt4_plugindir}/accessible/*
%dir %{_qt4_plugindir}/bearer
%{_qt4_plugindir}/bearer/*
%dir %{_qt4_plugindir}/codecs
%{_qt4_plugindir}/codecs/*
%dir %{_qt4_plugindir}/crypto
%dir %{_qt4_plugindir}/designer
%dir %{_qt4_plugindir}/graphicssystems
%{_qt4_plugindir}/graphicssystems/*
%dir %{_qt4_plugindir}/iconengines
%{_qt4_plugindir}/iconengines/*
%dir %{_qt4_plugindir}/imageformats
%{_qt4_plugindir}/imageformats/*
%dir %{_qt4_plugindir}/inputmethods
%{_qt4_plugindir}/inputmethods/*
%dir %{_qt4_plugindir}/qmltooling
%{_qt4_plugindir}/qmltooling/*
%dir %{_qt4_plugindir}/script
%{_qt4_plugindir}/script/*
%dir %{_qt4_plugindir}/sqldrivers
%{_qt4_plugindir}/sqldrivers/libqsqlite*
%dir %{_qt4_translationdir}
%{_qt4_translationdir}/qt_*.qm
%{_qt4_translationdir}/qtscript_*.qm
%{_datadir}/icons/hicolor/*/apps/qt4-logo.*

%files config
%defattr(-,root,root,-)
%{_qt4_bindir}/qtconfig
%{_qt4_translationdir}/qtconfig_*.qm
%{_datadir}/applications/qtconfig.desktop

%files designer
%defattr(-,root,root,-)
%{_qt4_bindir}/designer
%{_qt4_plugindir}/designer/*
%{_qt4_translationdir}/designer_*.qm
%{_datadir}/applications/designer.desktop
%{_datadir}/icons/hicolor/*/apps/designer*
%{_qt4_docdir}/qch/designer.qch

%files devel
%defattr(-,root,root,-)
%{_sysconfdir}/rpm/macros.*
%{_bindir}/qdbuscpp2xml
%{_bindir}/qdbusxml2cpp
%{_bindir}/qmlplugindump
%{_bindir}/qt3to4
%{_bindir}/rcc
%{_bindir}/uic3
%{_qt4_bindir}/lrelease
%{_qt4_bindir}/lupdate
%{_qt4_bindir}/moc
%{_qt4_bindir}/qdbuscpp2xml
%{_qt4_bindir}/qdbusxml2cpp
%{_qt4_bindir}/qmake
%{_qt4_bindir}/qmlplugindump
%{_qt4_bindir}/qt3to4
%{_qt4_bindir}/rcc
%{_qt4_bindir}/uic
%{_qt4_bindir}/uic3
%{_qt4_headerdir}/*
%{_qt4_libdir}/libQt*.so
%{_qt4_libdir}/libQtUiTools*.a
%{_qt4_libdir}/libQt*.prl
%if 0%{?phonon:1}
## nuke this one too?  -- Rex
%{_qt4_libdir}/libphonon.prl
%endif
%{_qt4_datadir}/mkspecs/
%{_qt4_datadir}/phrasebooks/
%{_qt4_datadir}/q3porting.xml
%{_libdir}/pkgconfig/*.pc
%if 0%{?private}
%exclude %{_qt4_headerdir}/*/private/

%files devel-private
%defattr(-,root,root,-)
%{_qt4_headerdir}/QtCore/private/
%{_qt4_headerdir}/QtDeclarative/private/
%{_qt4_headerdir}/QtGui/private/
%{_qt4_headerdir}/QtScript/private/
%{_qt4_headerdir}/../src/corelib/
%{_qt4_headerdir}/../src/declarative/
%{_qt4_headerdir}/../src/gui/
%{_qt4_headerdir}/../src/script/
%endif

%files doc
%defattr(-,root,root,-)
%{_qt4_docdir}/html/*
%{_qt4_docdir}/qch/*.qch
%exclude %{_qt4_docdir}/qch/designer.qch
%exclude %{_qt4_docdir}/qch/linguist.qch
%{_qt4_docdir}/src/*

%files tools
%defattr(-,root,root,-)
%{_bindir}/lconvert
%{_bindir}/pixeltool
%{_bindir}/qcollectiongenerator
%{_bindir}/qdbusviewer
%{_bindir}/qdoc3
%{_bindir}/qhelpconverter
%{_bindir}/qhelpgenerator
%{_bindir}/qmlviewer
%{_bindir}/qttracereplay
%{_bindir}/xmlpatterns
%{_bindir}/xmlpatternsvalidator
%{_qt4_bindir}/assistant
%{_qt4_bindir}/lconvert
%{_qt4_bindir}/linguist
%{_qt4_bindir}/pixeltool
%{_qt4_bindir}/qcollectiongenerator
%{_qt4_bindir}/qdbusviewer
%{_qt4_bindir}/qdoc3
%{_qt4_bindir}/qhelpconverter
%{_qt4_bindir}/qhelpgenerator
%{_qt4_bindir}/qmlviewer
%{_qt4_bindir}/qttracereplay
%{_qt4_bindir}/xmlpatterns
%{_qt4_bindir}/xmlpatternsvalidator
%{_qt4_translationdir}/assistant_*.qm
%{_qt4_translationdir}/linguist_*.qm
%{_datadir}/applications/assistant.desktop
%{_datadir}/applications/linguist.desktop
%{_datadir}/applications/qdbusviewer.desktop
%{_datadir}/icons/hicolor/*/apps/assistant*
%{_datadir}/icons/hicolor/*/apps/linguist*
%{_datadir}/icons/hicolor/*/apps/qdbusviewer*
%{_qt4_docdir}/qch/linguist.qch

%if 0%{?qvfb}
%files qvfb -f qvfb.lang
%defattr(-,root,root,-)
%{_bindir}/qvfb
%{_qt4_bindir}/qvfb
%endif

%if "%{?ibase}" == "-plugin-sql-ibase"
%files ibase
%defattr(-,root,root,-)
%{_qt4_plugindir}/sqldrivers/libqsqlibase*
%endif

%if "%{?mysql}" == "-plugin-sql-mysql"
%files MySQL
%defattr(-,root,root,-)
%{_qt4_plugindir}/sqldrivers/libqsqlmysql*
%endif

%if "%{?odbc}" == "-plugin-sql-odbc"
%files ODBC 
%defattr(-,root,root,-)
%{_qt4_plugindir}/sqldrivers/libqsqlodbc*
%endif

%if "%{?psql}" == "-plugin-sql-psql"
%files PostgreSQL
%defattr(-,root,root,-)
%{_qt4_plugindir}/sqldrivers/libqsqlpsql*
%endif

%if "%{?tds}" == "-plugin-sql-tds"
%files tds
%defattr(-,root,root,-)
%{_qt4_plugindir}/sqldrivers/libqsqltds*
%endif

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root,-)
%if "%{_qt4_libdir}" != "%{_libdir}"
%config %{_sysconfdir}/ld.so.conf.d/qt4-i386.conf
%endif
#%dir %{_qt4_prefix}
%dir %{_qt4_bindir}
%{_qt4_bindir}/qdbus
%if "%{_qt4_libdir}" != "%{_libdir}"
%dir %{_qt4_libdir}
%endif
%{_qt4_libdir}/libQt*.so.*
%dir %{_qt4_plugindir}
%dir %{_qt4_plugindir}/accessible
%{_qt4_plugindir}/accessible/*
%dir %{_qt4_plugindir}/codecs
%{_qt4_plugindir}/codecs/*
%dir %{_qt4_plugindir}/graphicssystems
%{_qt4_plugindir}/graphicssystems/*
%dir %{_qt4_plugindir}/iconengines
%{_qt4_plugindir}/iconengines/*
%dir %{_qt4_plugindir}/imageformats
%{_qt4_plugindir}/imageformats/*
%dir %{_qt4_plugindir}/inputmethods
%{_qt4_plugindir}/inputmethods/*
%dir %{_qt4_plugindir}/script
%{_qt4_plugindir}/script/*

%files -n compat32-%{name}-devel
%defattr(-,root,root,-)
%{_qt4_libdir}/libQt*.so
%{_qt4_libdir}/libQtUiTools.a
%{_qt4_libdir}/libQt*.prl
%endif

%changelog
* Mon Aug 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.8.7-3
- replaced all patches with rawhide's.

* Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.7-2
- rebuild with gcc-5.4.0

* Mon May 09 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.7-1
- update to 4.8.7

* Sun Mar 27 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.6-5
- rebuild with openssl-1.0.2g

* Mon Feb  2 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 4.8.6-4 
- fixed typo in %%postun of designer subpackage 
- removed /sbin/update-alternative --auto from %%postun
- updated SOURCE22 for Icon path
- updated URL

* Sun Feb  1 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 4.8.6-3
- updated Source20, 21, 22 and 23
- added Patch25, 50, 83, 84, 86, 87, 88, 89 and 102 from Fedora
- dropt Patch75
- dropt phonon-gstreamer support, built without gstreamer 0.10.x
- added qdbusviewer.desktops
- added tds subpackage
- changed doc subpackage to noarch.rpm

* Mon Jul 14 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 4.8.6-2
- rebuilt

* Fri Jul 11 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.6-1
- new upstream release
- change BuildRequires: libmysqlclient-devel instead of MySQL-devel
- change BuildRequires: libpq-devel instead of postgresql-devel
- update Patch54,67 from fedora
- remove Patch80 (qt-everywhere-opensource-src-4.8.0-ld-gold.patch)

* Mon Jan 13 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.5-4
- fix BTS:2677

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.5-3
- rebuild with libmng-2.0.2

* Sun Dec 08 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.5-2
- add Patch113 (qt-everywhere-opensource-src-4.8.5-QTBUG-22829.patch)

* Sun Jul 07 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.5-1
- new upstream release
- update patches from fedora
  - Patch4 (qt-everywhere-opensource-src-4.8.5-uic_multilib.patch)
  - Patch28 (qt-everywhere-opensource-src-4.8.5-qt_plugin_path.patch)
  - Patch64 (qt-everywhere-opensource-src-4.8.5-QTBUG-14467.patch)
  - Patch71 (qt-everywhere-opensource-src-4.8.5-QTBUG-21900.patch)
  - Patch74 (qt-everywhere-opensource-src-4.8.5-tds_no_strict_aliasing.patch)
- remove Patch24 (qt-everywhere-opensource-src-4.8.0-rc1-moc-boost148.patch)

* Sat Jan 05 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.4-1
- new upstream release
- add Patch82 (qt-everywhere-opensource-src-4.8.3-QTBUG-4862.patch)
- add Patch100 (qt-everywhere-opensource-src-4.8.1-qtgahandle.patch)
- remove Patch70 (qt-everywhere-opensource-src-4.8.0-QTBUG-14724.patch)

* Sun Oct 28 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 4.8.3-2
- fix mkspecs/%%{platform}/qmake.conf
  - do not replace g++.conf with g++-multilib.conf.
    g++-multilib.conf does not exist.

* Sat Sep 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.3-1
- new upstream release
- update Patch68 (webkit-qtwebkit-2.2-no_Werror.patch)
- remove Patch73: qt-everywhere-opensource-src-4.8.0-qtwebkit-glib231.patch

* Sat Sep 01 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.2-1
- new upstream release
- update Patch68 (webkit-qtwebkit-2.2-no_Werror.patch)
- remove Patch72 (qt-everywhere-opensource-src-4.8.0-QUrl_toLocalFile.patch)
- remove Patch78 (qt-everywhere-opensource-src-4.8.0-filter_event.patch)
- remove Patch79 (qt-everywhere-opensource-src-4.8.0-qvfb.patch)
- add Patch80 (qt-everywhere-opensource-src-4.8.0-ld-gold.patch) from Fedora
- add Patch81 (qt-everywhere-opensource-src-4.8.2--assistant-crash.patch) from Fedora

* Tue Jan 10 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.8.0-3
- fix %%files of compat32-qt4-devel

* Sun Jan  8 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.8.0-2
- added %%pre section to remove symbolic link
- moved translation files to each subpackage

* Sat Jan  7 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.8.0-1
- new upstream release

* Sat Aug 27 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.7.2-6
- rebuilt with MySQL-5.5.15

* Tue May 24 2011 IWAI, Masaharu <iwai@alib.jp> 4.7.2-5
- rebuild with unixODBC-2.2.14: broken by 4.7.2-4
- add Vendor and Distribution tags

* Tue Apr 12 2011 Shu KONNO <owa@bg.wakwak.com> 4.7.2-4
- rebuilt with postgresql-9.0.3

* Mon Apr 11 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.7.2-3
- rebuilt with unixODBC-2.2.14

* Sat Apr  9 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.7.2-2
- added Patch 106, 301 and 302
- fixed /etc/rpm/macros.qt4

* Sun Mar  6 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.7.2-1
- new upstream release
- updated Patch1022
- added config, tools subpackage
- added /etc/rpm/macros.qt4
- updated %%post, %%posttrans and %%postun section

* Sat Jan 29 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.7.1-1
- new upstream release

* Wed Jan 12 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.6.3-3
- rebuild with openssl-1.0.0c
- add BuildRequires: alsa-lib-devel

* Mon Sep 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.3-2
- rebuilt with rpm-4.8.1

* Sat Jul 24 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.3-1
- new upstream release
- moved %{_bindir}/qdbus to main package

* Fri Feb 12 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 4.6.1-5
- rebuilt with gcc-4.4.3-3 on ppc

* Fri Feb  5 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.1-4
- rebuilt with new toolchains

* Sun Jan 31 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.1-3
- added BR: desktop-file-utils

* Sat Jan 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.1-2
- fixed devel %%files (forgot removing documents...)

* Thu Jan 21 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.1-1
- new upstream release
- moved documents to doc sub-package
- updated macros
- installed translation to %%{_datadir}/qt4/translations now

* Sun Nov 22 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.5.3-1
- new upstream release
- dropped Patch90 (merged into upstream)
- updated Patches from Fedora
- added sqlite subpackage

* Wed Sep 02 2009 NAKAMURA Kenta <kenta@vinelinux.org> 4.5.2-2
- added Patch90 for fix CVE-2009-2700

* Wed Aug 26 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.5.2-1
- new upstream release
- updated qt-copy patches
- added Qt.pc
- added BuildRequires: WebKit-gtk-devel

* Thu Jul 23 2009 NAKAMURA Kenta <kenta@vinelinux.org> 4.4.3-4
- added compat32 package for x86_64 arch support

* Sun Apr 26 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.4.3-3
- changed qt4-designer Group to Applications/Development
- updated URL
- remove Requires: XOrg-libs, XOrg-gl

* Tue Mar 24 2009 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.4.3-2
- update qt-copy patches

* Mon Nov 24 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.4.3-1
- new upstream release
- update qt-copy patches

* Tue Nov 11 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.4.2-2
- update qt-copy patches

* Mon Sep 22 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.4.2-1
- new upstream release
- update qt-copy patches

* Tue Sep 02 2008 Shu KONNO <owa@bg.wakwak.com> 4.4.1-2
- fixed symbolic-link path of %{_bindir}/* at %%install section (for lib64)

* Mon Aug  4 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.4.1-1
- new upstream release
- update qt-copy patches

* Sun Jul  6 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.4.0-1
- new upstream release
- update qt-copy patches
- add -no-phonon

* Mon Mar 24 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.4-1
- fix release ([VineSeed:1527])
- add BuildPrereq: gcc4 gcc4-c++ for Vine 4.x
- add Requires(post,postun): alternatives to -devel and -designer package

* Tue Mar  4 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.4-0vl1
- new upstream release
- update qt-copy patches

* Wed Feb  6 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.3-0vl2
- update qt-copy patches

* Thu Dec  6 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.3-0vl1
- new upstream release
- update and re-number qt-copy patches
- add BuildPrereq: glib2-devel
- update URL

* Fri Nov  2 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.2-0vl1
- new upstream release
- update qt-copy patches

* Tue Sep 18 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.1-0vl2
- update qt-copy patches (CVE-2007-4137)

* Wed Aug 15 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.1-0vl1
- new upstream release
- update qt-copy patches

* Thu Jun 28 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.0-0vl1
- new upstream release
- add qt-copy patches

* Wed May 16 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.3.0-0vl0.20070423
- new upstream release

* Mon Mar 12 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.2.3-0vl1
- new upstream release

* Tue Oct 31 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.2.1-0vl1
- new upstream release
- add ld.so.conf.d and qt4.conf
- BuildPrereq: dbus-devel >= 0.62

* Fri Oct  6 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.2.0-0vl1
- new upstream release
- remove static package

* Mon Sep 25 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 4.1.4-0vl1
- new upstream release
- update %%fiels
- remove Xt and styles package
- add BuildPrereq: postgresql-libs MySQL-shared
- remove all patches

* Tue Sep 19 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.5-0vl4
- move %%{_libdir}/qt3 from develop to main
- fix typo
- add patch503
 -- Thu Sep 14 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.3.5-0vl2.0imm.1
  - import qt-x11-immodule-unified-quiet.patch (patch503) from FC
- add patch500-502
 -- Thu Sep 14 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.3.5-0vl2.0imm
  - add immodule for Qt support (patch500-502)
    - patch500: revert some part of patch300,301 (conflict with patch501)
    - patch501: immodule for Qt patch
    - patch502: apply some part of patch300,301 again
    cf. http://immodule-qt.freedesktop.org/
        http://people.freedesktop.org/~daisuke/

* Sun Sep 10 2006 NAKAMURA Kenta <kenta@vinelinux.org> 3.3.5-0vl3
- added configure options for builing on 64-bit archs

* Tue Sep 13 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.5-0vl2
- rebuild for VineSeed

* Tue Sep 13 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.5-0vl1
- new upstream release
- stop building nonthreaded libs
- delete Obsoletes
- add Patch0

* Tue Jul  5 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.4-0vl6
- rebuild for VineSeed

* Tue Jul  5 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.4-0vl5
- build for Vine3.1
- add -v to configure option
- move three static libs to main package

* Wed Mar 16 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.4-0vl4
- rebuild for VineSeed

* Sat Mar 12 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.4-0vl3
- (security) stop using rpath
- cleanup this file

* Thu Feb 17 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.4-0vl2
- rebuild for VineSeed

* Thu Feb 17 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.4-0vl1
- new upstream release
- update Patch400

* Sat Dec 11 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.3-0vl3
- rebuld

* Wed Nov 17 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.3-0vl2
- add Obsoletes: qt32-*

* Sun Sep  5 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.3-0vl1
- source upgrade
- remove patch100
- update patch300 and remove patch302-303
- update patch400
- update BuildPrereq and Requires

* Wed Jul 28 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.2-0vl3
- add patch302-303 from KuserML
- delete lines about vine26

* Sun Jun  6 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.2-0vl2
- add patch100 from webcvs.kde.org/cgi-bin/cvsweb.cgi/qt-copy/patches/

* Fri Apr 30 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.2-0vl1
- source upgrade
- remove patch100 (it is needed only for 3.3.1)

* Sun Apr 18 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.1-0vl3
- rebuild with XOrg

* Mon Mar 29 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.1-0vl2
- rebuild

* Mon Mar  8 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.3.1-0vl1
- source upgrade
- remove patch800
- add patch100 (only for qt-x11-free-3.3.1)

* Sun Feb  1 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.3-0vl3
- enable cups support

* Sun Dec 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.3-0vl2
- build for VineSeed with new toolchain
- disable cup support

* Wed Dec  3 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.3-0vl1
- source upgrade
- revised Patch402 and 403
- remove Patch100
- add patch800 to build against freetype2-2.1.7
- (VinePlus/2.6) BuildPrereq: autoconf258

* Sun Nov  9 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.2-0vl1
- source upgrade
- revised Patch400
- remove Patch15

* Sun Nov  2 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0vl4
- enable cups support

* Sun Oct 19 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0.26vl3
- rebuild for Vine2.6

* Sun Oct 19 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0vl3
- revised Patch400 and Patch402
- clean up spec

* Sun Sep 28 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0.26vl2
- rebuild for Vine2.6

* Sun Sep 28 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0vl2
- revised Patch400-
- clean up spec

* Mon Sep 15 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0.26vl1
- rebuild for Vine2.6

* Mon Sep 15 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.2.1-0vl1
- source upgrade
- add Patch100
- remove Patch302 (it is included in this source)
- stop using Patch400-
- build with gcc-3.2.3
- add export LANG=C
- add *.pc (pkg-config files) to qt-devel package

* Fri Aug 15 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.2-0.26vl5
- rebuild for Vine2.6

* Wed Aug 13 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.2-0vl5
- add Patch302 to fix performance of jmode
- change make option for SMP and add script

* Thu Jun 19 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.2-0vl4
- update Patch400 and 401

* Wed Jun 18 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.2-0vl3
- change spec to build with g++-2.95.3

* Mon Apr 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.2-0.26vl2
- rebuild for Vine2.6

* Wed Apr 16 2003 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 3.1.2-0vl2
- rebuilt with libpng >= 1.2.5 when %%{vine26} is set to 0 (ie VineSeedPlus)

* Fri Mar 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.2-0vl1
- source upgrade
- remove all patches except patch15
- revised patch 300-
- stop building Xt package

* Mon Feb 24 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.1-0vl3
- revised patch 301 and 302
- enable patch 301 and 302 to Vine2.5/2.6

* Sun Feb  9 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.1-0vl2
- change spec to build both VineSeed and Vine2.5/2.6
- re-number patch300-
- delete patch4 (qt-3.1.1 does not need it)
- add patch13 and 14
 -- Thu Dec 19 2002 Than Ngo <than@redhat.com> 3.1.1-3
  - add monospace patch file from Leon Ho (bug #79949)
  - add small patch file from Sysoltsev Slawa (bug #79731)
- add patch15
 -- Mon Dec 30 2002 Florian La Roche <Florian.LaRoche@redhat.de>
  - Change qmlined.h to not include an attic header that is also not shipped
    with Red Hat Linux. This also fixes building unixODBC, that includes this
    header (apparently also without needing it).


* Sat Jan  4 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.1-0vl1
- source upgrade
- cleanup spec
- revised Patch7, 301
- add Patch306, 307, 308 from kde.gr.jp

* Sun Dec 15 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.1.0-0vl1
- source upgrade
- stop using objprelink2, it does not work with gcc3
- add Patch304 and Patch305 from www.kde.gr.jp/~akito/xft/patch_xft.html
- add Patch1 - Patch12 from rawhide 3.1.0-1.3
- add BuildPrereq: openMotif-devel >= 2.2.2 for build qt-Xt
- cleanup spec for build x11 package only

* Mon Nov 11 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.0.5-0vl3
- add export PATH=`pwd`:$PATH to %build section

* Tue Oct 15 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.0.5-0vl2
- objprelink2 support only i386 (add %ifarch i386 ... again)
- delete BuildPrereq: libmng-static (it merged to libmng-devel)
- delete %doc ANNOUNCE
- Requires: XFree86-gl instead of Mesa

* Fri Oct  4 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.0.5-0vl1
- add BuildPrereq: objprelink2 instead of BuildPrereq: objprelink
- add BuildPrereq: autoconf253 automake15
- delete Patch199 (objprelink2 do not need this patch)
- source upgrade
- revised all patches [Kdeveloper:02404]
- add man files to qt-devel sub-package

* Tue Jul 16 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 3.0.3-1vl5
- add patch304 from kde.gr.jp [Kdeveloper:02368]

* Thu Jul  4 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 3.0.3-1vl4
- add patch303 from kde.gr.jp [Kdeveloper:02378]

* Wed Apr 17 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 3.0.3-1vl3
- add patch302 from kde.gr.jp

* Thu Apr  4 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 3.0.3-1vl2
- revised patch300 from kde.gr.jp and XIMInputStyle=Over The Spot in qtrc
- add patch301 from kde.gr.jp
- make unixODBC plugin (delete define odbcplugins 0 and if %{odbcplugins})

* Sat Mar 30 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 3.0.3-1vl1
- merged with rawhide 3.0.3-0.cvs20020314.1
- source update to 3.0.3
- add patch199 (objprelink)
- add patch300 and add defaultInputStyle=OverTheSpot in qtrc
- define cups 0 (Vine does not have cups)
- define odbcplugins 0 (unixODBC requires libqt-mt.so.2 of qt-2)
- cleanup spec
- There is Vine's previous changes, hacked for Vine 
 -- Sat Jan  5 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 2.3.1-6vl4
  - rebuild with -xft support (XFree86-4.1.99.4)
 -- Mon Dec 31 2001 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.3.1-6vl3
  - rebuild with glibc-2.2.4
 -- Sun Nov 25 2001 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.3.1-6vl2
  - add Source2 and Patch4 (use objprelink, i386 only)
 -- Sat Oct 13 2001 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.3.1-6vl1
  - Build for VineSeed
  - Add qt.using_new_library.patch from Kondara
 -- Mon Jun 11 2001 net_hal <net_hal@cwa.bai.ne.jp>
  - First build for Vine2.1.5
 -- Thu Apr 12 2001 Rex Dieter <rdieter@unl.edu> 2.3.0-0.6x.3
  - redhat 6.x backport based on rawhide's qt-2.3.0-3
  - remove -xft support (because we're using XFree-3)    

* Thu Mar 14 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.3-0.cvs20020314.1
- Update to 3.0.3-pre, required for KDE3
- force -fPIC usage
- Remove conflict with qt2 < 2.3.2-1, the new qt2 2.3.1 is fixed and qt 2.3.2
  is broken
- Ship the qmake config files (so qmake works for building any 3rd party stuff,
  e.g. aethera)

* Wed Mar  6 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-2
- Add some fixes from KDE's qt-copy CVS
- Pluginize image formats

* Mon Feb 25 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-1
- 3.0.2 final

* Tue Feb 19 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-0.cvs20020118.3
- Add GB18030 codec patch, #60034
- Force-build jpeg support, fixing #59775 and #59795

* Sat Jan 26 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-0.cvs20020118.2
- Build with CUPS support

* Fri Jan 18 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-0.cvs20020118.1
- Fix up /usr/bin/moc links, they should point to qt3

* Mon Jan 14 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-0.cvs20020114.1
- Build styles directly into the main library for now, there's too much broken
  code out there depending on this ATM.

* Wed Jan  9 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-0.cvs20020109.1
- Stop excluding alpha, gcc has been fixed

* Tue Jan  8 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.2-0.cvs20020108.1
- Add fixes from CVS; this fixes the "Alt + F1, arrow up, arrow up doesn't work
  in KDE" bug

* Mon Dec 17 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.1-2
- Fix up settings search path
- Add default qtrc allowing to use KDE 3.x Qt plugins
- Make sure QLibrary uses RTLD_GLOBAL when dlopen()ing libraries

* Thu Dec 13 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.1.0-1
- Work around gcc bug #57467

* Wed Dec 12 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 3.0.1 final

* Mon Dec 10 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.1-0.cvs20011210.1
- Update to current (needed by KDE 3.x)
- Rebuild with current libstdc++
- Temporarily disable building on alpha
- Fix build with PostgreSQL 7.2

* Mon Nov 26 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-5
- Fix up glweak

* Mon Nov  5 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-4
- Give designer, uic, moc, etc. their real names - the qt2 versions
  have been renamed in qt2-2.3.2-1.
  Conflict with qt2 < 2.3.2-1.

* Thu Oct 25 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-3
- Add symlink /usr/lib/qt-3.0.0 -> /usr/lib/qt3 and set QTDIR to the
  symlink, allowing to update to 3.0.1 without breaking rpath'ed binaries

* Tue Oct 16 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-1
- 3.0.0 final
- fix some minor specfile bugs
- Modularize some more (image format plugins)
- Build codecs

* Tue Sep 18 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta5.1
- beta5
- Share more code between qt-x11 and qt-embedded builds

* Wed Aug 29 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta4.1
- beta4
- build the Motif style directly into Qt rather than as a plugin - Qt should
  always have at least one style...
- replace the designer3 symlink with a shell script that sets QTDIR correctly
  before launching designer
- Add desktop file for designer

* Mon Aug  6 2001 Tim Powers <timp@redhat.com> 3.0.0-0.beta3.4
- explicitly include qm2ts, qmake, qtconfig in the devel package file list to avoid dangling symlinks

* Thu Aug  2 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta3.3
- Try yet another workaround for buildsystem breakages

* Tue Jul 31 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Add another ugly workaround for build system problems, this should finally
  get rid of the dangling symlinks

* Tue Jul 31 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta3.2
- Rephrase parts of the spec file, hopefully pleasing the build system

* Sun Jul 29 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta3.1
- beta3
- Fix dangling symlinks

* Sun Jun 24 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta1.2
- Fix up QSQL Postgres classes for Postgres 7.1.x
- Fix various bugs:
  - QtMultilineEdit and QtTableView should actually compile
  - Link libqsqlpsql with libpq
  - Don't link the base library with libmysqlclient, linking the MySQL
    module with it is sufficient
- Add missing const qualifier
- move the SQL drivers to separate packages to avoid dependencies
- build and install designer plugins - converting glade files to Qt is fun. ;)
- handle RPM_OPT_FLAGS

* Tue May 22 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.beta1.1
- 3.0 beta 1

* Wed May 16 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.cvs20010516.1
- Update, remove conflicts with Qt 2.x

* Mon May 14 2001 Bernhard Rosenkraenzer <bero@redhat.com> 3.0.0-0.cvs20010514.1
- Initial build of 3.0 branch

* Fri Apr 27 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.3.0-6
- Fix crashes on ia64, Patch from Bill Nottingham <notting@redhat.com>
- Allow building qt-nox

* Fri Apr 20 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.3.0-5
- Make sure uic and designer use the libqui from the source tree, not
  a previously installed one.
  Linking uic-x11 against libqui-embedded is definitely not a feature. ;)
- The qclipboard fix is needed for qt-x11 only, don't apply it if we're
  building qt-embedded

* Sat Apr 14 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Handle LPRng specific constructs in printcap, Bug #35937

* Sun Mar 25 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- add qfont patch from Trolltech

* Tue Mar 13 2001 Harald Hoyer <harald@redhat.de>
- added patch for '@euro' language settings

* Tue Mar  6 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.3.0 final
- BuildRequires XFree86-devel >= 4.0.2 (#30486)

* Mon Feb 26 2001 Than Ngo <than@redhat.com>
- fix check_env function, so that qt does not crash if QT_XFT is not set
- fix symlinks

* Mon Feb 26 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.3.0b1
- Add a patch to qpsprinter that handles TrueType fonts even if they come from xfs

* Tue Feb 13 2001 Preston Brown <pbrown@redhat.com>
- japanese input and clipboard fixes applied.  Changes have been sent upstream by patch authors.

* Fri Feb  9 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Rebuild with new Mesa to get rid of pthreads linkage
- Add Xft fix from KDE CVS

* Wed Feb  7 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Add printing bugfix patch from Trolltech

* Sat Feb  3 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.2.4
- Qt Embedded: Add QVfb and VNC support

* Tue Jan 16 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Don't segfault when running Qt/Embedded applications as root
- Improve the Qt/Embedded sparc patch so we don't need the specfile hacks
  anymore
- Fix a bug in QPrintDialog (causing KDE Bug #18608)

* Thu Jan 11 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- bzip2 source to save space
- Qt/Embedded 2.2.3
- Fix qte build on sparc

* Wed Dec 20 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Run ldconfig in %%post and %%postun for qt-Xt

* Sun Dec 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Build with the Xrender extension
  (Patch from Keith Packard <keithp@keithp.com>)

* Wed Dec 13 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.2.3

* Tue Dec 12 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Rebuild to fix permissions on doc dir
- Don't exclude ia64 anymore

* Fri Nov 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix up uic (Patch from trolltech) 

* Wed Nov 15 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Build qt-embedded
  changes to base: fix build, fix ISO C99 compliance, fix 64bit support

* Mon Nov 13 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.2.2

* Tue Oct 24 2000 Than Ngo <than@redhat.com>
- call ldconfig for updating (Bug #19687)
- added patch from Trolltech, thanks to Rainer <rms@trolltech.com>

* Wed Oct 18 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Add missing msg2qm, msgmerge, qconfig tools (Bug #18997), introduced
  by broken Makefiles in base
- fix up %%install so it works both with old-style and new-style fileutils
  (fileutils <= 4.0z don't know about -L)

* Fri Oct 13 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Disable exception handling; this speeds up KDE 2.x and reduces its
  memory footprint by 20 MB.

* Tue Oct 10 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- dereference symlinks in include

* Sun Oct  8 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- fix -devel
- update to the new version of 2.2.1 on trolltech.com; the initial tarball
  contained broken docs

* Thu Oct  5 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.2.1

* Mon Sep 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Add missing uic

* Thu Sep 21 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Move Qt designer to a different source RPM to get rid of a
  circular dependency (kdelibs2->qt, qt->kdelibs2)
- Enable MNG support
- Don't compile (just include) examples and tutorials
- move the static libraries to a separate package (qt-static).
  They're HUGE, and most people won't ever need them.
- clean up spec file
- fix up dependencies (-devel requires base, -static requires devel,
  Xt requires base)
- add BuildRequires line

* Tue Sep 12 2000 Than Ngo <than@redhat.com>
- update release 2.2.0
- changed copyright to GPL
- added missing static libraries
- made symbolic link for designer to load the help files correct
- made designer and designer-kde2 as sub packages
- added missing templates for designer
- remove jakub patch, since the release 2.2.0 already 
  contains this patch.
- fixed qt again to compile with gcc-2.96
- use make -j for building

* Wed Aug 23 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Work around compiler bugs (Patch from Jakub)
- Use relative symlinks (Bug #16750)

* Mon Aug 21 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- beta2

* Mon Aug 14 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new qt-copy from KDE2 CVS

* Wed Aug 9 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- official beta 1

* Thu Aug 3 2000 Than Ngo <than@redhat.de>
- rebuilt against the libpng-1.0.8

* Thu Jul 27 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- rebuild (so we have it on all arches)

* Tue Jul 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- move man pages to a more reasonable place (this fixes Bug #14126)
- exclude ia64 for now (compiler problems!!!)

* Mon Jul 24 2000 Harald Hoyer <harald@redhat.de>
- modified connect patch to fit qt 2.2.0 beta.

* Thu Jul 20 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- update to current qt-copy; this is now a qt 2.2.0 beta.

* Mon Jul 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- update to current qt-copy in kde CVS, required

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Tue Jul 11 2000 Harald Hoyer <harald@redhat.de>
- made patch smaller and binary compatible when recompiled with 6.2
- modified connect and moc to cope with the new g++ class layout

* Sun Jul 09 2000 Than Ngo <than@redhat.de>
- rebuilt qt with gcc-2.96-34

* Fri Jul 07 2000 Than Ngo <than@redhat.de>
- rebuilt qt with c++ 2.96

* Mon Jul  3 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix dependancies

* Sun Jul  2 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Use egcs++ for now ** FIXME

* Wed Jun 28 2000 Preston Brown <pbrown@redhat.com>
- fix up qt.sh

* Sun Jun 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Build in jpeg and threading support
- Fix a bug in clipboard pasting code

* Wed Jun 07 2000 Preston Brown <pbrown@redhat.com>
- fix qt.{sh,csh}
- use new rpm macro paths
- package man pages

* Fri Jun  2 2000 Bill Nottingham <notting@redhat.com>
- build without optimization on ia64

* Mon May 29 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.1.1

* Thu May 18 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- recompile with correct libstdc++

* Thu Apr 13 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.1.0 final

* Wed Apr  5 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- beta4
- depend on libGL.so.1 rather than Mesa - XFree86 4.0 provides that
  lib, too

* Wed Mar 22 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- beta3

* Tue Mar  7 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- beta2
- fix compilation of the NSPlugin add-on

* Fri Mar  3 2000 Bill Nottingham <notting@redhat.com>
- fix %postun script

* Fri Feb 18 2000 Bernhard Rosenkr?nzer <bero@redhat.com>
- beta1
- get rid of qt-ImageIO, the functionality is now in the main Qt library
- remove qt-Network, the functionality is now in the main Qt library
- add changes-2.1.0 to %doc

* Thu Feb 17 2000 Preston Brown <pbrown@redhat.com>
- no refcount check on postun script, we want it to happen even on upgrades

* Thu Feb 10 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot, should fix QWhatsThisButton
- remove executable permissions from *.pro files

* Mon Feb 07 2000 Preston Brown <pbrown@redhat.com>
- strip binaries in examples, tutorial

* Mon Jan 31 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot - should fix the hotkey bug
- Fix up the Makefiles so it compiles

* Tue Jan 18 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot - we need those QVariant fixes

* Thu Jan 13 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- switch from glxMesa to Mesa for the GL addon

* Wed Jan 5 2000 Bernhard Rosenkr?nzer <bero@redhat.com>
- Fix up dependencies
- new snapshot

* Mon Jan 3 2000 Ngo Than <than@redhat.de>
- new snapshot for Red Hat Linux 6.2
- increase version number

* Mon Dec 20 1999 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot
- handle RPM_OPT_FLAGS

* Mon Dec 13 1999 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot
- -GL requires libGL.so.1 instead of Mesa (might as well be glxMesa
  or some commercial OpenGL)
- -GL BuildPrereqs /usr/X11R6/include/GL/gl.h instead of Mesa-devel
  (might as well be glxMesa or some commercial OpenGL)

* Sun Dec 05 1999 Bernhard Rosenkraenzer <bero@redhat.com>
- update to current RSYNC version
- remove compilation patch - it finally works out of the box

* Wed Oct 27 1999 Bernhard Rosenkraenzer <bero@redhat.com>
- update to current CVS snapshot
- build extensions
- add patch to fix QNetwork compilation

* Sun Oct 24 1999 Bernhard Rosenkraenzer <bero@redhat.de>
- current CVS snapshot
- fix compilation with gcc 2.95.x
- use install -c rather than just install to make BSD install happy

* Mon Oct 11 1999 Bernhard Rosenkraenzer <bero@redhat.de>
- 2.1.0 snapshot (for KDE2)
- Fix typo in spec

* Thu Sep 23 1999 Preston Brown <pbrown@redhat.com>
- don't ship tutorial or example binaries

* Tue Sep 21 1999 Preston Brown <pbrown@redhat.com>
- substitution in tutorial and examples so that dependencies are correct and
  they can be successfully rebuilt.
- switched to completely using QTDIR.  trying to coexist with links into
  /usr/{include,lib} and still compile with qt 1.x is very hard for
  configure scripts to cope with.

* Thu Aug 19 1999 Preston Brown <pbrown@redhat.com>
- implemented QTDIR compatibility.

* Tue Jul 20 1999 Preston Brown <pbrown@redhat.com>
- qt 2.0.1 packaged.

* Wed Jul 14 1999 Preston Brown <pbrown@redhat.com>
- Qt 2.00 packaged.
- examples, html documentation, tutorial moved to /usr/doc

* Sat Apr 17 1999 Preston Brown <pbrown@redhat.com>
- static library supplied in dev package.

* Wed Apr 07 1999 Preston Brown <pbrown@redhat.com>
- turn on internal GIF reading support

* Tue Apr 06 1999 Preston Brown <pbrown@redhat.com>
- strip binaries

* Mon Mar 15 1999 Preston Brown <pbrown@redhat.com>
- upgrade to qt 1.44.

* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.

* Tue Jan 19 1999 Preston Brown <pbrown@redhat.com>
- moved includes to /usr/include/qt

* Mon Jan 04 1999 Preston Brown <pbrown@redhat.com>
- made setup phase silent.

* Fri Dec 04 1998 Preston Brown <pbrown@redhat.com>
- upgraded to qt 1.42, released today.

* Tue Dec 01 1998 Preston Brown <pbrown@redhat.com>
- took Arnts RPM and made some minor changes for Red Hat.
