# Created by pyp2rpm-3.2.1 %global pypi_name mtg Name: python-%{pypi_name} Version: 1.6.1 Release: 2%{?dist} Summary: Console-based access to the Gatherer Magic Card Database License: MIT URL: https://github.com/chigby/mtg # Documentation, license, and unit tests aren't available from PyPI, so pull from github. # Unfortunately, we have to modify the github tarball to remove Gatherer data. (tests/_data). #Source0: https://github.com/chigby/%{pypi_name}/archive/%{version}/%{pypi_name}-%{version}.tar.gz Source0: %{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-lxml, python-cssselect, python2-nose BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-lxml, python3-cssselect, python3-nose %description Search for Magic cards from the command line. Limit your results by card name, color, type, rules text, converted mana cost, power, toughness, or expansion set. Rulings and flavor text also available. Clean interface and output. %package -n python2-%{pypi_name} Summary: Console-based access to the Gatherer Magic Card Database %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python-lxml Requires: python-cssselect %description -n python2-%{pypi_name} Search for Magic cards from the command line. Limit your results by card name, color, type, rules text, converted mana cost, power, toughness, or expansion set. Rulings and flavor text also available. Clean interface and output. %package -n python3-%{pypi_name} Summary: Console-based access to the Gatherer Magic Card Database %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3-lxml Requires: python3-cssselect # This is (primarily) a CLI application; provide "mtg". Provides: mtg %description -n python3-%{pypi_name} Search for Magic cards from the command line. Limit your results by card name, color, type, rules text, converted mana cost, power, toughness, or expansion set. Rulings and flavor text also available. Clean interface and output. %prep %autosetup -n %{pypi_name}-%{version} # Remove unit tests that depend on _data (which is copyright WoTC and probably not shippable). rm -f tests/card_extractor_test.py %build %py2_build %py3_build %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. # We don't need to provide the python2 version of the mtg binary. %py2_install %py3_install # Since there's no potential collision, we don't need to version the mtg binary. # cp %{buildroot}/%{_bindir}/mtg %{buildroot}/%{_bindir}/mtg-3 # ln -sf %{_bindir}/mtg-3 %{buildroot}/%{_bindir}/mtg-%{python3_version} %check export LC_ALL=en_US.UTF-8 nosetests-2 -v nosetests-3 -v %files -n python2-%{pypi_name} %doc README.md %license LICENSE %{python2_sitelib}/mtglib %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %files -n python3-%{pypi_name} %doc README.md %license LICENSE %{_bindir}/mtg %{python3_sitelib}/mtglib %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Sun Feb 26 2017 Ben Rosser - 1.6.1-1 - Remove mtg-2* binaries, as they should behave the same as the python3 versions. - Get rid of the versioned mtg-3 binaries, as there's no potential collision with python2 binaries. - Remove card_extractor_test.py, as those tests require tests/_data directory. - Remove tests/_data directory from tarball, as Fedora probably can't ship it in a source package. * Wed Feb 22 2017 Ben Rosser - 1.6.1-1 - Initial package.