File mingw64-libqt5-opensource-5.8.0.spec of Package mingw64-libqt5-opensource-5.8.0

#
# spec file for package libqt5
#
%define	license_type opensource

%define _mingw64_qt_platform    win32-g++

%define _major_version 5
%define _minor_version 8
%define _patch_version 0

Version:        %{_major_version}.%{_minor_version}.%{_patch_version}
Name:           mingw64-libqt5-%{license_type}-%{version}
BuildRequires:  binutils
BuildRequires:  bison
BuildRequires:  python
BuildRequires:  dos2unix
BuildRequires:  flex
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  mingw64-cross-binutils
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-dbus-1-devel
BuildRequires:  mingw64-filesystem
BuildRequires:  mingw64-libopenssl-devel
BuildRequires:  mingw64-win_iconv-devel
BuildRequires:  mingw64-zlib-devel
BuildRequires:  mingw64-glib2-devel
BuildRequires:  mingw64-libintl-devel

BuildRequires:  xz
BuildRequires:  zip
BuildRequires:  zlib-devel
#
Url:            http://qt.io
Summary:        C++ Program Library, Core Components
License:        GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
Group:          System/Libraries
Release:        0
Source:         http://download.qt.io/archive/qt/%{_major_version}.%{_minor_version}/%{_major_version}.%{_minor_version}.%{_patch_version}/qt-everywhere-%{license_type}-src-%{version}.tar.xz
# to get mtime of file:
Source1:        %{name}.changes
#
Patch0:         qt%{version}-qtbase-werror.patch
Patch1:         qt%{version}-qtlocation-nonvoid.patch
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Prefix:         %{_mingw64_prefix}


%define cross_options   -developer-build -xplatform %{_mingw64_qt_platform} -device-option CROSS_COMPILE=%{_mingw64_target}- -sysroot %{_mingw64_prefix}
%define common_options  -%{license_type} -confirm-license -verbose -prefix %{prefix}/Qt-%{license_type}-%{version} -force-pkg-config -no-rpath -optimized-qmake
%define lib_options     -iconv -glib -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg
%define win_options     -release -openssl -dbus-linked
%define make_options	-nomake tests -nomake examples -skip qtactiveqt -skip qt3d -skip qtcanvas3d

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

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



%prep
%setup -q -n qt-everywhere-%{license_type}-src-%{version}
#
%patch0 -p1
%patch1 -p1


%build
rm -rf ../build
mkdir ../build
pushd ../build
export PKG_CONFIG_PATH=%{_mingw64_libdir}/pkgconfig
../qt-everywhere-%{license_type}-src-%{version}/configure %cross_options %common_options %lib_options %win_options %make_options
make %{?jobs:-j %jobs}
popd


%install
pushd ../build
make INSTALL_ROOT=$RPM_BUILD_ROOT install
popd

find $RPM_BUILD_ROOT/%{prefix}/Qt-%{license_type}-%{version} -type f -name '*la' -print -exec perl -pi -e 's,-L%{_builddir}/\S+,,g' {} \;
find $RPM_BUILD_ROOT/%{prefix}/Qt-%{license_type}-%{version} -type f -name '*pc' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \; -exec sed -i -e "s,^moc_location=.*,moc_location=%_bindir/moc," -e "s,uic_location=.*,uic_location=%_bindir/uic," {} \;


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,755)
%doc README qtbase/*.txt qtbase/LICENSE.*
%{prefix}/Qt-%{license_type}-%{version}

%changelog