File mingw64-libqt5-qtquickcontrols2.spec of Package mingw64-libqt5-qtquickcontrols2

#
# spec file for package mingw64-libqt5-qtquickcontrols2
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


# Internal QML imports of examples
%global __requires_exclude qmlimport\\((Backend|Theme|.*example).*

%define qt5_snapshot 1
%define base_name libqt5
%define real_version 5.15.14
%define so_version 5.15.14
%define tar_version qtquickcontrols2-everywhere-src-%{version}
%define _name   libqt5-qtquickcontrols2
Name:           mingw64-%{_name}
Version:        5.15.14+kde0
Release:        0
Summary:        Qt 5 Quick Controls Addon
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
Group:          Development/Libraries/X11
URL:            https://www.qt.io
Source:         %{tar_version}.tar.xz
BuildRequires:  mingw64-libQt5Core-private-headers-devel >= %{real_version}
BuildRequires:  mingw64-libQt5Gui-private-headers-devel >= %{real_version}
BuildRequires:  mingw64-libqt5-qtbase-devel >= %{real_version}
BuildRequires:  mingw64-libqt5-qtdeclarative-private-headers-devel >= %{real_version}
%if %{qt5_snapshot}
#to create the forwarding headers
BuildRequires:  perl
%endif
BuildRequires:  xz
BuildRequires:  mingw64(pkg:Qt5Qml) >= %{real_version}
BuildRequires:  mingw64(pkg:Qt5Quick) >= %{real_version}
%requires_ge    mingw64-libQt5Widgets5
%requires_ge    mingw64-libQtQuick5
# TODO: not detected by qmlpluginexports
Provides:       mingw64(qt5qmlimport:QtQuick.Controls.2)
Provides:       mingw64(qt5qmlimport:QtQuick.Controls.Fusion.2)
Provides:       mingw64(qt5qmlimport:QtQuick.Controls.Imagine.2)
Provides:       mingw64(qt5qmlimport:QtQuick.Controls.Material.2)
Provides:       mingw64(qt5qmlimport:QtQuick.Controls.Universal.2)
Provides:       mingw64(qt5qmlimport:QtQuick.Templates.2) 
%_mingw64_package_header_debug
BuildArch:      noarch

%description
The Qt Quick Controls2 module provides a set of controls that
can be used to build complete interfaces in Qt Quick.

%package -n mingw64-libQt5QuickControls2-5
Summary:        Qt 5 QuickControl2 Library
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
Group:          System/Libraries

%description -n mingw64-libQt5QuickControls2-5
Qt is a set of libraries for developing applications.

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

%package -n mingw64-libQt5QuickTemplates2-5
Summary:        Qt5 QuickTemplates2 Library
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
Group:          System/Libraries

%description -n mingw64-libQt5QuickTemplates2-5
You need this package if you want to compile programs with qtquickcontrols2.

%package -n mingw64-libQt5QuickControls2-devel
Summary:        Qt Development Kit
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
Group:          Development/Libraries/X11
Requires:       mingw64-libQt5QuickControls2-5 = %{version}

%description -n mingw64-libQt5QuickControls2-devel
You need this package if you want to compile programs with qtquickcontrols2.

%package -n mingw64-libQt5QuickTemplates2-devel
Summary:        Qt Development Kit
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
Group:          Development/Libraries/X11
Requires:       mingw64-libQt5QuickTemplates2-5 = %{version}

%description -n mingw64-libQt5QuickTemplates2-devel
You need this package if you want to compile programs with qtquickcontrols2.

%package private-headers-devel
Summary:        Headers for the unstable API of the Qt5 QuickControls2 module
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)
Group:          Development/Libraries/X11
Requires:       mingw64-libQt5QuickControls2-devel = %{version}
Requires:       mingw64-libQt5QuickTemplates2-devel = %{version}

%description private-headers-devel
You need this package if you want to compile programs against the unstable API
of the Qt5 QuickControls 2 module.

%_mingw64_debug_package

%prep
%autosetup -n %{tar_version}

%build
%if %{qt5_snapshot}
#force the configure script to generate the forwarding headers (it checks whether .git directory exists)
mkdir .git
%endif
%_mingw64_qmake5
%{_mingw64_make} %{?_smp_mflags}

%install
%_mingw64_qmake5_install
find %{buildroot}/%{_mingw64_libqt5_libdir} -type f -name '*la' -print -exec perl -pi -e 's,-L%{_builddir}/\S+,,g' {} +
find %{buildroot}/%{_mingw64_libqt5_libdir} -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=%{_lib}qt5_bindir/moc," -e "s,uic_location=.*,uic_location=%{_lib}qt5_bindir/uic," {} +.exe \;
find %{buildroot}/%{_mingw64_libqt5_libdir} -type f -name '*prl' -exec sed -i -e "/^QMAKE_PRL_BUILD_DIR/d" {} +

# kill .la files
rm -f %{buildroot}%{_mingw64_libqt5_libdir}/lib*.la


%files -n mingw64-libQt5QuickControls2-5
%license LICENSE.*
%{_mingw64_libqt5_bindir}/libQt5QuickControls2.dll

%files -n mingw64-libQt5QuickTemplates2-5
%license LICENSE.*
%{_mingw64_libqt5_bindir}/libQt5QuickTemplates2.dll

%files
%license LICENSE.*
%{_mingw64_libqt5_qmldir}/QtQuick
%{_mingw64_libqt5_qmldir}/Qt
%exclude %{_mingw64_libqt5_qmldir}/*/*/*.debug
%exclude %{_mingw64_libqt5_qmldir}/*/*/*/*.debug

%files -n mingw64-libQt5QuickControls2-devel
%license LICENSE.*
%exclude %{_mingw64_libqt5_includedir}/QtQuickControls2/%{so_version}
%{_mingw64_libqt5_includedir}/QtQuickControls2
%{_mingw64_libqt5_libdir}/cmake/Qt5QuickControls2
%{_mingw64_libqt5_libdir}/Qt5QuickControls2.prl
%{_mingw64_libqt5_libdir}/libQt5QuickControls2.dll.a
%{_mingw64_libqt5_libdir}/pkgconfig/Qt5QuickControls2.pc
%{_mingw64_libqt5_datadir}/mkspecs/modules/qt_lib_quickcontrols2.pri

%files -n mingw64-libQt5QuickTemplates2-devel
%license LICENSE.*
%exclude %{_mingw64_libqt5_includedir}/QtQuickTemplates2/%{so_version}
%{_mingw64_libqt5_includedir}/QtQuickTemplates2
%{_mingw64_libqt5_libdir}/cmake/Qt5QuickTemplates2
%{_mingw64_libqt5_libdir}/Qt5QuickTemplates2.prl
%{_mingw64_libqt5_libdir}/libQt5QuickTemplates2.dll.a
%{_mingw64_libqt5_libdir}/pkgconfig/Qt5QuickTemplates2.pc
%{_mingw64_libqt5_datadir}/mkspecs/modules/qt_lib_quicktemplates2.pri

%files private-headers-devel
%license LICENSE.*
%{_mingw64_libqt5_includedir}/QtQuickControls2/%{so_version}
%{_mingw64_libqt5_includedir}/QtQuickTemplates2/%{so_version}
%{_mingw64_libqt5_datadir}/mkspecs/modules/qt_lib_quickcontrols2_private.pri
%{_mingw64_libqt5_datadir}/mkspecs/modules/qt_lib_quicktemplates2_private.pri

%changelog
openSUSE Build Service is sponsored by