Blob Blame History Raw
%?mingw_package_header

# Override the __debug_install_post argument as this package
# contains both native as well as cross compiled binaries
%global __debug_install_post %%{mingw_debug_install_post}; %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%%{?buildsubdir}" %{nil}

#%%global pre rc2

#%%global snapshot_date 20121110
#%%global snapshot_rev d725239c

%global platform_win32 win32-g++-cross
%global platform_win64 win32-g++-cross-x64

%if 0%{?snapshot_date}
%global source_folder qt-qtbase
%else
%global source_folder qtbase-opensource-src-%{version}%{?pre:-%{pre}}
%endif

Name:           mingw-qt5-qtbase
Version:        5.0.2
Release:        3%{?pre:.%{pre}}%{?snapshot_date:.git%{snapshot_date}.%{snapshot_rev}}%{?dist}
Summary:        Qt5 for Windows - QtBase component

License:        GPLv3 with exceptions or LGPLv2 with exceptions
Group:          Development/Libraries
URL:            http://www.qtsoftware.com/

%if 0%{?snapshot_date}
# To regenerate:
# wget http://qt.gitorious.org/qt/qtbase/archive-tarball/%{snapshot_rev} -O qt5-qtbase-%{snapshot_rev}.tar.gz
Source0:        qt5-qtbase-%{snapshot_rev}.tar.gz
%else
Source0:        http://releases.qt-project.org/qt5/%{version}/submodules/qtbase-opensource-src-%{version}%{?pre:-%{pre}}.tar.xz
%endif

# Special cross-compilation qmake target.
Source1:        qmake.conf.win32
Source2:        qmake.conf.win64

# Try harder to locate external OpenSSL libraries
# https://codereview.qt-project.org/#change,47079
Patch2:         qt5-fix-detection-of-openssl.patch

# When building Qt as static library some files have a different content
# when compared to the static library. Merge those changes manually.
# This patch also applies some additional changes which are required to make
# linking against the static version of Qt work without any manual fiddling
Patch3:         qt5-merge-static-and-shared-library-trees.patch

# Add support for Angle
Patch9:         qt5-add-angle-support.patch

# Make sure our external Angle package is used instead of the bundled one
Patch10:        qt5-use-external-angle-library.patch

# Prevent a segfault when no suitable platform plugin could be detected
Patch11:        qt5-dont-segfault-when-platform-dll-cant-be-found.patch

# Make sure QT_NEEDS_QMAIN is defined for our mkspecs profiles
Patch12:        qt5-define-qt-needs-qmain-for-win32-g++-targets.patch

# Workaround cross-compilation issue when using a non-x86 host
# https://bugzilla.redhat.com/show_bug.cgi?id=905863
# https://bugreports.qt-project.org/browse/QTBUG-29426
Patch13:        qt5-workaround-qtbug-29426.patch

# While building qdbusviewer (part of mingw-qt5-qttools) the build fails
# because various QtDBus headers use the keyword 'interface' which is a
# reserved keyword on Win32 environments (defined in rpc.h)
Patch14:        qt5-prevent-conflict-with-interface-keyword.patch

# Make sure the .pc files of the Qt5 modules are installed correctly
# This should prevent (silent) failures like:
# sed -e "s,/usr/i686-w64-mingw32/sys-root/mingw/include,/usr/i686-w64-mingw32/sys-root/mingw/include/qt5,g" -e "s,/usr/i686-w64-mingw32/sys-root/mingw/lib,/usr/i686-w64-mingw32/sys-root/mingw/lib,g" "../../../build_win32/lib/pkgconfig/Qt5AxContainer.pc" >"/home/erik/rpmbuild/BUILDROOT/mingw-qt5-qtactiveqt-5.0.1-1.fc18.x86_64/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig/Qt5AxContainer.pc"
# sed: can't read ../../../build_win32/lib/pkgconfig/Qt5AxContainer.pc: No such file or directory
# make[5]: [install_target] Error 2 (ignored)
#
# This issue was discovered during the review of mingw-qt5-qttools:
# https://bugzilla.redhat.com/show_bug.cgi?id=858080
Patch15:        qt5-workaround-pkgconfig-install-issue.patch

# Fix compilation of the DirectWrite specific code
# Commit 9a89d614f26262fcb6895d1dab93519d732ba011
Patch16:        qt5-dwrite-compile-fix.patch

# Display message box if platform plugin cannot be found
# Commit 7ead3a39c71949e28d682f893f8b4037e25d7259
Patch17:        qt5-qtbase-display-message-box-if-platform-plugin-cannot-be-found.patch


BuildRequires:  mingw32-filesystem >= 95
BuildRequires:  mingw32-gcc
BuildRequires:  mingw32-gcc-c++
BuildRequires:  mingw32-binutils
BuildRequires:  mingw32-openssl
BuildRequires:  mingw32-zlib
BuildRequires:  mingw32-win-iconv
BuildRequires:  mingw32-libjpeg-turbo
BuildRequires:  mingw32-libpng
BuildRequires:  mingw32-libtiff
BuildRequires:  mingw32-sqlite
BuildRequires:  mingw32-dbus
BuildRequires:  mingw32-pkg-config
BuildRequires:  mingw32-angleproject

