From 4ba4dfb0e85ff8452d1765963eb5f22517062fc5 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 27 Jul 2015 23:22:14 +0300 Subject: [PATCH] initial import Signed-off-by: Igor Gnatenko --- .gitignore | 1 + python-appdirs.spec | 94 +++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 96 insertions(+) create mode 100644 python-appdirs.spec diff --git a/.gitignore b/.gitignore index e69de29..668b2e4 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/appdirs-1.4.0.tar.gz diff --git a/python-appdirs.spec b/python-appdirs.spec new file mode 100644 index 0000000..8f59cc2 --- /dev/null +++ b/python-appdirs.spec @@ -0,0 +1,94 @@ +%global modname appdirs +%bcond_without python3 + +Name: python-%{modname} +Version: 1.4.0 +Release: 2%{?dist} +Summary: Python module for determining platform-specific directories + +License: MIT +URL: http://github.com/ActiveState/appdirs +Source0: https://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz + +BuildRequires: python2-devel python-setuptools +BuildArch: noarch + +%description +A small Python module for determining appropriate " + " platform-specific +directories, e.g. a "user data dir". + +%if %{with python3} +%package -n python3-%{modname} +Summary: Python 3 module for determining platform-specific directoriess + +BuildRequires: python3-devel python3-setuptools + +%description -n python3-%{modname} +A small Python 3 module for determining appropriate " + " platform-specific +directories, e.g. a "user data dir". +%endif + +%prep +%autosetup -n %{modname}-%{version} +rm -rf %{modname}.egg-info + +%if %{with python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + +%build +%{__python2} setup.py build + +%if %{with python3} +pushd %{py3dir} + %{__python3} setup.py build +popd +%endif + +%install +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} + +%if %{with python3} +pushd %{py3dir} + %{__python3} setup.py install -O1 --skip-build --root %{buildroot} +popd +%endif + +sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python2_sitelib}/%{modname}.py +%if %{with python3} + sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/%{modname}.py +%endif + +%check +%{__python2} setup.py test + +%if %{with python3} +pushd %{py3dir} + %{__python3} setup.py test +popd +%endif + +%files +%license LICENSE.txt +%doc README.rst CHANGES.rst +%{python2_sitelib}/%{modname}.* +%{python2_sitelib}/%{modname}-%{version}-py?.?.egg-info/ + +%if %{with python3} +%files -n python3-%{modname} +%license LICENSE.txt +%doc README.rst CHANGES.rst +%{python3_sitelib}/%{modname}.py +%{python3_sitelib}/__pycache__/%{modname}.cpython-??.py* +%{python3_sitelib}/%{modname}-%{version}-py?.?.egg-info/ +%endif + +%changelog +* Mon Jul 27 2015 Igor Gnatenko - 1.4.0-2 +- Include CHANGES.rst in doc +- use python2-devel in BR instead of python-devel +- run tests + +* Fri May 08 2015 Igor Gnatenko - 1.4.0-1 +- Initial package diff --git a/sources b/sources index e69de29..3d2ebfb 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +1d17b4c9694ab84794e228f28dc3275b appdirs-1.4.0.tar.gz