|
|
@ -28,16 +28,10 @@
|
|
|
|
%bcond poetry 0
|
|
|
|
%bcond poetry 0
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} || 0%{?epel} >= 9 || 0%{?rhel} >= 10
|
|
|
|
|
|
|
|
%bcond manpage_manual_title 1
|
|
|
|
|
|
|
|
%else
|
|
|
|
|
|
|
|
%bcond manpage_manual_title 0
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%global srcname rpmautospec
|
|
|
|
%global srcname rpmautospec
|
|
|
|
|
|
|
|
|
|
|
|
Name: python-%{srcname}
|
|
|
|
Name: python-%{srcname}
|
|
|
|
Version: 0.6.5
|
|
|
|
Version: 0.7.0
|
|
|
|
Release: %autorelease
|
|
|
|
Release: %autorelease
|
|
|
|
Summary: Package and CLI tool to generate release fields and changelogs
|
|
|
|
Summary: Package and CLI tool to generate release fields and changelogs
|
|
|
|
License: MIT
|
|
|
|
License: MIT
|
|
|
@ -49,12 +43,13 @@ Source0: https://github.com/fedora-infra/%{srcname}/releases/download/%{version}
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: argparse-manpage
|
|
|
|
|
|
|
|
BuildRequires: git
|
|
|
|
BuildRequires: git
|
|
|
|
# the langpacks are needed for tests
|
|
|
|
# the langpacks are needed for tests
|
|
|
|
BuildRequires: glibc-langpack-de
|
|
|
|
BuildRequires: glibc-langpack-de
|
|
|
|
BuildRequires: glibc-langpack-en
|
|
|
|
BuildRequires: glibc-langpack-en
|
|
|
|
BuildRequires: python3-devel >= 3.9.0
|
|
|
|
BuildRequires: python3-devel >= 3.9.0
|
|
|
|
|
|
|
|
# Needed to build man pages
|
|
|
|
|
|
|
|
BuildRequires: python3dist(click-man)
|
|
|
|
# The dependencies needed for testing don’t get auto-generated.
|
|
|
|
# The dependencies needed for testing don’t get auto-generated.
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
%if %{with xdist}
|
|
|
|
%if %{with xdist}
|
|
|
@ -137,20 +132,35 @@ cat << EOF > %{pyproject_files}
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
|
|
|
# Man pages
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} argparse-manpage \
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} click-man rpmautospec
|
|
|
|
%if %{with manpage_manual_title}
|
|
|
|
install -m755 -d %{buildroot}%{_mandir}/man1
|
|
|
|
--manual-title "User Commands" \
|
|
|
|
install -m644 man/*.1 %{buildroot}%{_mandir}/man1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
--project-name rpmautospec \
|
|
|
|
|
|
|
|
--module rpmautospec.cli \
|
|
|
|
|
|
|
|
--function get_arg_parser > %{buildroot}%{_mandir}/man1/rpmautospec.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# RPM macros
|
|
|
|
%if %{with rpmmacropkg}
|
|
|
|
%if %{with rpmmacropkg}
|
|
|
|
mkdir -p %{buildroot}%{rpmmacrodir}
|
|
|
|
mkdir -p %{buildroot}%{rpmmacrodir}
|
|
|
|
install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
|
|
|
|
install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Shell completion
|
|
|
|
|
|
|
|
for shell_path in \
|
|
|
|
|
|
|
|
bash:%{bash_completions_dir}/rpmautospec \
|
|
|
|
|
|
|
|
fish:%{fish_completions_dir}/rpmautospec.fish \
|
|
|
|
|
|
|
|
zsh:%{zsh_completions_dir}/_rpmautospec; do
|
|
|
|
|
|
|
|
shell="${shell_path%%:*}"
|
|
|
|
|
|
|
|
path="${shell_path#*:}"
|
|
|
|
|
|
|
|
dir="${path%/*}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
install -m 755 -d "%{buildroot}${dir}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} \
|
|
|
|
|
|
|
|
_RPMAUTOSPEC_COMPLETE="${shell}_source" \
|
|
|
|
|
|
|
|
%{__python3} -c \
|
|
|
|
|
|
|
|
"import sys; sys.argv[0] = 'rpmautospec'; from rpmautospec.cli import cli; sys.exit(cli())" \
|
|
|
|
|
|
|
|
> "%{buildroot}${path}"
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
%check
|
|
|
|
%pytest -v \
|
|
|
|
%pytest -v \
|
|
|
|
%if %{with xdist}
|
|
|
|
%if %{with xdist}
|
|
|
@ -162,7 +172,13 @@ install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
|
|
|
|
|
|
|
|
|
|
|
|
%files -n %{srcname}
|
|
|
|
%files -n %{srcname}
|
|
|
|
%{_bindir}/rpmautospec
|
|
|
|
%{_bindir}/rpmautospec
|
|
|
|
%{_mandir}/man1/rpmautospec.1*
|
|
|
|
%{_mandir}/man1/rpmautospec*.1*
|
|
|
|
|
|
|
|
%dir %{bash_completions_dir}
|
|
|
|
|
|
|
|
%{bash_completions_dir}/rpmautospec
|
|
|
|
|
|
|
|
%dir %{fish_completions_dir}
|
|
|
|
|
|
|
|
%{fish_completions_dir}/rpmautospec.fish
|
|
|
|
|
|
|
|
%dir %{zsh_completions_dir}
|
|
|
|
|
|
|
|
%{zsh_completions_dir}/_rpmautospec
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with rpmmacropkg}
|
|
|
|
%if %{with rpmmacropkg}
|
|
|
|
%files -n rpmautospec-rpm-macros
|
|
|
|
%files -n rpmautospec-rpm-macros
|
|
|
|