# Created by pyp2rpm-3.2.3 %global pypi_name Naked %global _description Naked is a new Python command line application framework \ that makes creating command line options and sub-commands \ simpler. Name: python-%{pypi_name} Version: 0.1.31 Release: 2%{?dist} Summary: A command line application framework License: MIT URL: http://naked-py.com Source0: https://files.pythonhosted.org/packages/source/N/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python3-devel BuildRequires: python3-setuptools BuildArch: noarch %description %{_description} %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python2-Naked Requires: python2-pyyaml Requires: python2-requests Requires: python2-setuptools %description -n python2-%{pypi_name} %{_description} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3-Naked Requires: python3-pyyaml Requires: python3-requests Requires: python3-setuptools %description -n python3-%{pypi_name} %{_description} %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %py3_build sed -i -e '1d' lib/Naked/templates/licenses.py sed -i -e '1d' lib/Naked/templates/readme_md_file.py %install function update_scripts() { for f in $(find "${1}" -name '*.py*'); do if [ x"$(head -n1 "${f}")" == "x#!/usr/bin/env python" ]; then sed -i -e '1d' "${f}" fi done find "${1}" \( -name '*.c' -or -name '*.sh' \) -delete } # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. %py3_install cp %{buildroot}/%{_bindir}/naked %{buildroot}/%{_bindir}/naked-%{python3_version} ln -s %{_bindir}/naked-%{python3_version} %{buildroot}/%{_bindir}/naked-3 update_scripts "%{buildroot}/%{python3_sitelib}/%{pypi_name}" %py2_install cp %{buildroot}/%{_bindir}/naked %{buildroot}/%{_bindir}/naked-%{python2_version} ln -s %{_bindir}/naked-%{python2_version} %{buildroot}/%{_bindir}/naked-2 update_scripts "%{buildroot}/%{python2_sitelib}/%{pypi_name}" %files -n python2-%{pypi_name} %license docs/LICENSE lib/Naked/templates/licenses.py %doc docs/README.rst lib/Naked/templates/readme_md_file.py %{_bindir}/naked %{_bindir}/naked-2 %{_bindir}/naked-%{python2_version} %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %files -n python3-%{pypi_name} %license docs/LICENSE lib/Naked/templates/licenses.py %doc docs/README.rst lib/Naked/templates/readme_md_file.py %{_bindir}/naked-3 %{_bindir}/naked-%{python3_version} %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Thu Nov 16 2017 Gregory Hellings - 0.1.31-2 - Fixed description length - Fixed executable file lint errors * Mon Sep 25 2017 Gregory Hellings - 0.1.31-1 - Initial package.