summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Orsava <tomas.n@orsava.cz>2016-05-19 11:32:43 +0200
committerMiro Hrončok <miro@hroncok.cz>2016-05-20 11:40:53 +0200
commit81bdc211057fb4a7c929a06ea6d68077dd8024b1 (patch)
treee5e819a9c5a489971386538062ff1e0d05befbae
parent724c8a089c69d02dbaccfbfa81511db47acf3b4a (diff)
downloadtweepy-81bdc211057fb4a7c929a06ea6d68077dd8024b1.zip
tweepy-81bdc211057fb4a7c929a06ea6d68077dd8024b1.tar.gz
tweepy-81bdc211057fb4a7c929a06ea6d68077dd8024b1.tar.xz
Added support for Python 3, modernized the spec file.
-rw-r--r--tweepy.spec151
1 files changed, 125 insertions, 26 deletions
diff --git a/tweepy.spec b/tweepy.spec
index e1f58e5..2229649 100644
--- a/tweepy.spec
+++ b/tweepy.spec
@@ -1,43 +1,142 @@
-# Workaround for epel versions where don't exists python2 macro
-%{!?__python2: %global __python2 %{__python}}
-%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
-
-Name: tweepy
-Version: 2.3.0
-Release: 4%{?dist}
-Summary: Twitter library for python
-Source0: http://pypi.python.org/packages/source/t/%{name}/%{name}-%{version}.tar.gz
-Source1: https://raw.githubusercontent.com/tweepy/tweepy/master/LICENSE
-Source2: https://raw.githubusercontent.com/tweepy/tweepy/master/README.md
+# Tests are disabled because they do not fail gracefully when there is no
+# internet access—they fail in Koji.
+%global run_tests 0
+
+# Don't duplicate the same documentation
+%global _docdir_fmt %{name}
+
+%global srcname tweepy
+
+Name: %{srcname}
+Version: 3.5.0
+Release: 1%{?dist}
+Summary: An easy-to-use Python library for accessing the Twitter API
+Source0: https://github.com/%{srcname}/%{srcname}/archive/v%{version}.tar.gz
License: MIT
Group: Development/Libraries
-URL: http://pypi.python.org/pypi/tweepy/
+URL: http://www.tweepy.org
BuildArch: noarch
-BuildRequires: python-devel
-BuildRequires: python-setuptools python-simplejson
+
+%global _description \
+Tweepy is a Twitter and Identi.ca library for Python that\
+can be used in desktop and web applications. It has the\
+following features: OAuth support, Covers the entire Twitter\
+API, Streaming API support, Cache system (memory, file),\
+Easy to use.
+
+%description %{_description}
+
+
+%package -n python2-%{srcname}
+Summary: %{summary}
+Obsoletes: %{srcname} < 3.5.0-1
+Provides: %{srcname} = %{version}-%{release}
+%{?python_provide:%python_provide python2-%{srcname}}
+
+BuildRequires: python2-devel
+BuildRequires: python2-setuptools
+BuildRequires: python-simplejson
+
+%if 0%{?run_tests}
+# For testsuite
+BuildRequires: python-tox >= 1.7.2
+BuildRequires: python-vcrpy >= 1.1.2
+BuildRequires: python-mock >= 1.0.1
+BuildRequires: python-requests-oauthlib >= 0.4.1
+BuildRequires: python-unittest2
+%endif
+
Requires: python-simplejson
+Requires: python-requests-oauthlib >= 0.4.1
+Requires: python2-six >= 1.7.3
+
+%description -n python2-%{srcname} %{_description}
+
+Python 2 version.
+
+
+%package -n python3-%{srcname}
+Summary: %{summary}
+%{?python_provide:%python_provide python3-%{srcname}}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-simplejson
+
+%if 0%{?run_tests}
+# For testsuite
+BuildRequires: python3-tox >= 1.7.2
+BuildRequires: python3-vcrpy >= 1.1.2
+BuildRequires: python3-mock >= 1.0.1
+BuildRequires: python3-requests-oauthlib >= 0.4.1
+%endif
+
+Requires: python3-simplejson
+Requires: python3-requests-oauthlib >= 0.4.1
+Requires: python3-six >= 1.7.3
+
+%description -n python3-%{srcname} %{_description}
+
+Python 3 version.
-%description
-A library for accessing the Twitter.com API. Supports OAuth, covers the
-entire API, and streaming API.
%prep
-%setup -q -n %{name}-%{version}
-cp -a %{SOURCE1} %{SOURCE2} .
+%autosetup -n %{srcname}-%{version}
+
%build
-%{__python2} setup.py build
+%py2_build
+%py3_build
+
%install
-%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+%py2_install
+%py3_install
+
+rm -r %{buildroot}%{python2_sitelib}/examples
+rm -r %{buildroot}%{python3_sitelib}/examples
+
+
+%check
+%if 0%{?run_tests}
+%{__python2} setup.py test
+# Running the Python 3 test suite requires a valid set of Twitter API
+# credentials in tests/config.py
+%{__python3} setup.py test
+%endif
+
+
+%files -n python2-%{srcname}
+%doc examples/
+%doc docs/*.rst
+%doc README.md CONTRIBUTORS CHANGELOG.md
+%license LICENSE
+%{python2_sitelib}/%{srcname}/
+%{python2_sitelib}/%{srcname}-*.egg-info/
+
+%files -n python3-%{srcname}
+%doc examples/
+%doc docs/*.rst
+%doc README.md CONTRIBUTORS CHANGELOG.md
+%license LICENSE
+%{python3_sitelib}/%{srcname}/
+%{python3_sitelib}/%{srcname}-*.egg-info/
-%files
-%doc README.md LICENSE
-%{python2_sitelib}/%{name}
-%{python2_sitelib}/examples
-%{python2_sitelib}/%{name}-*.egg-info
%changelog
+* Thu May 19 2016 Tomas Orsava <torsava@redhat.com> - 3.5.0-1
+- Most of these changes are by Philip Worrall <philip.worrall@googlemail.com>
+- Moderize spec
+- Update to new upstream release v3.5.0
+- Update link to upstream homepage
+- Update link to source tarball, now hosted on github
+- Add python3 subpackage
+- Add additional dependencies for oauthlib, six and requests
+- Package additional RST documentation
+- Removed license sources as they are already packaged by upstream
+- Update provides and obsoletes tags according to packaging guidelines
+- Added the testsuite as optional (disabled by default) because it requires
+ internet access
+
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild