Closed MrMEEE closed 4 years ago
Could you please also paste the exact output of the epel template without scl option?
pyp2rpm -b3 -s -d /home/awx/depends/python3/SPECS/ xmlsec -v1.3.3 -tepel7
=
# Created by pyp2rpm-3.3.2
%global pypi_name xmlsec
Name: python-%{pypi_name}
Version: 1.3.3
Release: 1%{?dist}
Summary: Python bindings for the XML Security Library
License: MIT
URL: https://github.com/mehcode/python-xmlsec
Source0: https://files.pythonhosted.org/packages/source/x/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-lxml >= 3.0
BuildRequires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-pkgconfig
BuildRequires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-lxml >= 3.0
BuildRequires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-pkgconfig
BuildRequires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-setuptools
%description
%package -n python%{python3_pkgversion}-%{pypi_name}
Summary: Python bindings for the XML Security Library
Requires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-lxml >= 3.0
Requires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-pkgconfig
%description -n python%{python3_pkgversion}-%{pypi_name}
%package -n python%{python3_pkgversion}-%{pypi_name}
Summary: Python bindings for the XML Security Library
Requires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-lxml >= 3.0
Requires: python%{python3_pkgversion}-python%{python%{python3_pkgversion}_pkgversion}-pkgconfig
%description -n python%{python3_pkgversion}-%{pypi_name}
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%install
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
%{__python3} setup.py install --skip-build --root %{buildroot}
%{__python3} setup.py install --skip-build --root %{buildroot}
%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%{python3_sitearch}/%{pypi_name}
%{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info
%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%{python3_sitearch}/%{pypi_name}
%{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info
%changelog
* Fri Jan 18 2019 - 1.3.3-1
Template looks fine:
{{ data.credit_line }}
{% from 'macros.spec' import dependencies, for_python_versions, underscored_or_pypi -%}
%global pypi_name {{ data.name }}
{%- if data.srcname %}
%global srcname {{ data.srcname }}
{%- endif %}
Name: {{ data.pkg_name|macroed_pkg_name(data.srcname) }}
Version: {{ data.version }}
Release: 1%{?dist}
Summary: {{ data.summary }}
License: {{ data.license }}
URL: {{ data.home_page }}
Source0: {{ data.source0|replace(data.name, '%{pypi_name}')|replace(data.version, '%{version}') }}
{%- if not data.has_extension %}
BuildArch: noarch
{%- endif %}
{%- for pv in data.sorted_python_versions %}
{{ dependencies(data.build_deps, False, pv, data.base_python_version, use_with=False) }}
{%- endfor %}
%description
{{ data.description|truncate(400)|wordwrap }}
{% for pv in data.sorted_python_versions %}
%package -n {{data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(pv, True)}}
Summary: {{ data.summary }}
{{ dependencies(data.runtime_deps, True, pv, pv, use_with=False) }}
%description -n {{data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(pv, True)}}
{{ data.description|truncate(400)|wordwrap }}
{% endfor -%}
{%- if data.sphinx_dir %}
%package -n python-%{pypi_name}-doc
Summary: {{ data.name }} documentation
%description -n python-%{pypi_name}-doc
Documentation for {{ data.name }}
{%- endif %}
%prep
%autosetup -n {{ data.dirname|replace(data.name, '%{pypi_name}')|replace(data.version, '%{version}')|default('%{pypi_name}-%{version}', true) }}
{%- if data.has_bundled_egg_info %}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
{%- endif %}
%build
{%- for pv in data.sorted_python_versions %}
{% if data.has_extension %}CFLAGS="$RPM_OPT_FLAGS" {% endif %}%{__python{{ pv }}} setup.py build
{%- endfor %}
{%- if data.sphinx_dir %}
# generate html docs
PYTHONPATH=${PWD} {{ "sphinx-build"|script_name_for_python_version(data.base_python_version, False, False) }} {{ data.sphinx_dir }} html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
{%- endif %}
%install
{%- if data.python_versions|length > 0 %}
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
{%- endif %}
{%- for pv in data.python_versions + [data.base_python_version] %}
{%- if pv == data.base_python_version and data.python_versions and data.scripts %}
rm -rf %{buildroot}%{_bindir}/*
{%- endif %}
%{__python{{ pv }}} setup.py install --skip-build --root %{buildroot}
{%- endfor -%}
{% if data.has_test_suite %}
%check
{%- for pv in data.sorted_python_versions %}
%{__python{{ pv }}} setup.py test
{%- endfor %}
{%- endif %}
{% for pv in data.sorted_python_versions %}
%files -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(pv, True) }}
{%- if data.doc_files %}
%doc {{data.doc_files|join(' ') }}
{%- endif %}
{%- if pv == data.base_python_version %}
{%- for script in data.scripts %}
%{_bindir}/{{ script }}
{%- endfor %}
{%- endif %}
{%- if data.py_modules %}
{%- for module in data.py_modules -%}
{%- if pv == '3' %}
%dir %{python{{ pv }}_sitelib}/__pycache__/
%{python{{ pv }}_sitelib}/__pycache__/*
{%- endif %}
%{python{{ pv }}_sitelib}/{{ data.name | module_to_path(module) }}.py{% if pv != '3'%}*{% endif %}
{%- endfor %}
{%- endif %}
{%- if data.has_extension %}
{%- if data.has_packages %}
{%- for package in data.packages %}
%{python{{ pv }}_sitearch}/{{ package | package_to_path(data.name) }}
{%- endfor %}
{%- endif %}
{%- if data.has_pth %}
%{python{{ pv }}_sitearch}/{{ underscored_or_pypi(data.name, data.underscored_name) }}-%{version}-py?.?-*.pth
{%- endif %}
%{python{{ pv }}_sitearch}/{{ underscored_or_pypi(data.name, data.underscored_name) }}-%{version}-py?.?.egg-info
{%- else %}
{%- if data.has_packages %}
{%- for package in data.packages %}
%{python{{ pv }}_sitelib}/{{ package | package_to_path(data.name) }}
{%- endfor %}
{%- endif %}
{%- if data.has_pth %}
%{python{{ pv }}_sitelib}/{{ underscored_or_pypi(data.name, data.underscored_name) }}-%{version}-py?.?-*.pth
{%- endif %}
%{python{{ pv }}_sitelib}/{{ underscored_or_pypi(data.name, data.underscored_name) }}-%{version}-py?.?.egg-info
{%- endif %}
{% endfor %}
{%- if data.sphinx_dir %}
%files -n python-%{pypi_name}-doc
%doc html
{%- if data.doc_license %}
%license {{data.doc_license|join(' ')}}
{%- endif %}
{% endif %}
%changelog
* {{ data.changelog_date_packager }} - {{ data.version }}-1
- Initial package.
btw. version is the newest installed from git 2 days ago...
I can reproduce this.
The epel template uses Python 2 as default base and Python 3 as default additional.
Without -b3
, a valid py2+py3 spec is created.
I was able to create a py3 only package with -b3 -p3
. Not very intuitive, but it works.
I've marked this a s a bug, but currently there is nobody who has free cycles to fix pyp2rpm bugs. Sorry about that. Hope the workaround works for you in the meantime.
Ok.. thanks for the workarounds :)
Well it's not double anymore, but something is wrong with the deps:
with -b3 -p3:
bash-4.2$ scl enable rh-python36 "rpmbuild -ba --define 'scl rh-python36' python-xmlsec.spec"
error: Failed build dependencies:
rh-python36-python34-devel is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
rh-python36-python34-python%{python34_pkgversion}-lxml >= 3.0 is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
rh-python36-python34-python%{python34_pkgversion}-pkgconfig is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
rh-python36-python34-python%{python34_pkgversion}-setuptools is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
with no -b or -p:
bash-4.2$ scl enable rh-python36 "rpmbuild -ba --define 'scl rh-python36' python-xmlsec.spec"
error: Failed build dependencies:
rh-python36-python2-devel is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
rh-python36-python2-setuptools is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
rh-python36-python34-devel is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
rh-python36-python34-setuptools is needed by rh-python36-python-xmlsec-1.3.3-1.el7.centos.x86_64
This might be in regards to spec2scl
Yes I don't think that spec2scl was ever tested on EPEL Python 3 packages.
This should be resolved in v.3.3.4. Please re-open if you can reproduce the issue.
When running:
scl enable rh-python36 "pyp2rpm -b3 -s -d SPECS/ xmlsec -v1.3.3 -tepel6 --sclize"
It get this output??:This also happens when i'm not using the software collection... also tried without "--sclize", same result, with out scl...
When using the fedora template (-dfedora), this does not happen???