]> git.pld-linux.org Git - projects/template-specs.git/blobdiff - python.spec
better arch selection for ocaml_opt bcond
[projects/template-specs.git] / python.spec
index dee1588797504edd88a6f8ff3554f6fe2c22c260..09fa6184067d5fb2f64a757b59329150e7e9b752 100644 (file)
@@ -23,17 +23,19 @@ BuildRequires:      rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.219
 # when using /usr/bin/env or other in-place substitutions
 #BuildRequires:        sed >= 4.0
+# when python3 present
 %if %{with python2}
 BuildRequires: python-devel
-BuildRequires: python-distribute
+BuildRequires: python-setuptools
 %endif
 %if %{with python3}
 BuildRequires: python3-devel
-BuildRequires: python3-distribute
 BuildRequires: python3-modules
+BuildRequires: python3-setuptools
 %endif
+# Below Rs only work for main package (python2)
 #Requires:             python-libs
-Requires:              python-modules
+Requires:      python-modules
 #BuildArch:    noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -45,6 +47,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 Summary:       -
 Summary(pl.UTF-8):     -
 Group:         Libraries/Python
+Requires:      python3-modules
 
 %description -n python3-%{module}
 
@@ -67,18 +70,23 @@ Dokumentacja API %{module}.
 # fix #!/usr/bin/env python -> #!/usr/bin/python:
 #%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
 
+# setup copy of source in py3 dir
+set -- *
+install -d py3
+cp -a "$@" py3
+
 %build
 %if %{with python2}
 # CC/CFLAGS is only for arch packages - remove on noarch packages
 CC="%{__cc}" \
-CFLAGS="%{rpmcflags}" \
+CFLAGS="%{rpmcppflags} %{rpmcflags}" \
 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
 %endif
 
 %if %{with python3}
 # CC/CFLAGS is only for arch packages - remove on noarch packages
 CC="%{__cc}" \
-CFLAGS="%{rpmcflags}" \
+CFLAGS="%{rpmcppflags} %{rpmcflags}" \
 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
 %endif
 
This page took 0.037558 seconds and 4 git commands to generate.