https://bugzilla.redhat.com/show_bug.cgi?id=1562964 --- Comment #2 from Robert-André Mauchin <zebob.m@xxxxxxxxx> --- Proposed SPEC: # set upstream name variable %global srcname pycares %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif Name: python-pycares Version: 2.3.0 Release: 1%{?dist} Summary: Python interface for c-ares License: MIT URL: https://github.com/saghul/pycares Source0: https://github.com/saghul/%{srcname}/archive/%{srcname}-%{version}.tar.gz BuildRequires: python2-devel # for docs BuildRequires: python2-sphinx %if %{with python3} BuildRequires: python3-devel %endif # with python3 %description pycares is a Python module which provides an interface to c-ares. c-ares is a C library that performs DNS requests and name resolutions asynchronously. %package -n python2-%{srcname} Summary: Python interface for c-ares %description -n python2-%{srcname} pycares is a Python module which provides an interface to c-ares. c-ares is a C library that performs DNS requests and name resolutions asynchronously. %if %{with python3} %package -n python3-%{srcname} Summary: Python interface for c-ares %description -n python3-%{srcname} pycares is a Python module which provides an interface to c-ares. c-ares is a C library that performs DNS requests and name resolutions asynchronously. %endif # with python3 %package -n python-%{srcname}-doc Summary: Documentation for python-pycares BuildArch: noarch Requires: python2-%{srcname} %description -n python-%{srcname}-doc pycares is a Python module which provides an interface to c-ares. c-ares is a C library that performs DNS requests and name resolutions asynchronously. This package contains documentation in reST and HTML formats. %prep %autosetup -n %{srcname}-%{srcname}-%{version} %build %py2_build %if %{with python3} %py3_build %endif # with python3 # Build sphinx documentation pushd docs/ make html popd # docs %install # Must do the python3 install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 version # to be the default for now). %if %{with python3} %py3_install %endif # with python3 %py2_install # Install html docs mkdir -p %{buildroot}%{_pkgdocdir}/ cp -pr docs/_build/html %{buildroot}%{_pkgdocdir}/ # Move sources mkdir -p %{buildroot}%{_pkgdocdir}/rst/ mv -f %{buildroot}%{_pkgdocdir}/html/_sources/* %{buildroot}%{_pkgdocdir}/rst/ rmdir %{buildroot}%{_pkgdocdir}/html/_sources/ # Remove buildinfo sphinx documentation rm -rf %{buildroot}%{_pkgdocdir}/html/.buildinfo # Fix non-standard modes (775) chmod 755 %{buildroot}%{python2_sitearch}/%{srcname}/_core.so chmod 755 %{buildroot}%{python3_sitearch}/%{srcname}/_core.cpython-*.so %check %{__python2} setup.py test -s pycares._core %if %{with python3} %{__python3} setup.py test -s pycares._core %endif %files -n python2-%{srcname} %license LICENSE %doc README.rst ChangeLog # For arch-specific packages: sitearch %{python2_sitearch}/%{srcname}/ %{python2_sitearch}/%{srcname}-%{version}-*.egg-info/ %if %{with python3} %files -n python3-%{srcname} %license LICENSE %doc README.rst ChangeLog # For arch-specific packages: sitearch %{python3_sitearch}/%{srcname}/ %{python3_sitearch}/%{srcname}-%{version}-*.egg-info/ %endif # with python3 %files -n python-%{srcname}-doc %doc examples %{_pkgdocdir}/html/ %{_pkgdocdir}/rst/ %changelog * Mon Apr 2 2018 Matthieu Saulnier <fantom@xxxxxxxxxxxxxxxxx> - 2.3.0-1 - Initial package -- You are receiving this mail because: You are on the CC list for the bug. You are always notified about changes to this product and component _______________________________________________ package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx