Clean up with_python3 spec redundancies
This commit is contained in:
		
							parent
							
								
									dfee241f19
								
							
						
					
					
						commit
						27e546ea9d
					
				| @ -1,8 +0,0 @@ | ||||
| #!/bin/sh | ||||
| @PYTHON3@ -Ic "import PyQt5.pylupdate_main" &> /dev/null | ||||
| if [ $? -eq 0 ]; then | ||||
|   exec @PYTHON3@ -Im PyQt5.pylupdate_main ${1+"$@"} | ||||
| else | ||||
|   exec @PYTHON2@ -c "import sys; del sys.path[0]; import PyQt5.pylupdate_main; PyQt5.pylupdate_main.main()" ${1+"$@"} | ||||
| 
 | ||||
| fi | ||||
| @ -1,7 +0,0 @@ | ||||
| #!/bin/sh | ||||
| @PYTHON3@ -Ic "import PyQt5.pyrcc_main" &> /dev/null | ||||
| if [ $? -eq 0 ]; then | ||||
|   exec @PYTHON3@ -Im PyQt5.pyrcc_main ${1+"$@"} | ||||
| else | ||||
|   exec @PYTHON2@ -c "import sys; del sys.path[0]; import PyQt5.pyrcc_main; PyQt5.pyrcc_main.main()" ${1+"$@"} | ||||
| fi | ||||
| @ -1,5 +1,4 @@ | ||||
| %if 0%{?fedora} || 0%{?rhel} > 6 | ||||
| %global with_python3 1 | ||||
| %global python3_dbus_dir %(%{__python3} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])" 2>/dev/null || echo "%{python3_sitearch}/dbus/mainloop") | ||||
| %endif | ||||
| 
 | ||||
| @ -24,7 +23,7 @@ | ||||
| Summary: PyQt5 is Python bindings for Qt5 | ||||
| Name:    python-qt5 | ||||
| Version: 5.15.4 | ||||
| Release: 1%{?dist} | ||||
| Release: 2%{?dist} | ||||
| 
 | ||||
| License: GPLv3 | ||||
| Url:     http://www.riverbankcomputing.com/software/pyqt/ | ||||
| @ -32,10 +31,6 @@ Url:     http://www.riverbankcomputing.com/software/pyqt/ | ||||
| Source0: https://pypi.python.org/packages/source/P/PyQt5/PyQt5-%{version}.tar.gz | ||||
| 
 | ||||
| Source1: macros.pyqt5 | ||||
| # wrapper, see https://bugzilla.redhat.com/show_bug.cgi?id=1193107#c9 | ||||
| Source2: pylupdate5.sh | ||||
| Source3: pyrcc5.sh | ||||
| Source4: pyuic5.sh | ||||
| 
 | ||||
| ## upstream patches | ||||
| 
 | ||||
| @ -74,12 +69,10 @@ BuildRequires: pkgconfig(Qt5X11Extras) | ||||
| BuildRequires: pkgconfig(Qt5Xml) pkgconfig(Qt5XmlPatterns) | ||||
| BuildRequires: pkgconfig(Qt5WebChannel) | ||||
| BuildRequires: pkgconfig(Qt5WebSockets) | ||||
| %if 0%{?with_python3} | ||||
| BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion} | ||||
| BuildRequires: python%{python3_pkgversion}-dbus | ||||
| BuildRequires: %{py3_dist PyQt-builder} >= 1.1.0 | ||||
| BuildRequires: %{py3_dist sip} >= 5.3 | ||||
| %endif # with_python3 | ||||
| 
 | ||||
| # when split out | ||||
| %if 0%{?webengine} || 0%{?webkit} | ||||
| @ -180,10 +173,6 @@ Requires:  python%{python3_pkgversion}-qt5%{?_isa} = %{version}-%{release} | ||||
| PATH=%{_qt5_bindir}:$PATH ; export PATH | ||||
| 
 | ||||
| # Python 3 build: | ||||
| %if 0%{?with_python3} | ||||
| mkdir %{_target_platform}-python3 | ||||
| cp -a * %{_target_platform}-python3/ ||: | ||||
| pushd %{_target_platform}-python3 | ||||
| sip-build \ | ||||
|   --no-make \ | ||||
|   --qt-shared \ | ||||
| @ -198,20 +187,12 @@ sip-build \ | ||||
|   --qmake-setting 'QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}"' | ||||
| 
 | ||||
