python-appdirs/python-appdirs.spec

70 lines
1.9 KiB
RPMSpec
Raw Normal View History

2020-03-04 10:14:19 +08:00
%global with_tests 0%{?_with_tests:1}
name: python-appdirs
Version: 1.4.3
Release: 8
Summary: A Python module for determining platform-specific directories
License: MIT
URL: https://github.com/ActiveState/appdirs
Source0: https://github.com/ActiveState/appdirs/archive/%{version}.tar.gz
BuildArch: noarch
%description
A small Python module for determining appropriate " + " platform-specific directories,
e.g. a "user data dir".
%package -n python2-appdirs
Summary: A python2 module for determining platform-specific directories
%python_provide python2-appdirs
BuildRequires: python2-devel python2-setuptools
BuildRequires: python2-pip python2-wheel
%description -n python2-appdirs
A small Python 2 module for determining appropriate " + " platform-specific directories,
e.g. a "user data dir".
%package -n python3-appdirs
Summary: A python3 module for determining platform-specific directories
%python_provide python3-appdirs
BuildRequires: python3-devel python3-setuptools python3-pip python3-wheel
%description -n python3-appdirs
A small Python 3 module for determining appropriate " + " platform-specific directories,
e.g. a "user data dir".
%prep
%autosetup -n appdirs-%{version} -p1
rm -vrf appdirs.egg-info
%build
%py2_build_wheel
%py3_build_wheel
%install
%py2_install_wheel appdirs-%{version}-py2.py3-none-any.whl
%py3_install_wheel appdirs-%{version}-py2.py3-none-any.whl
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/appdirs.py
%check
%if %{with_tests}
%{__python2} setup.py test
%{__python3} setup.py test
%endif
%files -n python2-appdirs
%doc README.rst CHANGES.rst LICENSE.txt
%{python2_sitelib}/appdirs*
%files -n python3-appdirs
%doc README.rst CHANGES.rst LICENSE.txt
%{python3_sitelib}/appdirs*
%{python3_sitelib}/__pycache__/appdirs.*
%changelog
* Thu Feb 27 2020 chenli <chenli147@huawei.com> - 1.4.3-8
- Init Package