File mingw32-qt5-qttools.spec of Package mingw32-libqt5-qttools

#
# spec file for package mingw32-qt5-qttools
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global qt_module qttools
#%%global pre beta1
%global source_folder %{qt_module}-opensource-src-%{version}%{?pre:-%pre}
# first two digits of version
%global release_version %(echo %{version} | awk -F. '{print $1"."$2}')
Name:           mingw32-libqt5-%{qt_module}-src
Version:        5.4.0
Release:        0
Summary:        Qt5 for Windows - QtTools component
License:        GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
Group:          Development/Libraries
Url:            http://qt-project.org/
Source0:        %{source_folder}.tar.xz
# Disabled for now because of compilation issues
# BuildRequires:  mingw32-qt5-qtactiveqt
# Host
BuildRequires:  binutils
BuildRequires:  gcc
BuildRequires:  gcc-c++
# Target tools on host
BuildRequires:  mingw32-angleproject-devel
BuildRequires:  mingw32-cross-binutils
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-libqt5-qmake
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-filesystem
BuildRequires:  mingw32-gcc-c++
BuildRequires:  mingw32-libjpeg-devel
BuildRequires:  mingw32-libpng-devel
BuildRequires:  mingw32-libqt5-qmldevtools-devel
BuildRequires:  mingw32-libqt5-qtbase
BuildRequires:  mingw32-libqt5-qtbase-devel
BuildRequires:  mingw32-libqt5-qtdeclarative-devel
BuildRequires:  mingw32-pcre-devel
BuildRequires:  mingw32-zlib-devel
BuildRequires:  xz
%{_mingw32_package_header_debug}

%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
MinGW cross-compiler.

%package -n mingw32-libqt5-%{qt_module}
Summary:        Qt5 for Windows - QtTools component
Group:          Development/Libraries
BuildArch:      noarch

%description -n mingw32-libqt5-%{qt_module}
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
MinGW cross-compiler.

%package -n mingw32-cross-libqt5-%{qt_module}
Summary:        Qt5 for Windows - QtTools component (cross tool)
Group:          Development/Libraries

%description -n  mingw32-cross-libqt5-%{qt_module}
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
MinGW cross-compiler.

%{_mingw32_debug_package}

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

%build
mingw32-qmake-qt5 %{qt_module}.pro
%{_mingw32_make} %{?_smp_mflags}

%install
%{_mingw32_make} install INSTALL_ROOT=%{buildroot}

# .prl files aren't interesting for us
find %{buildroot} -name "*.prl" -delete

# The .dll's are installed in both %%{_mingw32_bindir} and %%{_mingw32_libdir}
# One copy of the .dll's is sufficient
rm -f %{buildroot}%{_mingw32_libdir}/*.dll

# Make sure the executables don't conflict with their mingw-qt4 counterpart
for fn in %{buildroot}%{_mingw32_bindir}/*.exe; do
    fn_new=$(echo $fn | sed s/'.exe$'/'-qt5.exe'/)
    mv $fn $fn_new
done

# Move the lconvert, lupdate and lrelease tools to a more proper location and create symlinks
mkdir -p %{buildroot}%{_bindir}

for tool in lconvert lupdate lrelease; do
    ln -s ../%{_mingw32_target}/bin/qt5/$tool %{buildroot}%{_bindir}/%{_mingw32_target}-$tool-qt5
done

%files -n mingw32-libqt5-%{qt_module}
%defattr(-, root, root)
%{_mingw32_bindir}/Qt5CLucene.dll
%{_mingw32_bindir}/Qt5Designer.dll
%{_mingw32_bindir}/Qt5DesignerComponents.dll
%{_mingw32_bindir}/Qt5Help.dll
%{_mingw32_bindir}/assistant-qt5.exe
%{_mingw32_bindir}/designer-qt5.exe
#%%{_mingw32_bindir}/lconvert-qt5.exe
%{_mingw32_bindir}/linguist-qt5.exe
#%%{_mingw32_bindir}/lupdate-qt5.exe
%{_mingw32_bindir}/pixeltool-qt5.exe
%{_mingw32_bindir}/qcollectiongenerator-qt5.exe
%{_mingw32_bindir}/qdbus-qt5.exe
%{_mingw32_bindir}/qdbusviewer-qt5.exe
%{_mingw32_bindir}/qhelpconverter-qt5.exe
%{_mingw32_bindir}/qhelpgenerator-qt5.exe
%{_mingw32_bindir}/qtpaths-qt5.exe
%{_mingw32_bindir}/qtdiag-qt5.exe
%{_mingw32_includedir}/qt5/QtCLucene/
%{_mingw32_includedir}/qt5/QtDesigner/
%{_mingw32_includedir}/qt5/QtDesignerComponents/
%{_mingw32_includedir}/qt5/QtHelp/
%{_mingw32_includedir}/qt5/QtUiTools/
%{_mingw32_libdir}/libQt5CLucene.dll.a
%{_mingw32_libdir}/libQt5Designer.dll.a
%{_mingw32_libdir}/libQt5DesignerComponents.dll.a
%{_mingw32_libdir}/libQt5Help.dll.a
%dir %{_mingw32_libdir}/qt5/plugins/designer
%{_mingw32_libdir}/qt5/plugins/designer/qquickwidget.dll
# QtUiTools is only built as static library by default
%{_mingw32_libdir}/libQt5UiTools.a
%{_mingw32_libdir}/cmake/Qt5Designer/
%{_mingw32_libdir}/cmake/Qt5Help/
%{_mingw32_libdir}/cmake/Qt5LinguistTools/
%{_mingw32_libdir}/cmake/Qt5UiTools/
%{_mingw32_libdir}/pkgconfig/Qt5CLucene.pc
%{_mingw32_libdir}/pkgconfig/Qt5Designer.pc
%{_mingw32_libdir}/pkgconfig/Qt5DesignerComponents.pc
%{_mingw32_libdir}/pkgconfig/Qt5Help.pc
%{_mingw32_libdir}/pkgconfig/Qt5UiTools.pc
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_clucene_private.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_designer.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_designer_private.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_help.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_help_private.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_uitools.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_uitools_private.pri
%{_mingw32_datadir}/qt5/phrasebooks/

%files -n mingw32-cross-libqt5-%{qt_module}
%defattr(-, root, root)
%{_bindir}/%{_mingw32_target}-lconvert-qt5
%{_bindir}/%{_mingw32_target}-lupdate-qt5
%{_bindir}/%{_mingw32_target}-lrelease-qt5
%{_prefix}/%{_mingw32_target}/bin/qt5/lconvert
%{_prefix}/%{_mingw32_target}/bin/qt5/lupdate
%{_prefix}/%{_mingw32_target}/bin/qt5/lrelease
%{_prefix}/%{_mingw32_target}/bin/qt5/windeployqt

%changelog
openSUSE Build Service is sponsored by