]> git.pld-linux.org Git - packages/gyp.git/commitdiff
- allow building with python3, but still use python2 by default
authorMarcin Krol <hawk@tld-linux.org>
Sat, 2 Apr 2022 10:16:46 +0000 (10:16 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 2 Apr 2022 10:16:46 +0000 (10:16 +0000)
gyp.spec

index 0f008ff74e895c95cc31d21c630ff6083391f53a..bf5a2942e6eef6bd4b2717b00314e6963760a9b4 100644 (file)
--- a/gyp.spec
+++ b/gyp.spec
@@ -1,6 +1,7 @@
 #
 # Conditional build:
 %bcond_with    tests           # build without tests
+%bcond_with    python3         # build with python 2.x
 
 %define                gitrev  e87d37d6
 %define                rel     1
@@ -22,10 +23,12 @@ Patch3:         gyp-python38.patch
 Patch4:         gyp-fix-cmake.patch
 Patch5:         gyp-python39.patch
 URL:           https://gyp.gsrc.io/
-BuildRequires: python-devel
+%{!?with_python3:BuildRequires:        python-devel}
+%{?with_python3:BuildRequires: python3-devel}
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.219
-Requires:      python-%{name} = %{version}-%{release}
+%{!?with_python3:Requires:     python-%{name} = %{version}-%{release}}
+%{?with_python3:Requires:      python3-%{name} = %{version}-%{release}}
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -66,6 +69,29 @@ poszczególnych platform, aby obsłużyć różnice między nimi.
 
 Ten pakiet zawiera moduły Pythona.
 
+%package -n python3-%{name}
+Summary:       Python modules for GYP
+Summary(pl.UTF-8):     Moduły Pythona module dla GYP
+Group:         Development/Languages/Python
+
+%description -n python3-%{name}
+GYP is a tool to generates native Visual Studio, Xcode and SCons
+and/or make build files from a platform-independent input format. It's
+syntax is a universal cross-platform build representation that still
+allows sufficient per-platform flexibility to accommodate
+poszczególnych platform, aby obsłużyć różnice między nimi.
+
+This package contains Python modules.
+
+%description -n python3-%{name} -l pl.UTF-8
+GYP to narzędzie generujące natywne pliki budowania dla Visual Studio,
+Xcode, SCons i/lub make'a z formatu wejściowego niezależnego od
+platformy. Składnia jest uniwersalną, wieloplatformową reprezentacją
+reguł, która nadal pozwala na wystarczającą elastyczność dla
+poszczególnych platform, aby obsłużyć różnice między nimi.
+
+Ten pakiet zawiera moduły Pythona.
+
 %prep
 %setup -q -c
 %patch0 -p1
@@ -76,16 +102,23 @@ Ten pakiet zawiera moduły Pythona.
 %patch5 -p1
 
 %build
+%if %{with python3}
+%py3_build
+%else
 %py_build
+%endif
 
 %{?with_tests:%{__python} gyptest.py -a}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python3}
+%py3_install
+%else
 %py_install
-
 %py_postclean
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -95,13 +128,26 @@ rm -rf $RPM_BUILD_ROOT
 %doc AUTHORS LICENSE
 %attr(755,root,root) %{_bindir}/gyp
 
+%if %{with python3}
+%files -n python3-%{name}
+%defattr(644,root,root,755)
+%dir %{py3_sitescriptdir}/gyp
+%dir %{py3_sitescriptdir}/gyp/generator
+%{py3_sitescriptdir}/gyp/*.py
+%{py3_sitescriptdir}/gyp/__pycache__
+%{py3_sitescriptdir}/gyp/generator/*.py
+%{py3_sitescriptdir}/gyp/generator/__pycache__
+%{py3_sitescriptdir}/gyp-%{version}-py*.egg-info
+%endif
+
+%if !%{with python3}
 %files -n python-%{name}
 %defattr(644,root,root,755)
 %dir %{py_sitescriptdir}/gyp
 %dir %{py_sitescriptdir}/gyp/generator
 %{py_sitescriptdir}/gyp/*.py[co]
 %{py_sitescriptdir}/gyp/generator/*.py[co]
-
 %if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/gyp-%{version}-py*.egg-info
 %endif
+%endif
This page took 0.096046 seconds and 4 git commands to generate.