pyproject-rpm-macros/tests/tldr.spec

42 lines
1011 B
RPMSpec
Raw Normal View History

2019-11-14 12:32:56 +00:00
Name: tldr
Version: 0.4.4
Release: 1%{?dist}
2019-11-14 12:32:56 +00:00
Summary: Simplified and community-driven man pages
License: MIT
URL: https://github.com/tldr-pages/tldr-python-client
Source0: %{pypi_source}
2019-11-14 12:32:56 +00:00
BuildArch: noarch
2019-11-14 12:32:56 +00:00
BuildRequires: pyproject-rpm-macros
%description
A Python package containing executables.
Building this tests:
- there are no bytecompiled files in %%{_bindir}
- the executable's shebang is adjusted properly
2019-11-14 12:32:56 +00:00
%prep
%autosetup -n %{name}-%{version}
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files tldr +bindir
2019-11-14 12:32:56 +00:00
%check
# Internal check for our macros: tests we don't ship __pycache__ in bindir
test ! -d %{buildroot}%{_bindir}/__pycache__
2019-11-14 12:32:56 +00:00
# Internal check for our macros: tests we have a proper shebang line
head -n1 %{buildroot}%{_bindir}/%{name}.py | grep -E '#!\s*%{python3}\s+%{py3_shbang_opts}\s*$'
%files -f %pyproject_files
2019-11-14 12:32:56 +00:00
%license LICENSE
%doc README.md