+macros.pyqt5

This commit is contained in:
Rex Dieter 2015-01-06 12:16:40 -06:00
parent 64cb1ff764
commit c04de4dd68
2 changed files with 27 additions and 1 deletions

8
macros.pyqt5 Normal file
View File

@ -0,0 +1,8 @@
%pyqt5 @@NAME@@
%pyqt5_epoch @@EPOCH@@
%pyqt5_version @@VERSION@@
%pyqt5_evr @@EVR@@
%pyqt5_requires \
Requires: %{pyqt5} >= %{pyqt5_evr} \
%{nil}

View File

@ -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 <rdieter@fedoraproject.org> 5.4-5
- +macros.pyqt5
* Fri Jan 02 2015 Rex Dieter <rdieter@fedoraproject.org> 5.4-4
- -devel: restore dep on base pkg