1
0

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
This commit is contained in:
Luca Beltrame 2020-11-05 07:34:03 +00:00 committed by Git OBS Bridge
commit 549dba9539
6 changed files with 156 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

7
LICENSE Normal file
View File

@ -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.

66
macros.pyqt Normal file
View File

@ -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}

View File

@ -0,0 +1,10 @@
-------------------------------------------------------------------
Fri Oct 23 22:20:18 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- update to version 0.0.2
* runtime requirement: fdupes
-------------------------------------------------------------------
Thu Sep 3 20:49:21 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- initial version 0.0.1

View File

@ -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