From c04de4dd6831e5f72a4a5505b2359590543f49d5 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 6 Jan 2015 12:16:40 -0600 Subject: [PATCH] +macros.pyqt5 --- macros.pyqt5 | 8 ++++++++ python-qt5.spec | 20 +++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 macros.pyqt5 diff --git a/macros.pyqt5 b/macros.pyqt5 new file mode 100644 index 0000000..f5e629d --- /dev/null +++ b/macros.pyqt5 @@ -0,0 +1,8 @@ +%pyqt5 @@NAME@@ +%pyqt5_epoch @@EPOCH@@ +%pyqt5_version @@VERSION@@ +%pyqt5_evr @@EVR@@ + +%pyqt5_requires \ +Requires: %{pyqt5} >= %{pyqt5_evr} \ +%{nil} diff --git a/python-qt5.spec b/python-qt5.spec index 23710a4..faa6ac0 100644 --- a/python-qt5.spec +++ b/python-qt5.spec @@ -8,10 +8,12 @@ %global python2_dbus_dir %(%{__python2} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])") #global python2_dbus_dir %(d=%{python2_sitearch}/dbus/mainloop; [ -d $d ] || d=%{python2_sitelib}/dbus/mainloop; echo $d) +%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) + Summary: Python bindings for Qt5 Name: python-qt5 Version: 5.4 -Release: 4%{?dist} +Release: 5%{?dist} # all BSD, except for GPLv2+ dbus bindings and examples License: BSD and GPLv2+ @@ -21,6 +23,7 @@ Source0: http://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt-gpl-%{ver %else Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQt-gpl-%{version}.tar.gz %endif +Source1: macros.pyqt5 ## upstream patches @@ -170,11 +173,22 @@ rm -rfv %{buildroot}%{python2_sitearch}/PyQt5/uic/port_v3/ # remove Python2 code from Python3 directory (for when/if we support python3 here) rm -rfv %{buildroot}%{python3_sitearch}/PyQt5/uic/port_v2/ +# rpm macros +install -p -m644 -D %{SOURCE1} \ + %{buildroot}%{rpm_macros_dir}/macros.pyqt5 +sed -i \ + -e "s|@@NAME@@|%{name}|g" \ + -e "s|@@EPOCH@@|%{?epoch}%{!?epoch:0}|g" \ + -e "s|@@VERSION@@|%{version}|g" \ + -e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \ + %{buildroot}%{rpm_macros_dir}/macros.pyqt5 + %if 0%{?with_python2} %files %doc NEWS README %doc LICENSE +%{rpm_macros_dir}/macros.pyqt5 %{python2_dbus_dir}/pyqt5.so %{_qt5_plugindir}/PyQt5/ %dir %{python2_sitearch}/PyQt5/ @@ -221,6 +235,7 @@ rm -rfv %{buildroot}%{python3_sitearch}/PyQt5/uic/port_v2/ %files -n python3-qt5 %doc NEWS README %doc LICENSE +%{rpm_macros_dir}/macros.pyqt5 %{python3_dbus_dir}/pyqt5.so %dir %{python3_sitearch}/PyQt5/ %{python3_sitearch}/PyQt5/__pycache__/ @@ -268,6 +283,9 @@ rm -rfv %{buildroot}%{python3_sitearch}/PyQt5/uic/port_v2/ %changelog +* Tue Jan 06 2015 Rex Dieter 5.4-5 +- +macros.pyqt5 + * Fri Jan 02 2015 Rex Dieter 5.4-4 - -devel: restore dep on base pkg