2021-07-13 09:29:19 +00:00
|
|
|
Name: escape_percentages
|
2023-05-26 17:10:37 +00:00
|
|
|
Version: 0.1
|
2021-07-13 09:29:19 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: ...
|
|
|
|
License: MIT
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description
|
|
|
|
This spec file verifies that escaping percentage signs in paths is possible via
|
2023-05-26 17:10:37 +00:00
|
|
|
exactly 2 (or 8) percentage signs in a filelist and directly in the %%files section.
|
2021-07-13 09:29:19 +00:00
|
|
|
It serves as a regression test for pyproject_save_files:escape_rpm_path().
|
|
|
|
When this breaks, the function needs to be adapted.
|
|
|
|
|
2023-05-26 17:10:37 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
cat > pyproject.toml << EOF
|
|
|
|
[build-system]
|
|
|
|
requires = ["setuptools"]
|
|
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > setup.cfg << EOF
|
|
|
|
[metadata]
|
|
|
|
name = escape_percentages
|
|
|
|
version = 0.1
|
|
|
|
[options]
|
|
|
|
packages =
|
|
|
|
escape_percentages
|
|
|
|
[options.package_data]
|
|
|
|
escape_percentages =
|
|
|
|
*
|
|
|
|
EOF
|
|
|
|
|
|
|
|
mkdir -p escape_percentages
|
|
|
|
touch escape_percentages/__init__.py
|
2021-07-13 09:29:19 +00:00
|
|
|
# the paths on disk will have 1 percentage sign if we type 2 in the spec
|
|
|
|
# we use the word 'version' after the sign, as that is a known existing macro
|
2023-05-26 17:10:37 +00:00
|
|
|
touch 'escape_percentages/one%%version'
|
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
%pyproject_buildrequires
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files escape_percentages
|
2021-07-13 09:29:19 +00:00
|
|
|
touch '%{buildroot}/two%%version'
|
|
|
|
|
|
|
|
|
2023-05-26 17:10:37 +00:00
|
|
|
%check
|
|
|
|
grep '/escape_percentages/one' %{pyproject_files}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files -f %{pyproject_files}
|
|
|
|
%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
|
|
|
|
/two%%version
|
|
|
|
%else
|
2021-07-13 09:29:19 +00:00
|
|
|
/two%%%%%%%%version
|
2023-05-26 17:10:37 +00:00
|
|
|
%endif
|