2019-11-14 12:32:56 +00:00
|
|
|
Name: tldr
|
|
|
|
Version: 0.4.4
|
2019-11-20 13:35:56 +00:00
|
|
|
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
|
2019-11-20 13:35:56 +00:00
|
|
|
Source0: %{pypi_source}
|
2019-11-14 12:32:56 +00:00
|
|
|
|
2019-11-20 13:35:56 +00:00
|
|
|
BuildArch: noarch
|
2020-10-26 15:11:32 +00:00
|
|
|
BuildRequires: python3-devel
|
2019-11-14 12:32:56 +00:00
|
|
|
BuildRequires: pyproject-rpm-macros
|
|
|
|
|
2023-02-07 12:58:43 +00:00
|
|
|
%if 0%{?rhel} != 9
|
2022-05-27 11:52:41 +00:00
|
|
|
# Internal check for our macros: test that we can install to a custom prefix
|
|
|
|
BuildRequires: python3-rpm-macros >= 3.10-18
|
|
|
|
%global _prefix /app
|
|
|
|
%endif
|
|
|
|
|
2019-11-14 12:32:56 +00:00
|
|
|
%description
|
2020-04-15 14:44:04 +00:00
|
|
|
A Python package containing executables.
|
|
|
|
Building this tests:
|
|
|
|
- there are no bytecompiled files in %%{_bindir}
|
|
|
|
- the executable's shebang is adjusted properly
|
2020-05-06 10:55:13 +00:00
|
|
|
- file direct_url.json isn't created
|
2022-05-27 11:52:41 +00:00
|
|
|
- installation to custom prefix works
|
2019-11-14 12:32:56 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n %{name}-%{version}
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
%pyproject_buildrequires
|
|
|
|
|
|
|
|
%build
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
%install
|
|
|
|
%pyproject_install
|
2023-09-27 12:37:15 +00:00
|
|
|
%pyproject_save_files -l tldr +auto
|
2019-11-14 12:32:56 +00:00
|
|
|
|
|
|
|
%check
|
2020-04-15 14:44:04 +00:00
|
|
|
# Internal check for our macros: tests we don't ship __pycache__ in bindir
|
2019-11-20 13:35:56 +00:00
|
|
|
test ! -d %{buildroot}%{_bindir}/__pycache__
|
2019-11-14 12:32:56 +00:00
|
|
|
|
2020-04-15 14:44:04 +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*$'
|
|
|
|
|
2020-05-06 10:55:13 +00:00
|
|
|
# Internal check for our macros: tests that direct_url.json file wasn't created
|
|
|
|
test ! -e %{buildroot}%{python3_sitelib}/*.dist-info/direct_url.json
|
|
|
|
|
2021-12-08 10:07:48 +00:00
|
|
|
# Internal check for the value of %%{pyproject_build_lib} in a noarch package
|
2023-02-07 12:58:43 +00:00
|
|
|
%if 0%{?rhel} == 9
|
2021-12-08 10:07:48 +00:00
|
|
|
test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib)"
|
2023-02-07 12:58:43 +00:00
|
|
|
%else
|
|
|
|
test "%{pyproject_build_lib}" == "${PWD}/build/lib"
|
2021-12-08 10:07:48 +00:00
|
|
|
%endif
|
|
|
|
|
2023-02-07 12:58:43 +00:00
|
|
|
%if 0%{?rhel} != 9
|
2022-05-27 11:52:41 +00:00
|
|
|
# Internal check for custom prefix
|
|
|
|
grep '^/usr' %{pyproject_files} && exit 1 || true
|
|
|
|
grep '^/app' %{pyproject_files}
|
|
|
|
%endif
|
|
|
|
|
2020-04-15 14:44:04 +00:00
|
|
|
%files -f %pyproject_files
|
2019-11-14 12:32:56 +00:00
|
|
|
%doc README.md
|