BuildRequires:  mingw64-filesystem >= 95
BuildRequires:  mingw64-gcc
BuildRequires:  mingw64-gcc-c++
BuildRequires:  mingw64-binutils
BuildRequires:  mingw64-openssl
BuildRequires:  mingw64-zlib
BuildRequires:  mingw64-win-iconv
BuildRequires:  mingw64-libjpeg-turbo
BuildRequires:  mingw64-libpng
BuildRequires:  mingw64-libtiff
BuildRequires:  mingw64-sqlite
BuildRequires:  mingw64-dbus
BuildRequires:  mingw64-pkg-config
BuildRequires:  mingw64-angleproject

BuildRequires:  zip
BuildRequires:  dos2unix

# Needed for Angle support
BuildRequires:  flex
BuildRequires:  bison


%description
This package contains the Qt software toolkit for developing
cross-platform applications.

This is the Windows version of Qt, for use in conjunction with the
Fedora Windows cross-compiler.


# Win32
%package -n mingw32-qt5-qtbase
Summary:        Qt5 for Windows - QtBase component
# This package contains the cross-compiler setup for qmake
Requires:       mingw32-qt5-qmake = %{version}-%{release}
BuildArch:      noarch

%description -n mingw32-qt5-qtbase
This package contains the Qt software toolkit for developing
cross-platform applications.

This is the Windows version of Qt, for use in conjunction with the
Fedora Windows cross-compiler.

%package -n mingw32-qt5-qmake
Summary:       Qt5 for Windows build environment
Requires:      mingw32-qt5-qttools-lrelease

%description -n mingw32-qt5-qmake
This package contains the build environment for cross compiling
applications with the Fedora Windows Qt Library and cross-compiler.

%package -n mingw32-qt5-qtbase-devel
Summary:       Qt5 for Windows build environment
Requires:      mingw32-qt5-qtbase = %{version}-%{release}

%description -n mingw32-qt5-qtbase-devel
Contains the files required to get various Qt tools built
which are part of the mingw-qt5-qttools package

%package -n mingw32-qt5-qtbase-static
Summary:       Static version of the mingw32-qt5-qtbase library
Requires:      mingw32-qt5-qtbase = %{version}-%{release}
BuildArch:     noarch

%description -n mingw32-qt5-qtbase-static
Static version of the mingw32-qt5 library.

# Win64
%package -n mingw64-qt5-qtbase
Summary:        Qt5 for Windows - QtBase component
# This package contains the cross-compiler setup for qmake
Requires:       mingw64-qt5-qmake = %{version}-%{release}
BuildArch:      noarch

%description -n mingw64-qt5-qtbase
This package contains the Qt software toolkit for developing
cross-platform applications.

This is the Windows version of Qt, for use in conjunction with the
Fedora Windows cross-compiler.

%package -n mingw64-qt5-qmake
Summary:       Qt for Windows build environment
Requires:      mingw64-qt5-qttools-lrelease

%description -n mingw64-qt5-qmake
This package contains the build environment for cross compiling
applications with the Fedora Windows Qt Library and cross-compiler.

%package -n mingw64-qt5-qtbase-devel
Summary:       Qt5 for Windows build environment
Requires:      mingw64-qt5-qtbase = %{version}-%{release}

%description -n mingw64-qt5-qtbase-devel
Contains the files required to get various Qt tools built
which are part of the mingw-qt5-qttools package

%package -n mingw64-qt5-qtbase-static
Summary:       Static version of the mingw64-qt5-qtbase library
Requires:      mingw64-qt5-qtbase = %{version}-%{release}
BuildArch:     noarch

%description -n mingw64-qt5-qtbase-static
Static version of the mingw64-qt5-qtbase library.


%?mingw_debug_package


%prep
%setup -q -n %{source_folder}

%patch2 -p0
%patch3 -p0
%patch9 -p0 -b .angle
%patch10 -p0 -b .external_angle
%patch11 -p0 -b .platform_segv
%patch12 -p0 -b .qt_needs_qmain
%patch13 -p0 -b .non_x86
%patch14 -p0 -b .interface
%patch15 -p0 -b .pkgconfig
%patch16 -p1 -b .dwrite
%patch17 -p1 -b .platform_msgbox

# Cross-compilation qmake target.
mkdir mkspecs/%{platform_win32}
mkdir mkspecs/%{platform_win64}
cp %{SOURCE1} mkspecs/%{platform_win32}/qmake.conf
cp %{SOURCE2} mkspecs/%{platform_win64}/qmake.conf
cp mkspecs/win32-g++/qplatformdefs.h mkspecs/%{platform_win32}
cp mkspecs/win32-g++/qplatformdefs.h mkspecs/%{platform_win64}

# Make sure the Qt5 build system uses our external ANGLE library
rm -rf src/3rdparty/angle


%build
# Generic configure arguments
qt_configure_args_generic="\
    -optimized-qmake \
    -verbose \
    -opensource \
    -confirm-license \
    -force-pkg-config \
    -force-debug-info \
    -audio-backend \
    -system-zlib \
    -system-libpng \
    -system-libjpeg \
    -system-sqlite \
    -no-fontconfig \
    -iconv \
    -openssl \
    -dbus-linked \
    -no-glib \
    -no-gtkstyle \
    -no-icu \
    -release \
    -nomake examples \
    -make tools \
    -make demos"

