From 24c7e9e6ee25d5efa7511a13e50807c3b4bc86d0 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Jun 28 2016 17:00:52 +0000 Subject: Modernize python macros. --- diff --git a/python-oauthlib.spec b/python-oauthlib.spec index 790b059..b46f0d7 100644 --- a/python-oauthlib.spec +++ b/python-oauthlib.spec @@ -30,14 +30,27 @@ Source0: http://pypi.python.org/packages/source/o/%{modname}/%{modnam BuildArch: noarch + +%description +OAuthLib is a generic utility which implements the logic of OAuth without +assuming a specific HTTP request object or web framework. Use it to graft +OAuth client support onto your favorite HTTP library, or provider support +onto your favourite web framework. If you're a maintainer of such a +library, write a thin veneer on top of OAuthLib and get OAuth support for +very little effort. + +%package -n python2-oauthlib +Summary: An implementation of the OAuth request-signing logic +Group: Development/Libraries +%{?python_provide:%python_provide python2-oauthlib} + BuildRequires: python2-devel -BuildRequires: python-setuptools +BuildRequires: python2-setuptools -BuildRequires: python-nose -BuildRequires: python-unittest2 -BuildRequires: python-mock -BuildRequires: python-blinker -BuildRequires: python-jwt >= 1.0 +BuildRequires: python2-nose +BuildRequires: python2-mock +BuildRequires: python2-blinker +BuildRequires: python2-jwt >= 1.0 %if 0%{?rhel} && 0%{?rhel} <= 6 BuildRequires: python-crypto2.6 @@ -47,20 +60,7 @@ BuildRequires: python-crypto >= 2.6 Requires: python-crypto >= 2.6 %endif -Provides: python2-oauthlib = %{version} - -%if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools - -BuildRequires: python3-nose -BuildRequires: python3-crypto >= 2.6 -BuildRequires: python3-mock -BuildRequires: python3-blinker -BuildRequires: python3-jwt >= 1.0 -%endif - -%description +%description -n python2-oauthlib OAuthLib is a generic utility which implements the logic of OAuth without assuming a specific HTTP request object or web framework. Use it to graft OAuth client support onto your favorite HTTP library, or provider support @@ -72,6 +72,16 @@ very little effort. %package -n python3-oauthlib Summary: An implementation of the OAuth request-signing logic Group: Development/Libraries +%{?python_provide:%python_provide python3-oauthlib} + +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +BuildRequires: python3-nose +BuildRequires: python3-crypto >= 2.6 +BuildRequires: python3-mock +BuildRequires: python3-blinker +BuildRequires: python3-jwt >= 1.0 Requires: python3-crypto >= 2.6 @@ -100,48 +110,42 @@ rm -rf %{modname}.egg-info awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"pycrypto>=2.6\"]; import pkg_resources"}1' setup.py > setup.py.tmp mv setup.py.tmp setup.py -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif - %build -%{__python2} setup.py build +%py2_build %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd +%py3_build %endif %install +%py2_install %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root=%{buildroot} -popd +%py3_install %endif -%{__python2} setup.py install -O1 --skip-build --root=%{buildroot} %check %{__python2} setup.py test %if 0%{?with_python3} -pushd %{py3dir} %{__python3} setup.py test -popd %endif -%files -%doc README.rst LICENSE +%files -n python2-oauthlib +%doc README.rst +%license LICENSE %{python2_sitelib}/%{modname}/ %{python2_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-oauthlib -%doc README.rst LICENSE +%doc README.rst +%license LICENSE %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-%{version}-* %endif %changelog +* Tue Jun 28 2016 Ralph Bean - 1.0.3-2 +- Modernize python macros. + * Sun Apr 10 2016 Kevin Fenzi - 1.0.3-1 - Update to 1.0.3 - Add python2 provides (fixes bug #1313235 and #1314349)