688bbdd
# Created by pyp2rpm-1.1.1
688bbdd
%global sname wrapt
688bbdd
51db19a
%if 0%{?fedora} || 0%{?rhel} >= 7
9ef5a7d
%global with_python3 1
51db19a
%endif
51db19a
%if 0%{?fedora}
a9fa12e
%global with_docs 1
9ef5a7d
%endif
9ef5a7d
9ef5a7d
%{!?_licensedir: %global license %%doc}
9ef5a7d
688bbdd
Name:           python-%{sname}
688bbdd
Version:        1.10.4
51db19a
Release:        7%{?dist}
688bbdd
Summary:        A Python module for decorators, wrappers and monkey patching
688bbdd
688bbdd
License:        BSD
688bbdd
URL:            https://github.com/GrahamDumpleton/wrapt
688bbdd
Source0:        https://github.com/GrahamDumpleton/%{sname}/archive/%{version}.tar.gz
688bbdd
688bbdd
BuildRequires:  python2-devel
688bbdd
9ef5a7d
%if 0%{?with_python3}
51db19a
BuildRequires:  python3-pkgversion-macros
51db19a
BuildRequires:  python%{python3_pkgversion}-devel
51db19a
%if 0%{?with_python3_other}
51db19a
BuildRequires:  python%{python3_other_pkgversion}-devel
51db19a
%endif
9ef5a7d
%endif
9ef5a7d
688bbdd
%description
688bbdd
The aim of the wrapt module is to provide a transparent object proxy
688bbdd
for Python, which can be used as the basis for the construction of
688bbdd
function wrappers and decorator functions.
688bbdd
a9fa12e
%if 0%{?with_docs}
688bbdd
%package doc
688bbdd
Summary:        Documentation for the wrapt module
688bbdd
688bbdd
BuildRequires:  python-sphinx
688bbdd
BuildRequires:  python-sphinx_rtd_theme
688bbdd
688bbdd
%description doc
688bbdd
Documentation for the wrapt module
a9fa12e
%endif
688bbdd
9ef5a7d
%if 0%{?with_python3}
51db19a
%package -n python%{python3_pkgversion}-wrapt
51db19a
Summary:        A Python module for decorators, wrappers and monkey patching
51db19a
51db19a
%description -n python%{python3_pkgversion}-wrapt
51db19a
The aim of the wrapt module is to provide a transparent object proxy
51db19a
for Python, which can be used as the basis for the construction of
51db19a
function wrappers and decorator functions.
51db19a
51db19a
%if 0%{?with_python3_other}
51db19a
%package -n python%{python3_other_pkgversion}-wrapt
9ef5a7d
Summary:        A Python module for decorators, wrappers and monkey patching
9ef5a7d
51db19a
%description -n python%{python3_other_pkgversion}-wrapt
9ef5a7d
The aim of the wrapt module is to provide a transparent object proxy
9ef5a7d
for Python, which can be used as the basis for the construction of
9ef5a7d
function wrappers and decorator functions.
9ef5a7d
%endif
51db19a
%endif
9ef5a7d
688bbdd
%prep
688bbdd
%setup -q -n %{sname}-%{version}
688bbdd
9ef5a7d
# Remove bundled egg-info in case it exists
9ef5a7d
rm -rf %{sname}.egg-info
9ef5a7d
%if 0%{?with_python3}
9ef5a7d
rm -rf %{py3dir}
9ef5a7d
cp -a . %{py3dir}
9ef5a7d
%endif
9ef5a7d
688bbdd
%build
9ef5a7d
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
9ef5a7d
%if 0%{?with_python3}
9ef5a7d
pushd %{py3dir}
9ef5a7d
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
51db19a
%if 0%{?with_python3_other}
51db19a
CFLAGS="$RPM_OPT_FLAGS" %{__python3_other} setup.py build
51db19a
%endif
9ef5a7d
popd
9ef5a7d
%endif
9ef5a7d
a9fa12e
%if 0%{?with_docs}
688bbdd
# for docs
688bbdd
pushd docs
688bbdd
sphinx-build -b html -d build/doctrees . build/html
688bbdd
popd
a9fa12e
%endif
688bbdd
688bbdd
%install
9ef5a7d
%if 0%{?with_python3}
9ef5a7d
pushd %{py3dir}
9ef5a7d
%{__python3} setup.py install --skip-build --root %{buildroot}
51db19a
%if 0%{?with_python3_other}
51db19a
%{__python3_other} setup.py install --skip-build --root %{buildroot}
51db19a
%endif
9ef5a7d
popd
9ef5a7d
%endif
688bbdd
%{__python2} setup.py install --skip-build --root %{buildroot}
688bbdd
688bbdd
%files
688bbdd
%doc README
688bbdd
%license LICENSE
688bbdd
%{python2_sitearch}/%{sname}
688bbdd
%{python2_sitearch}/%{sname}-%{version}-py?.?.egg-info
688bbdd
a9fa12e
%if 0%{?with_docs}
688bbdd
%files doc
688bbdd
%doc docs/build/html
a9fa12e
%endif
688bbdd
9ef5a7d
%if 0%{?with_python3}
51db19a
%files -n python%{python3_pkgversion}-wrapt
9ef5a7d
%doc README
9ef5a7d
%license LICENSE
9ef5a7d
%{python3_sitearch}/%{sname}
9ef5a7d
%{python3_sitearch}/%{sname}-%{version}-py?.?.egg-info
51db19a
51db19a
%if 0%{?with_python3_other}
51db19a
%files -n python%{python3_other_pkgversion}-wrapt
51db19a
%doc README
51db19a
%license LICENSE
51db19a
%{python3_other_sitearch}/%{sname}
51db19a
%{python3_other_sitearch}/%{sname}-%{version}-py?.?.egg-info
51db19a
%endif
9ef5a7d
%endif
9ef5a7d
688bbdd
%changelog
51db19a
* Thu Sep 15 2016 Aurelien Bompard <abompard@fedoraproject.org> - 1.10.4-7
51db19a
- Add support for Python3 in EPEL7:
51db19a
  https://fedoraproject.org/wiki/User:Bkabrda/EPEL7_Python3
51db19a
a9fa12e
* Fri May 15 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-6
a9fa12e
- Don't build docs on epel7 (the rtd theme is problematic).
a9fa12e
9ef5a7d
* Sat Apr 11 2015 Ralph Bean <rbean@redhat.com> - 1.10.4-5
9ef5a7d
- Add python3 subpackage
9ef5a7d
688bbdd
* Wed Mar 25 2015 Chandan Kumar <chkumar246@gmail.com> - 1.10.4-4
688bbdd
- Added doc files for doc subpackage
688bbdd
688bbdd
* Wed Mar 25 2015 Chandan Kumar <chkumar246@gmail.com> - 1.10.4-3
688bbdd
- Fixed Docs
688bbdd
688bbdd
* Tue Mar 24 2015 Chandan Kumar <chkumar246@gmail.com> - 1.10.4-2
688bbdd
- Removed cflags and group section fro doc subpackage
688bbdd
688bbdd
* Tue Mar 24 2015 Chandan Kumar <chkumar246@gmail.com> - 1.10.4-1
688bbdd
- Bumped to upstream version 1.10.4
688bbdd
- Add docs
688bbdd
688bbdd
* Wed Mar 11 2015 Chandan Kumar <chkumar246@gmail.com> - 1.10.2-1
688bbdd
- Initial package.