qt_configure_args_win32="\
    -prefix %{mingw32_prefix} \
    -bindir %{mingw32_bindir} \
    -archdatadir %{mingw32_datadir}/qt5 \
    -datadir %{mingw32_datadir}/qt5 \
    -docdir %{mingw32_docdir}/qt5 \
    -examplesdir %{mingw32_datadir}/qt5/examples \
    -headerdir %{mingw32_includedir}/qt5 \
    -libdir %{mingw32_libdir} \
    -plugindir %{mingw32_libdir}/qt5/plugins \
    -sysconfdir %{mingw32_sysconfdir} \
    -translationdir %{mingw32_datadir}/qt5/translations \
    -xplatform %{platform_win32}"

qt_configure_args_win64="\
    -prefix %{mingw64_prefix} \
    -bindir %{mingw64_bindir} \
    -archdatadir %{mingw64_datadir}/qt5 \
    -datadir %{mingw64_datadir}/qt5 \
    -docdir %{mingw64_docdir}/qt5 \
    -examplesdir %{mingw64_datadir}/qt5/examples \
    -headerdir %{mingw64_includedir}/qt5 \
    -libdir %{mingw64_libdir} \
    -plugindir %{mingw64_libdir}/qt5/plugins \
    -sysconfdir %{mingw64_sysconfdir} \
    -translationdir %{mingw64_datadir}/qt5/translations \
    -xplatform %{platform_win64}"

# RPM automatically sets the environment variable PKG_CONFIG_PATH
# to point to the native pkg-config files, but while cross compiling
# we don't want to have this environment variable set
unset PKG_CONFIG_PATH

###############################################################################
# Win32
#
# We have to build Qt two times, once for the static release build and
# once for the shared release build
#
# Unfortunately Qt only supports out-of-source builds which are in ../some_folder
rm -rf ../build_release_static_win32
mkdir ../build_release_static_win32
pushd ../build_release_static_win32
../%{source_folder}/configure \
    -static \
    $qt_configure_args_win32 $qt_configure_args_generic
make %{?_smp_mflags}
popd

rm -rf ../build_release_shared_win32
mkdir ../build_release_shared_win32
pushd ../build_release_shared_win32
../%{source_folder}/configure \
    -shared \
    $qt_configure_args_win32 $qt_configure_args_generic
make %{?_smp_mflags}
popd

###############################################################################
# Win64
#
# We have to build Qt two times, once for the static release build and
# once for the shared release build
#
# Unfortunately Qt only supports out-of-source builds which are in ../some_folder
rm -rf ../build_release_static_win64
mkdir ../build_release_static_win64
pushd ../build_release_static_win64
../%{source_folder}/configure \
    -static \
    $qt_configure_args_win64 $qt_configure_args_generic
make %{?_smp_mflags}
popd

rm -rf ../build_release_shared_win64
mkdir ../build_release_shared_win64
pushd ../build_release_shared_win64
../%{source_folder}/configure \
    -shared \
    $qt_configure_args_win64 $qt_configure_args_generic
make %{?_smp_mflags}
popd


%install
make install -C ../build_release_shared_win32$BUILDDIR INSTALL_ROOT=$RPM_BUILD_ROOT
make install -C ../build_release_shared_win64$BUILDDIR INSTALL_ROOT=$RPM_BUILD_ROOT

# Install the static libraries in a temporary prefix so we can merge everything together properly
mkdir $RPM_BUILD_ROOT/static
make install -C ../build_release_static_win32$BUILDDIR INSTALL_ROOT=$RPM_BUILD_ROOT/static
make install -C ../build_release_static_win64$BUILDDIR INSTALL_ROOT=$RPM_BUILD_ROOT/static

# The libQt5Bootstrap.a library is a native Linux library which is required to build tools
# like lrelease and lupdate which are part of the mingw-qt5-qttools package. Therefore this
# library needs to be placed in a separate folder in order to avoid getting native and
# win32/win64 libraries mixed up. %%{_libdir} isn't desired for this as this can potentially
# conflict with the native Qt5 package, so use a different folder
mkdir $RPM_BUILD_ROOT%{_prefix}/%{mingw32_target}/lib/ $RPM_BUILD_ROOT%{_prefix}/%{mingw64_target}/lib/
mv $RPM_BUILD_ROOT%{mingw32_libdir}/libQt5Bootstrap.a $RPM_BUILD_ROOT%{_prefix}/%{mingw32_target}/lib/
mv $RPM_BUILD_ROOT%{mingw64_libdir}/libQt5Bootstrap.a $RPM_BUILD_ROOT%{_prefix}/%{mingw64_target}/lib/

# Make sure other qmake projects can find the Qt5Bootstrap library
sed -i s@'$$QT_MODULE_LIB_BASE'@'%{_prefix}/%{mingw32_target}/lib'@ $RPM_BUILD_ROOT%{mingw32_datadir}/qt5/mkspecs/modules/qt_lib_bootstrap.pri
sed -i s@'$$QT_MODULE_LIB_BASE'@'%{_prefix}/%{mingw64_target}/lib'@ $RPM_BUILD_ROOT%{mingw64_datadir}/qt5/mkspecs/modules/qt_lib_bootstrap.pri

