From 549dba9539df087d3fce49d1034e3535dcca4346350b100c560b936fc4b817a6 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Thu, 5 Nov 2020 07:34:03 +0000 Subject: [PATCH] Accepting request 843970 from home:bnavigator:sip5:submit1 OBS-URL: https://build.opensuse.org/request/show/843970 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/python-pyqt-rpm-macros?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + LICENSE | 7 ++++ macros.pyqt | 66 ++++++++++++++++++++++++++++++++++ python-pyqt-rpm-macros.changes | 10 ++++++ python-pyqt-rpm-macros.spec | 49 +++++++++++++++++++++++++ 6 files changed, 156 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 macros.pyqt create mode 100644 python-pyqt-rpm-macros.changes create mode 100644 python-pyqt-rpm-macros.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e27b4d9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ + DO WHAT THE HELL YOU WANT TO PUBLIC LICENSE + Version 1.0.0, October 2014 + + DO WHAT THE HELL YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE HELL YOU WANT TO. diff --git a/macros.pyqt b/macros.pyqt new file mode 100644 index 0000000..47d3c72 --- /dev/null +++ b/macros.pyqt @@ -0,0 +1,66 @@ +%sip4_only() %{?use_sip4:%{**}} + +%sip5_only() %{?!use_sip4:%{**}} + +%pyqt5_sipdir %{?use_sip4:%_datadir/sip/PyQt5-%python_bin_suffix}%{?!use_sip4:%python_sitearch/PyQt5/bindings} + +%pyqt_build(c:m:s:v) \ +export CXXFLAGS="%{optflags}" \ +export CFLAGS="%{optflags}" \ +%{python_expand # \ +%if 0%{?use_sip4} \ + mkdir build \ + pushd build \ + [ -d ../config-tests ] && ln -s ../config-tests . \ + [ -d ../sip ] && ln -s ../sip . \ + $python ../configure.py \\\ + %{-v:--verbose}%{!-v:-w} \\\ + --sip=%{_bindir}/sip-%{$python_bin_suffix} \\\ + --qmake=%{_bindir}/qmake-qt5 \\\ + %{-c*} \\\ + QMAKE_CFLAGS+="${CFLAGS} ${CPPFLAGS}" \\\ + QMAKE_CXXFLAGS+="${CXXFLAGS} ${CPPFLAGS}" \ + popd \ +%else \ + sip-build-%{$python_bin_suffix} \\\ + --verbose \\\ + --api-dir %{_libqt5_datadir}/qsci/api/python_%{$python_bin_suffix}/ \\\ + --debug \\\ + --no-make \\\ + --qmake=%{_libqt5_qmake} \\\ + --qmake-setting "QMAKE_CFLAGS += ${CFLAGS} ${CPPFLAGS}" \\\ + --qmake-setting "QMAKE_CXXFLAGS += ${CXXFLAGS} ${CPPFLAGS}" \\\ + %{-s*} \ +%endif \ +pushd build \ +make %{?_smp_mflags} %{-m*} \ +popd \ +} \ +%{nil} + +%pyqt_install \ +%{python_expand pushd build \ +%make_install INSTALL_ROOT=%{buildroot} \ +popd \ +%if 0%{?use_sip4} \ +[ -d %{buildroot}%{_libqt5_datadir}/qsci/api/python ] \\\ + && mv -T %{buildroot}%{_libqt5_datadir}/qsci/api/python \\\ + %{buildroot}%{_libqt5_datadir}/qsci/api/python_%{$python_bin_suffix} \ +[ -d %{buildroot}/%{_datadir}/sip/PyQt5 ] \\\ + && mv -T %{buildroot}/%{_datadir}/sip/PyQt5 %{buildroot}/%{_datadir}/sip/PyQt5-%{$python_bin_suffix} \ +%endif \ +find %{buildroot}%{_libqt5_plugindir} -name '*pyqt5*.so' \\\ + | while read f; do mv ${f} ${f/pyqt5/py%{$python_bin_suffix}qt5}; done \ +} \ +%{nil} + +%pyqt_install_examples() \ +%{python_expand # install example files \ +exdir=%{buildroot}%{_docdir}/%{$python_prefix}-%{1} \ +mkdir -p $exdir \ +cp -r examples $exdir/ \ +# Fix wrong-script-interpreter \ +find $exdir -name "*.py" -exec sed -i "1 s|^#!%{_bindir}/env python.*$|#!%{_bindir}/$python|" {} \\; \ +%fdupes $exdir \ +} \ +%{nil} diff --git a/python-pyqt-rpm-macros.changes b/python-pyqt-rpm-macros.changes new file mode 100644 index 0000000..989df5e --- /dev/null +++ b/python-pyqt-rpm-macros.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 23 22:20:18 UTC 2020 - Benjamin Greiner + +- update to version 0.0.2 + * runtime requirement: fdupes + +------------------------------------------------------------------- +Thu Sep 3 20:49:21 UTC 2020 - Benjamin Greiner + +- initial version 0.0.1 diff --git a/python-pyqt-rpm-macros.spec b/python-pyqt-rpm-macros.spec new file mode 100644 index 0000000..2791505 --- /dev/null +++ b/python-pyqt-rpm-macros.spec @@ -0,0 +1,49 @@ +# +# spec file for package python-pyqt-rpm-macros +# +# Copyright (c) 2020 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/ +# + + +Name: python-pyqt-rpm-macros +Version: 0.0.1 +Release: 0 +Summary: RPM macros for building PyQt packages +License: WTFPL +URL: https://build.opensuse.org/package/show/home:bnavigator:sip5/python-pyqt-rpm-macros +Source0: macros.pyqt +Source1: LICENSE +Requires: fdupes +Requires: python-rpm-macros +# this is not a singlespec package +Requires: (python-sip-devel or python3-sip-devel) +BuildArch: noarch + +%description +This package provides some macros for using SIP4 or SIP5 to build PyQt5 packages + +%prep +cp %{SOURCE1} . + +%build + +%install +mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ +install -m 644 %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/ + +%files +%license LICENSE +%{_rpmconfigdir}/macros.d/macros.pyqt + +%changelog