Tests: Simplify tldr.spec

- drop stuff that we don't need to test this
- use macros where possible
- use explicit test command when testing stuff
- make sure dist-info is a directory
This commit is contained in:
Miro Hrončok 2019-11-20 14:35:56 +01:00
parent 49a323e46e
commit f50ab5f517

View File

@ -1,23 +1,20 @@
Name: tldr Name: tldr
Version: 0.4.4 Version: 0.4.4
Release: 3%{?dist} Release: 1%{?dist}
Summary: Simplified and community-driven man pages Summary: Simplified and community-driven man pages
License: MIT License: MIT
URL: https://github.com/tldr-pages/tldr-python-client URL: https://github.com/tldr-pages/tldr-python-client
Source0: https://files.pythonhosted.org/packages/source/t/%{name}/%{name}-%{version}.tar.gz Source0: %{pypi_source}
BuildArch: noarch
BuildArch: noarch
BuildRequires: pyproject-rpm-macros BuildRequires: pyproject-rpm-macros
%description %description
A Python command line client for tldr - Simplified and community-driven %{summary}.
man pages http://tldr-pages.github.io/.
%prep %prep
%autosetup -n %{name}-%{version} %autosetup -n %{name}-%{version}
# Remove bundled egg-info
rm -rf %{name}.egg-info
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires %pyproject_buildrequires
@ -27,10 +24,9 @@ rm -rf %{name}.egg-info
%install %install
%pyproject_install %pyproject_install
sed -i '1{\=^#!/usr/bin/env python=d}' %{buildroot}%{python3_sitelib}/%{name}.py
%check %check
[ ! -d %{buildroot}%{_bindir}/__pycache__ ] test ! -d %{buildroot}%{_bindir}/__pycache__
%files %files
%license LICENSE %license LICENSE
@ -39,4 +35,4 @@ sed -i '1{\=^#!/usr/bin/env python=d}' %{buildroot}%{python3_sitelib}/%{name}.py
%{_bindir}/%{name}.py %{_bindir}/%{name}.py
%{python3_sitelib}/%{name}.py %{python3_sitelib}/%{name}.py
%{python3_sitelib}/__pycache__/*.pyc %{python3_sitelib}/__pycache__/*.pyc
%{python3_sitelib}/%{name}-%{version}.dist-info %{python3_sitelib}/%{name}-%{version}.dist-info/