# The mingw gcc compiler assumes that %%{_prefix}/%%{mingw32_target}/lib and
# %%{prefix}/%%{mingw64_target}/lib are paths which need to be searched
# during linking for cross-compiled libraries. As this isn't intended and
# introduces unwanted side effects (related to building mingw-qt5-qttools)
# remove the reference to it
sed -i s@'"%{_prefix}/%{mingw32_target}/lib" '@@ $RPM_BUILD_ROOT%{mingw32_datadir}/qt5/mkspecs/qconfig.pri
sed -i s@'"%{_prefix}/%{mingw64_target}/lib" '@@ $RPM_BUILD_ROOT%{mingw64_datadir}/qt5/mkspecs/qconfig.pri

# The pkg-config files for Qt5Bootstrap aren't interesting as this particular
# library only contains native code and not cross-compiled code
rm -f $RPM_BUILD_ROOT%{mingw32_libdir}/pkgconfig/Qt5Bootstrap.pc
rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/pkgconfig/Qt5Bootstrap.pc

# Rename the .a files to .dll.a as they're actually import libraries and not static libraries
for FN in $RPM_BUILD_ROOT%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_libdir}/*.a ; do
    # Ignore libqtmain*.a
    echo $FN | grep -q qtmain && continue

    FN_NEW=$(echo $FN | sed s/'.a$'/'.dll.a'/)
    mv $FN $FN_NEW
done

# Drop the qtmain and libQt5Bootstrap static libraries from the static
# tree as they're already part of the main tree
rm -f $RPM_BUILD_ROOT/static/%{mingw32_libdir}/libqtmain*
rm -f $RPM_BUILD_ROOT/static/%{mingw64_libdir}/libqtmain*
rm -f $RPM_BUILD_ROOT/static/%{mingw32_libdir}/libQt5Bootstrap*
rm -f $RPM_BUILD_ROOT/static/%{mingw64_libdir}/libQt5Bootstrap*

# Move the static libraries from the static tree to the main tree
mv $RPM_BUILD_ROOT/static%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw32_libdir}
mv $RPM_BUILD_ROOT/static%{mingw64_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_libdir}

# Clean up the static trees as we've now merged all interesting pieces
rm -rf $RPM_BUILD_ROOT/static

# Rename qtmain.a to a non-conflicting file name
# The updated filename is already set correctly in the bundled mkspecs profiles
mv $RPM_BUILD_ROOT%{mingw32_libdir}/libqtmain.a $RPM_BUILD_ROOT%{mingw32_libdir}/libqt5main.a
mv $RPM_BUILD_ROOT%{mingw64_libdir}/libqtmain.a $RPM_BUILD_ROOT%{mingw64_libdir}/libqt5main.a

# The .dll's are installed in both %%{mingw32_bindir} and %%{mingw32_libdir}
# One copy of the .dll's is sufficient
rm -f $RPM_BUILD_ROOT%{mingw32_libdir}/*.dll
rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/*.dll

# Drop all the files which we don't need
rm -f  $RPM_BUILD_ROOT%{mingw32_libdir}/*.prl
rm -f  $RPM_BUILD_ROOT%{mingw64_libdir}/*.prl

rm -f  $RPM_BUILD_ROOT%{mingw32_libdir}/libQt5Bootstrap.la
rm -f  $RPM_BUILD_ROOT%{mingw64_libdir}/libQt5Bootstrap.la

# Manually install qmake and other native tools so we don't depend anymore on
# the version of the native Fedora Qt and also fix issues as illustrated at
# http://stackoverflow.com/questions/6592931/building-for-windows-under-linux-using-qt-creator
#
# Also make sure the tools can be found by CMake
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{mingw32_target}/bin
mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{mingw64_target}/bin

for tool in qmake moc rcc uic qdbuscpp2xml qdbusxml2cpp qdoc syncqt; do
    mv $RPM_BUILD_ROOT%{mingw32_bindir}/$tool $RPM_BUILD_ROOT%{_prefix}/%{mingw32_target}/bin/$tool-qt5
    ln -s ../%{mingw32_target}/bin/$tool-qt5 $RPM_BUILD_ROOT%{_bindir}/%{mingw32_target}-$tool-qt5
done
ln -s %{mingw32_target}-qmake-qt5 $RPM_BUILD_ROOT%{_bindir}/mingw32-qmake-qt5

for tool in qmake moc rcc uic qdbuscpp2xml qdbusxml2cpp qdoc syncqt ; do
    mv $RPM_BUILD_ROOT%{mingw64_bindir}/$tool $RPM_BUILD_ROOT%{_prefix}/%{mingw64_target}/bin/$tool-qt5
    ln -s ../%{mingw64_target}/bin/$tool-qt5 $RPM_BUILD_ROOT%{_bindir}/%{mingw64_target}-$tool-qt5
done
ln -s %{mingw64_target}-qmake-qt5 $RPM_BUILD_ROOT%{_bindir}/mingw64-qmake-qt5

# Make sure that all Qt projects use the tools which are provided by this package
sed -i s@'#QT_TOOL'@'QT_TOOL'@ $RPM_BUILD_ROOT%{mingw32_datadir}/qt5/mkspecs/%{platform_win32}/qmake.conf
sed -i s@'#QT_TOOL'@'QT_TOOL'@ $RPM_BUILD_ROOT%{mingw64_datadir}/qt5/mkspecs/%{platform_win64}/qmake.conf


# Win32
%files -n mingw32-qt5-qtbase
%{mingw32_bindir}/Qt5Concurrent.dll
%{mingw32_bindir}/Qt5Core.dll
%{mingw32_bindir}/Qt5DBus.dll
%{mingw32_bindir}/Qt5Gui.dll
%{mingw32_bindir}/Qt5Network.dll
%{mingw32_bindir}/Qt5OpenGL.dll
%{mingw32_bindir}/Qt5PrintSupport.dll
%{mingw32_bindir}/Qt5Sql.dll
%{mingw32_bindir}/Qt5Test.dll
%{mingw32_bindir}/Qt5Widgets.dll
%{mingw32_bindir}/Qt5Xml.dll
%{mingw32_libdir}/libQt5Concurrent.dll.a
%{mingw32_libdir}/libQt5Core.dll.a
%{mingw32_libdir}/libQt5DBus.dll.a
%{mingw32_libdir}/libQt5Gui.dll.a
%{mingw32_libdir}/libQt5Network.dll.a
%{mingw32_libdir}/libQt5OpenGL.dll.a
%{mingw32_libdir}/libQt5PlatformSupport.dll.a
%{mingw32_libdir}/libQt5PrintSupport.dll.a
%{mingw32_libdir}/libQt5Sql.dll.a
%{mingw32_libdir}/libQt5Test.dll.a
%{mingw32_libdir}/libQt5Widgets.dll.a
%{mingw32_libdir}/libQt5Xml.dll.a
%{mingw32_libdir}/libqt5main.a
%{mingw32_libdir}/pkgconfig/Qt5Concurrent.pc
%{mingw32_libdir}/pkgconfig/Qt5Core.pc
%{mingw32_libdir}/pkgconfig/Qt5DBus.pc
%{mingw32_libdir}/pkgconfig/Qt5Gui.pc
%{mingw32_libdir}/pkgconfig/Qt5Network.pc
%{mingw32_libdir}/pkgconfig/Qt5OpenGL.pc
%{mingw32_libdir}/pkgconfig/Qt5PlatformSupport.pc
%{mingw32_libdir}/pkgconfig/Qt5PrintSupport.pc
%{mingw32_libdir}/pkgconfig/Qt5Sql.pc
%{mingw32_libdir}/pkgconfig/Qt5Test.pc
%{mingw32_libdir}/pkgconfig/Qt5Widgets.pc
%{mingw32_libdir}/pkgconfig/Qt5Xml.pc
%dir %{mingw32_libdir}/qt5/
%dir %{mingw32_libdir}/qt5/plugins
%dir %{mingw32_libdir}/qt5/plugins/accessible
%{mingw32_libdir}/qt5/plugins/accessible/qtaccessiblewidgets.dll
%dir %{mingw32_libdir}/qt5/plugins/bearer
%{mingw32_libdir}/qt5/plugins/bearer/qgenericbearer.dll
%{mingw32_libdir}/qt5/plugins/bearer/qnativewifibearer.dll
%dir %{mingw32_libdir}/qt5/plugins/imageformats
%{mingw32_libdir}/qt5/plugins/imageformats/qgif.dll
%{mingw32_libdir}/qt5/plugins/imageformats/qico.dll
%{mingw32_libdir}/qt5/plugins/imageformats/qjpeg.dll
%dir %{mingw32_libdir}/qt5/plugins/platforms
%{mingw32_libdir}/qt5/plugins/platforms/qminimal.dll
%{mingw32_libdir}/qt5/plugins/platforms/qwindows.dll
%dir %{mingw32_libdir}/qt5/plugins/printsupport
%{mingw32_libdir}/qt5/plugins/printsupport/windowsprintersupport.dll
%dir %{mingw32_libdir}/qt5/plugins/sqldrivers
%{mingw32_libdir}/qt5/plugins/sqldrivers/qsqlite.dll
%{mingw32_libdir}/qt5/plugins/sqldrivers/qsqlodbc.dll
%{mingw32_libdir}/cmake/Qt5Core/
%{mingw32_libdir}/cmake/Qt5Concurrent/
%{mingw32_libdir}/cmake/Qt5DBus/
%{mingw32_libdir}/cmake/Qt5Gui/
%{mingw32_libdir}/cmake/Qt5Network/
%{mingw32_libdir}/cmake/Qt5OpenGL/
%{mingw32_libdir}/cmake/Qt5PrintSupport/
%{mingw32_libdir}/cmake/Qt5Sql/
%{mingw32_libdir}/cmake/Qt5Test/
%{mingw32_libdir}/cmake/Qt5Widgets/
%{mingw32_libdir}/cmake/Qt5Xml/
%dir %{mingw32_includedir}/qt5/
%{mingw32_includedir}/qt5/QtConcurrent/
%{mingw32_includedir}/qt5/QtCore/
%{mingw32_includedir}/qt5/QtDBus/
%{mingw32_includedir}/qt5/QtGui/
%{mingw32_includedir}/qt5/QtNetwork/
%{mingw32_includedir}/qt5/QtOpenGL/
%{mingw32_includedir}/qt5/QtPlatformSupport/
%{mingw32_includedir}/qt5/QtPrintSupport/
%{mingw32_includedir}/qt5/QtSql/
%{mingw32_includedir}/qt5/QtTest/
%{mingw32_includedir}/qt5/QtWidgets/
%{mingw32_includedir}/qt5/QtXml/
%{mingw32_docdir}/qt5/

%files -n mingw32-qt5-qmake
%doc LGPL_EXCEPTION.txt LICENSE.FDL LICENSE.GPL LICENSE.LGPL LICENSE.PREVIEW.COMMERCIAL
%{_bindir}/%{mingw32_target}-moc-qt5
%{_bindir}/%{mingw32_target}-qdbuscpp2xml-qt5
%{_bindir}/%{mingw32_target}-qdbusxml2cpp-qt5
%{_bindir}/%{mingw32_target}-qdoc-qt5
%{_bindir}/%{mingw32_target}-qmake-qt5
%{_bindir}/%{mingw32_target}-rcc-qt5
%{_bindir}/%{mingw32_target}-syncqt-qt5
%{_bindir}/%{mingw32_target}-uic-qt5
%{_bindir}/mingw32-qmake-qt5
%{_prefix}/%{mingw32_target}/bin/moc-qt5
%{_prefix}/%{mingw32_target}/bin/qdbuscpp2xml-qt5
%{_prefix}/%{mingw32_target}/bin/qdbusxml2cpp-qt5
%{_prefix}/%{mingw32_target}/bin/qdoc-qt5
%{_prefix}/%{mingw32_target}/bin/qmake-qt5
%{_prefix}/%{mingw32_target}/bin/rcc-qt5
%{_prefix}/%{mingw32_target}/bin/syncqt-qt5
%{_prefix}/%{mingw32_target}/bin/uic-qt5
%{mingw32_datadir}/qt5/

%files -n mingw32-qt5-qtbase-devel
%{_prefix}/%{mingw32_target}/lib/libQt5Bootstrap.a

%files -n mingw32-qt5-qtbase-static
%{mingw32_libdir}/libQt5Concurrent.a
%{mingw32_libdir}/libQt5Core.a
%{mingw32_libdir}/libQt5DBus.a
%{mingw32_libdir}/libQt5Gui.a
%{mingw32_libdir}/libQt5Network.a
%{mingw32_libdir}/libQt5OpenGL.a
%{mingw32_libdir}/libQt5PlatformSupport.a
%{mingw32_libdir}/libQt5PrintSupport.a
%{mingw32_libdir}/libQt5Sql.a
%{mingw32_libdir}/libQt5Test.a
%{mingw32_libdir}/libQt5Widgets.a
%{mingw32_libdir}/libQt5Xml.a

# Win64
%files -n mingw64-qt5-qtbase
%{mingw64_bindir}/Qt5Concurrent.dll
%{mingw64_bindir}/Qt5Core.dll
%{mingw64_bindir}/Qt5DBus.dll
%{mingw64_bindir}/Qt5Gui.dll
%{mingw64_bindir}/Qt5Network.dll
%{mingw64_bindir}/Qt5OpenGL.dll
%{mingw64_bindir}/Qt5PrintSupport.dll
%{mingw64_bindir}/Qt5Sql.dll
%{mingw64_bindir}/Qt5Test.dll
%{mingw64_bindir}/Qt5Widgets.dll
%{mingw64_bindir}/Qt5Xml.dll
%{mingw64_libdir}/libQt5Concurrent.dll.a
%{mingw64_libdir}/libQt5Core.dll.a
%{mingw64_libdir}/libQt5DBus.dll.a
%{mingw64_libdir}/libQt5Gui.dll.a
%{mingw64_libdir}/libQt5Network.dll.a
%{mingw64_libdir}/libQt5OpenGL.dll.a
%{mingw64_libdir}/libQt5PlatformSupport.dll.a
%{mingw64_libdir}/libQt5PrintSupport.dll.a
%{mingw64_libdir}/libQt5Sql.dll.a
%{mingw64_libdir}/libQt5Test.dll.a
%{mingw64_libdir}/libQt5Widgets.dll.a
%{mingw64_libdir}/libQt5Xml.dll.a
%{mingw64_libdir}/libqt5main.a
%{mingw64_libdir}/pkgconfig/Qt5Concurrent.pc
%{mingw64_libdir}/pkgconfig/Qt5Core.pc
%{mingw64_libdir}/pkgconfig/Qt5DBus.pc
%{mingw64_libdir}/pkgconfig/Qt5Gui.pc
%{mingw64_libdir}/pkgconfig/Qt5Network.pc
%{mingw64_libdir}/pkgconfig/Qt5OpenGL.pc
%{mingw64_libdir}/pkgconfig/Qt5PlatformSupport.pc
%{mingw64_libdir}/pkgconfig/Qt5PrintSupport.pc
%{mingw64_libdir}/pkgconfig/Qt5Sql.pc
%{mingw64_libdir}/pkgconfig/Qt5Test.pc
%{mingw64_libdir}/pkgconfig/Qt5Widgets.pc
%{mingw64_libdir}/pkgconfig/Qt5Xml.pc
%dir %{mingw64_libdir}/qt5/
%dir %{mingw64_libdir}/qt5/plugins
%dir %{mingw64_libdir}/qt5/plugins/accessible
%{mingw64_libdir}/qt5/plugins/accessible/qtaccessiblewidgets.dll
%dir %{mingw64_libdir}/qt5/plugins/bearer
%{mingw64_libdir}/qt5/plugins/bearer/qgenericbearer.dll
%{mingw64_libdir}/qt5/plugins/bearer/qnativewifibearer.dll
%dir %{mingw64_libdir}/qt5/plugins/imageformats
%{mingw64_libdir}/qt5/plugins/imageformats/qgif.dll
%{mingw64_libdir}/qt5/plugins/imageformats/qico.dll
%{mingw64_libdir}/qt5/plugins/imageformats/qjpeg.dll
%dir %{mingw64_libdir}/qt5/plugins/platforms
%{mingw64_libdir}/qt5/plugins/platforms/qminimal.dll
%{mingw64_libdir}/qt5/plugins/platforms/qwindows.dll
%dir %{mingw64_libdir}/qt5/plugins/printsupport
%{mingw64_libdir}/qt5/plugins/printsupport/windowsprintersupport.dll
%dir %{mingw64_libdir}/qt5/plugins/sqldrivers
%{mingw64_libdir}/qt5/plugins/sqldrivers/qsqlite.dll
%{mingw64_libdir}/qt5/plugins/sqldrivers/qsqlodbc.dll
%{mingw64_libdir}/cmake/Qt5Core/
%{mingw64_libdir}/cmake/Qt5Concurrent/
%{mingw64_libdir}/cmake/Qt5DBus/
%{mingw64_libdir}/cmake/Qt5Gui/
%{mingw64_libdir}/cmake/Qt5Network/
%{mingw64_libdir}/cmake/Qt5OpenGL/
%{mingw64_libdir}/cmake/Qt5PrintSupport/
%{mingw64_libdir}/cmake/Qt5Sql/
%{mingw64_libdir}/cmake/Qt5Test/
%{mingw64_libdir}/cmake/Qt5Widgets/
%{mingw64_libdir}/cmake/Qt5Xml/
%dir %{mingw64_includedir}/qt5/
%{mingw64_includedir}/qt5/QtConcurrent/
%{mingw64_includedir}/qt5/QtCore/
%{mingw64_includedir}/qt5/QtDBus/
%{mingw64_includedir}/qt5/QtGui/
%{mingw64_includedir}/qt5/QtNetwork/
%{mingw64_includedir}/qt5/QtOpenGL/
%{mingw64_includedir}/qt5/QtPlatformSupport/
%{mingw64_includedir}/qt5/QtPrintSupport/
%{mingw64_includedir}/qt5/QtSql/
%{mingw64_includedir}/qt5/QtTest/
%{mingw64_includedir}/qt5/QtWidgets/
%{mingw64_includedir}/qt5/QtXml/

%files -n mingw64-qt5-qmake
%doc LGPL_EXCEPTION.txt LICENSE.FDL LICENSE.GPL LICENSE.LGPL LICENSE.PREVIEW.COMMERCIAL
%{_bindir}/%{mingw64_target}-moc-qt5
%{_bindir}/%{mingw64_target}-qdbuscpp2xml-qt5
%{_bindir}/%{mingw64_target}-qdbusxml2cpp-qt5
%{_bindir}/%{mingw64_target}-qdoc-qt5
%{_bindir}/%{mingw64_target}-qmake-qt5
%{_bindir}/%{mingw64_target}-rcc-qt5
%{_bindir}/%{mingw64_target}-syncqt-qt5
%{_bindir}/%{mingw64_target}-uic-qt5
%{_bindir}/mingw64-qmake-qt5
%{_prefix}/%{mingw64_target}/bin/moc-qt5
%{_prefix}/%{mingw64_target}/bin/qdbuscpp2xml-qt5
%{_prefix}/%{mingw64_target}/bin/qdbusxml2cpp-qt5
%{_prefix}/%{mingw64_target}/bin/qdoc-qt5
%{_prefix}/%{mingw64_target}/bin/qmake-qt5
%{_prefix}/%{mingw64_target}/bin/rcc-qt5
%{_prefix}/%{mingw64_target}/bin/syncqt-qt5
%{_prefix}/%{mingw64_target}/bin/uic-qt5
%{mingw64_datadir}/qt5/
%{mingw64_docdir}/qt5/

%files -n mingw64-qt5-qtbase-devel
%{_prefix}/%{mingw64_target}/lib/libQt5Bootstrap.a

%files -n mingw64-qt5-qtbase-static
%{mingw64_libdir}/libQt5Concurrent.a
%{mingw64_libdir}/libQt5Core.a
%{mingw64_libdir}/libQt5DBus.a
%{mingw64_libdir}/libQt5Gui.a
%{mingw64_libdir}/libQt5Network.a
%{mingw64_libdir}/libQt5OpenGL.a
%{mingw64_libdir}/libQt5PlatformSupport.a
%{mingw64_libdir}/libQt5PrintSupport.a
%{mingw64_libdir}/libQt5Sql.a
%{mingw64_libdir}/libQt5Test.a
%{mingw64_libdir}/libQt5Widgets.a
%{mingw64_libdir}/libQt5Xml.a


%changelog
* Wed Jul 10 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.2-3
- Display message box if platform plugin cannot be found (QTBUG-31765, QTBUG-31760)

* Fri May 10 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.2-2
- Fix references to the tools qdoc and qhelpgenerator (needed to build qtdoc)

* Sat Apr 13 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.2-1
- Update to 5.0.2
- Remove DirectWrite support for now as the necessary API
  isn't available on Windows XP (as mentioned in RHBZ #917323)

* Thu Mar 28 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.1-4
- Have the -qmake packages require mingw{32,64}-qt5-qttools-lrelease
  and update the reference to it in the mkspecs profiles

* Tue Mar 26 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.1-3
- Make sure the .pc files of the Qt5 modules are installed correctly

* Thu Feb  7 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.1-2
- Replaced the OpenSSL patch with a more proper one
- Improve detection of the Qt5Bootstrap library (needed by mingw-qt5-qttools)
- Workaround cross-compilation issue when using a non-x86 host (RHBZ #905863, QTBUG #29426)
- Resolve build failure caused by QtDBus headers which use the reserved keyword 'interface'

* Thu Jan 31 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.1-1
- Update to 5.0.1
- Removed the -fast configure argument (upstream dropped support for it)

* Fri Jan 11 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-4
- Moved the libQt5Bootstrap.a library (required to build tools like lrelease
  and lupdate which are part of mingw-qt5-qttools) to separate -devel subpackages
  as it is a native library instead of a cross-compiled one
- Removed the pkg-config file for Qt5Bootstrap as it doesn't work as expected
  when Qt5 is cross-compiled

* Sat Dec 29 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-3
- The define QT_NEEDS_QMAIN also needs to be set for our mkspecs profiles
- To make linking against qt5main.a (which contains a Qt specific WinMain) work
  binaries need to be linked with -lmingw32 -lqt5main
- Resolves some initialisation issues
- Don't enable ICU support as it introduces over 20MB of dependency bloat

* Sat Dec 29 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-2
- Don't segfault when no suitable platform dll could be located

* Mon Dec 24 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-1
- Update to Qt 5.0.0 Final
- Use the qplatformdefs.h header which is included in the
  win32-g++ mkspecs profile instead of providing our own
- Replaced the bundled copy of the ANGLE libraries with
  a seperate mingw-angleproject package

* Thu Dec 13 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.15.rc2
- Update to Qt 5.0.0 RC2
- Dropped upstreamed DirectWrite patch

* Fri Dec  7 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.14.rc1
- Update to Qt 5.0.0 RC1
- Replaced various hack with proper patches
- Use the configure argument -archdatadir as it is used to decide
  where the mkspecs profiles should be installed

* Sat Nov 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.13.beta1.git20121110.d725239c
- Update to 20121110 snapshot (rev d725239c)
- Dropped the configure argument -qtlibinfix 5 as upstream
  has resolved the file conflicts with Qt4 properly now
- Added several missing flags to the mkspecs profiles
- Dropped the pkg-config file renames as they're not needed any more
- Dropped two obsolete patches

* Sat Nov 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.12.beta1.git20121103.ccc4fbdf
- Update to 20121103 snapshot (rev ccc4fbdf)
- Use -std=c++11 instead of -std=c++0x as the latter is deprecated in gcc 4.7
- Added DirectWrite support
- Added Angle support

* Sun Oct  7 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.11.beta1
- Fix compilation failure of the win64 build when using c++11 mode

* Sat Sep 15 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.10.beta1
- Re-added some configure arguments as they're apparently still needed to build
  the individual Qt components
- Removed -ltiff from the mkspecs profiles
- Added BR: mingw32-icu mingw64-icu
- Fix directory ownership of %%{mingw32_datadir}/qt5/ and %%{mingw64_datadir}/qt5/

* Thu Sep 13 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.9.beta1
- Add QT_TOOL.lrelease.command to the mkspecs profiles
- Fixed detection of mingw-icu
- Removed some obsolete configure arguments

* Wed Sep 12 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.8.beta1
- Make sure that Qt components which are built as static library also
  contain the version number (TARGET_VERSION_EXT) when it is set

* Mon Sep 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.7.beta1
- Added syncqt to the mkspecs profiles
- Set the qtlibinfix parameter correctly to avoid needing to use other hacks

* Sun Sep  9 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.6.beta1
- Make sure that Qt is built with debugging symbols and that these
  debugging symbols are placed in the -debuginfo subpackage

* Sat Sep  8 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.5.beta1
- Removed -javascript-jit from the configure arguments as it's only needed
  for QtWebKit (which is provided in a seperate package)
- Added QMAKE_DLLTOOL to the mkspecs profiles

* Sat Sep  8 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.4.beta1
- Use the lrelease tool from mingw-qt4 for now until mingw-qt5-qttools is packaged

* Fri Sep  7 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.3.beta1
- Added win32 static release and win64 static release builds

* Tue Sep  4 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.2.beta1
- Moved headers to %%{mingw32_includedir}/qt5 and %%{mingw64_includedir}/qt5
- Renamed the pkgconfig files to avoid conflict with qt4

* Tue Sep  4 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.0.0-0.1.beta1
- Initial package (based on mingw-qt spec file)