| %make_build -C build | ||||
| popd | ||||
| %endif # with_python3 | ||||
| 
 | ||||
| 
 | ||||
| %install | ||||
| 
 | ||||
| # Python 3 build: | ||||
| %if 0%{?with_python3} | ||||
| %make_install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-python3/build | ||||
| if [ "%{_prefix}" != "/usr" ]; then | ||||
|   cp -ru %{buildroot}/usr/* %{buildroot}%{_prefix}/ | ||||
|   rm -rf %{buildroot}/usr/* | ||||
| fi | ||||
| 
 | ||||
| %make_install INSTALL_ROOT=%{buildroot} -C build | ||||
| if [ "%{_prefix}" != "/usr" ]; then | ||||
|   cp -ru %{buildroot}/usr/* %{buildroot}%{_prefix}/ || echo "Nothing to copy" | ||||
|   rm -rf %{buildroot}/usr/* | ||||
| @ -223,13 +204,6 @@ fi | ||||
| 
 | ||||
| # ensure .so modules are executable for proper -debuginfo extraction | ||||
| find %{buildroot} -type f -name '*.so' | xargs chmod a+rx | ||||
| #for i in %%{buildroot}%%{python3_sitearch}/PyQt5/*.so %%{buildroot}%%{python3_dbus_dir}/pyqt5.so ; do | ||||
| #test -x $i  || chmod a+rx $i | ||||
| #done | ||||
| %endif # with_python3 | ||||
| 
 | ||||
| # 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} \ | ||||
| @ -241,24 +215,10 @@ sed -i \ | ||||
|   -e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \ | ||||
|   %{buildroot}%{rpm_macros_dir}/macros.pyqt5 | ||||
| 
 | ||||
| %if 0%{?with_python3} | ||||
| # install wrappers to handle both/either python2/python3 | ||||
| # TODO: consider alternatives? -- rex | ||||
| rm -fv %{buildroot}%{_bindir}/{pyrcc5,pylupdate5,pyuic5} | ||||
| install -p -m755 -D %{SOURCE2} %{buildroot}%{_bindir}/pylupdate5 | ||||
| install -p -m755 -D %{SOURCE3} %{buildroot}%{_bindir}/pyrcc5 | ||||
| install -p -m755 -D %{SOURCE4} %{buildroot}%{_bindir}/pyuic5 | ||||
| sed -i \ | ||||
|   -e "s|@PYTHON3@|%{__python3}|g" \ | ||||
|   -e "s|@PYTHON2@|%{__python2}|g" \ | ||||
|   %{buildroot}%{_bindir}/{pyrcc5,pylupdate5,pyuic5} | ||||
| %endif | ||||
| 
 | ||||
| 
 | ||||
| %files rpm-macros | ||||
| %{rpm_macros_dir}/macros.pyqt5 | ||||
| 
 | ||||
| %if 0%{?with_python3} | ||||
| %files -n python%{python3_pkgversion}-qt5 | ||||
| %if 0%{?enginio} | ||||
| %{python3_sitearch}/PyQt5/Enginio.* | ||||
| @ -336,7 +296,6 @@ sed -i \ | ||||
| 
 | ||||
| %files -n python%{python3_pkgversion}-qt5-devel | ||||
| %{python3_sitearch}/PyQt5/bindings/ | ||||
| %endif # with_python3 | ||||
| 
 | ||||
| %files doc | ||||
| #doc doc/* | ||||
| @ -349,6 +308,10 @@ sed -i \ | ||||
| 
 | ||||
| 
 | ||||
| %changelog | ||||
| * Wed Sep 29 2021 FeRD (Frank Dana) <ferdnyc@gmail.com> - 5.15.4-2 | ||||
| - Eliminate conditional python3 build, associated redundancies | ||||
| - Don't install py2+py3 wrappers for tool commands | ||||
| 
 | ||||
| * Wed Sep 15 2021 Sandro Mani <manisandro@gmail.com> - 5.15.4-1 | ||||
| - Update to 5.15.4 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user