Update to new packaging guidelines
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
parent
8fa21b59e6
commit
5d413e8709
@ -1,9 +1,8 @@
|
|||||||
%global modname appdirs
|
%global modname appdirs
|
||||||
%bcond_without python3
|
|
||||||
|
|
||||||
Name: python-%{modname}
|
Name: python-%{modname}
|
||||||
Version: 1.4.0
|
Version: 1.4.0
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: Python module for determining platform-specific directories
|
Summary: Python module for determining platform-specific directories
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -11,80 +10,65 @@ URL: http://github.com/ActiveState/appdirs
|
|||||||
Source0: https://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz
|
Source0: https://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz
|
||||||
|
|
||||||
BuildRequires: python2-devel python-setuptools
|
BuildRequires: python2-devel python-setuptools
|
||||||
|
BuildRequires: python3-devel python3-setuptools
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
A small Python module for determining appropriate " + " platform-specific
|
A small Python module for determining appropriate " + " platform-specific
|
||||||
directories, e.g. a "user data dir".
|
directories, e.g. a "user data dir".
|
||||||
|
|
||||||
%if %{with python3}
|
%package -n python2-%{modname}
|
||||||
|
Summary: Python 2 module for determining platform-specific directoriess
|
||||||
|
%{?python_provide:%python_provide python2-%{modname}}
|
||||||
|
|
||||||
|
%description -n python2-%{modname}
|
||||||
|
A small Python 2 module for determining appropriate " + " platform-specific
|
||||||
|
directories, e.g. a "user data dir".
|
||||||
|
|
||||||
%package -n python3-%{modname}
|
%package -n python3-%{modname}
|
||||||
Summary: Python 3 module for determining platform-specific directoriess
|
Summary: Python 3 module for determining platform-specific directoriess
|
||||||
|
%{?python_provide:%python_provide python3-%{modname}}
|
||||||
BuildRequires: python3-devel python3-setuptools
|
|
||||||
|
|
||||||
%description -n python3-%{modname}
|
%description -n python3-%{modname}
|
||||||
A small Python 3 module for determining appropriate " + " platform-specific
|
A small Python 3 module for determining appropriate " + " platform-specific
|
||||||
directories, e.g. a "user data dir".
|
directories, e.g. a "user data dir".
|
||||||
%endif
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{modname}-%{version}
|
%autosetup -n %{modname}-%{version}
|
||||||
rm -rf %{modname}.egg-info
|
rm -rf %{modname}.egg-info
|
||||||
|
|
||||||
%if %{with python3}
|
|
||||||
rm -rf %{py3dir}
|
|
||||||
cp -a . %{py3dir}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py2_build
|
%py2_build
|
||||||
|
%py3_build
|
||||||
%if %{with python3}
|
|
||||||
pushd %{py3dir}
|
|
||||||
%py3_build
|
|
||||||
popd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py2_install
|
%py2_install
|
||||||
|
%py3_install
|
||||||
%if %{with python3}
|
|
||||||
pushd %{py3dir}
|
|
||||||
%py3_install
|
|
||||||
popd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python2_sitelib}/%{modname}.py
|
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
|
||||||
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/%{modname}.py
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%{__python2} setup.py test
|
%{__python2} setup.py test
|
||||||
|
%{__python3} setup.py test
|
||||||
|
|
||||||
%if %{with python3}
|
%files -n python2-%{modname}
|
||||||
pushd %{py3dir}
|
|
||||||
%{__python3} setup.py test
|
|
||||||
popd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files
|
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc README.rst CHANGES.rst
|
%doc README.rst CHANGES.rst
|
||||||
%{python2_sitelib}/%{modname}.*
|
%{python2_sitelib}/%{modname}.*
|
||||||
%{python2_sitelib}/%{modname}-%{version}-py?.?.egg-info/
|
%{python2_sitelib}/%{modname}-%{version}-py%python2_version.egg-info/
|
||||||
|
|
||||||
%if %{with python3}
|
|
||||||
%files -n python3-%{modname}
|
%files -n python3-%{modname}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc README.rst CHANGES.rst
|
%doc README.rst CHANGES.rst
|
||||||
%{python3_sitelib}/%{modname}.py
|
%{python3_sitelib}/%{modname}.py
|
||||||
%{python3_sitelib}/__pycache__/%{modname}.cpython-??.py*
|
%{python3_sitelib}/__pycache__/%{modname}.cpython-%python3_version_nodots.py*
|
||||||
%{python3_sitelib}/%{modname}-%{version}-py?.?.egg-info/
|
%{python3_sitelib}/%{modname}-%{version}-py%python3_version.egg-info/
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 05 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.4.0-4
|
||||||
|
- Update to new packaging guidelines
|
||||||
|
|
||||||
* Sun Aug 02 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.4.0-3
|
* Sun Aug 02 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.4.0-3
|
||||||
- Use modern python rpm macros
|
- Use modern python rpm macros
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user