From 141d937ca14d9db53564a383d0ffbff803ed366d Mon Sep 17 00:00:00 2001 From: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon, 30 Sep 2019 11:16:05 -0400 Subject: [PATCH] Package init --- macros.qt5 | 35 ++++++++++++++++++ macros.qt5-srpm | 9 +++++ qmake-qt5.sh | 10 +++++ qt5.spec | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 macros.qt5 create mode 100644 macros.qt5-srpm create mode 100755 qmake-qt5.sh create mode 100644 qt5.spec diff --git a/macros.qt5 b/macros.qt5 new file mode 100644 index 0000000..ab4a483 --- /dev/null +++ b/macros.qt5 @@ -0,0 +1,35 @@ +%_qt5_prefix %{_prefix} +%_qt5_archdatadir %{_libdir}/qt5 +%_qt5_bindir %{_libdir}/qt5/bin +%_qt5_datadir %{_datadir}/qt5 +%_qt5_docdir %{_docdir}/qt5 +%_qt5_examplesdir %{_qt5_archdatadir}/examples +%_qt5_headerdir %{_includedir}/qt5 +%_qt5_includedir %{_includedir}/qt5 +%_qt5_importdir %{_qt5_archdatadir}/imports +%_qt5_libdir %{_libdir} +%_qt5_libexecdir %{_qt5_archdatadir}/libexec +%_qt5_plugindir %{_qt5_archdatadir}/plugins +%_qt5_qmldir %{_qt5_archdatadir}/qml +%_qt5_qmake @@QMAKE@@ +%_qt5_settingsdir %{_sysconfdir}/xdg +%_qt5_sysconfdir %{_qt5_settingsdir} +%_qt5_translationdir %{_datadir}/qt5/translations + +%_qt5_cflags %{nil}@@QT5_CFLAGS@@ +%_qt5_cxxflags %{nil}@@QT5_CXXFLAGS@@ +%_qt5_ldflags %{nil}%{?__global_ldflags} @@QT5_RPM_LD_FLAGS@@ +%_qt5_optflags %{optflags} @@QT5_RPM_OPT_FLAGS@@ + +%_qt5_qmake_flags \\\ + QMAKE_CFLAGS_DEBUG="${CFLAGS:-%{_qt5_optflags} %{?_qt5_cflags}}" \\\ + QMAKE_CFLAGS_RELEASE="${CFLAGS:-%{_qt5_optflags} %{?_qt5_cflags}}" \\\ + QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS:-%{_qt5_optflags} %{?_qt5_cxxflags}}" \\\ + QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-%{_qt5_optflags} %{?_qt5_cxxflags}}" \\\ + QMAKE_LFLAGS_DEBUG="${LDFLAGS:-%{_qt5_ldflags}}" \\\ + QMAKE_LFLAGS_RELEASE="${LDFLAGS:-%{_qt5_ldflags}}" \\\ + QMAKE_STRIP= + +%qmake_qt5 %{_qt5_qmake} %{?_qt5_qmake_flags} + +%qmake_qt5_wrapper @@QMAKE_QT5_WRAPPER@@ diff --git a/macros.qt5-srpm b/macros.qt5-srpm new file mode 100644 index 0000000..632755c --- /dev/null +++ b/macros.qt5-srpm @@ -0,0 +1,9 @@ + +# # the architectures theoretically supported by the version of V8 used (#1298011) +# # You may need some minor patching to build on one of the secondary +# # architectures, e.g., to add to the Qt -> Chromium -> V8 arch translations. +# # If you cannot get this package to build on your secondary architecure, please: +# # * remove your architecture from this list AND +# # * put #1298011 onto your ExcludeArch tracker. +%qt5_qtwebengine_arches %{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el + diff --git a/qmake-qt5.sh b/qmake-qt5.sh new file mode 100755 index 0000000..d41c382 --- /dev/null +++ b/qmake-qt5.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# An attempt at providing a qmake wrapper for projects that +# lack native qmake support (ie, qmake is run by buildsystem +# instead of developer or fedora packager). + +QMAKE="$(rpm --eval %{_qt5_qmake})" +QMAKE_FLAGS="$(rpm --eval %{?_qt5_qmake_flags})" + +eval $QMAKE $QMAKE_FLAGS $@ diff --git a/qt5.spec b/qt5.spec new file mode 100644 index 0000000..ae90d53 --- /dev/null +++ b/qt5.spec @@ -0,0 +1,97 @@ +Name: qt5 +Version: 5.11.1 +Release: 5 +Summary: Qt5 meta package +License: GPLv3 +URL: https://getfedora.org/ +Source0: macros.qt5 +Source1: macros.qt5-srpm +Source2: qmake-qt5.sh +BuildArch: noarch + +Requires: qt5-qdbusviewer qt5-qt3d qt5-qtbase qt5-qtbase-gui qt5-qtbase-mysql +Requires: qt5-qtbase-postgresql qt5-qtconnectivity qt5-qtdeclarative qt5-qtdoc +Requires: qt5-qtgraphicaleffects qt5-qtimageformats qt5-qtlocation qt5-qtmultimedia +Requires: qt5-qtquickcontrols qt5-qtquickcontrols2 qt5-qtscript qt5-qtsensors +Requires: qt5-qtserialport qt5-qtsvg qt5-qttools qt5-qtwayland qt5-qtwebchannel +Requires: qt5-qtwebkit qt5-qtwebsockets qt5-qtx11extras qt5-qtxmlpatterns +#need to make qt5 arch'd and deps conditional (on arch) +#qt5-qtwebengine + +%description +Qt is a full development framework with tools designed to streamline the creation of applications +and user interfaces for desktop, embedded, and mobile platforms. + +%package devel +Summary: Qt5 meta devel package +Requires: qt5-rpm-macros qt5-qttools-static qt5-qtdeclarative-static qt5-qtbase-static +Requires: qt5-designer qt5-qdoc qt5-qhelpgenerator qt5-linguist qt5-qt3d-devel qt5-qtbase-devel +Requires: qt5-qtconnectivity-devel qt5-qtdeclarative-devel qt5-qtenginio-devel qt5-qtlocation-devel +Requires: qt5-qtmultimedia-devel qt5-qtscript-devel qt5-qtsensors-devel qt5-qtserialport-devel +Requires: qt5-qtsvg-devel qt5-qttools-devel qt5-qtwayland-devel qt5-qtwebchannel-devel +#Requires: qt5-qtwebengine-devel +Requires: qt5-qtwebkit-devel qt5-qtwebsockets-devel qt5-qtx11extras-devel qt5-qtxmlpatterns-devel + +%description devel +Development files for %{name} + +%package rpm-macros +Summary: RPM macros for building Qt5 and KDE Frameworks 5 packages +Requires: gcc-c++ +%if 0%{?epel} +Requires: cmake3 +%endif + +%description rpm-macros +RPM provides a rich set of macros to make package maintenance simpler and consistent across packages. + +%package srpm-macros +Summary: RPM macros for source Qt5 packages + +%description srpm-macros +RPM RPM provides a rich set of macros for source Qt5 packages + +%install +install -Dpm644 %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt5 +install -Dpm644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt5-srpm +install -Dpm755 %{SOURCE2} %{buildroot}%{_bindir}/qmake-qt5.sh +mkdir -p %{buildroot}%{_datadir}/qt5/wrappers +ln -s %{_bindir}/qmake-qt5.sh %{buildroot}%{_datadir}/qt5/wrappers/qmake-qt5 +ln -s %{_bindir}/qmake-qt5.sh %{buildroot}%{_datadir}/qt5/wrappers/qmake + +sed -i \ + -e "s|@@QT5_CFLAGS@@|%{?qt5_cflags}|g" \ + -e "s|@@QT5_CXXFLAGS@@|%{?qt5_cxxflags}|g" \ + -e "s|@@QT5_RPM_LD_FLAGS@@|%{?qt5_rpm_ld_flags}|g" \ + -e "s|@@QT5_RPM_OPT_FLAGS@@|%{?qt5_rpm_opt_flags}|g" \ + -e "s|@@QMAKE@@|%{_prefix}/%%{_lib}/qt5/bin/qmake|g" \ + -e "s|@@QMAKE_QT5_WRAPPER@@|%{_bindir}/qmake-qt5.sh|g" \ + %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt5 + +mkdir -p %{buildroot}%{_docdir}/qt5 +mkdir -p %{buildroot}%{_docdir}/qt5-devel +echo "- Qt5 meta package" > %{buildroot}%{_docdir}/qt5/README +echo "- Qt5 devel meta package" > %{buildroot}%{_docdir}/qt5-devel/README + +%files +%defattr(-,root,root) +%{_docdir}/qt5/README + +%files devel +%defattr(-,root,root) +%{_docdir}/qt5-devel/README + +%files rpm-macros +%defattr(-,root,root) +%{_rpmconfigdir}/macros.d/macros.qt5 +%{_bindir}/qmake-qt5.sh +%{_datadir}/qt5/wrappers/ + +%files srpm-macros +%defattr(-,root,root) +%{_rpmconfigdir}/macros.d/macros.qt5-srpm + + +%changelog +* Mon Sep 16 2019 openEuler Buildteam - 5.11.1-5 +- Package init