|
|
|
@ -28,16 +28,10 @@
|
|
|
|
|
%bcond poetry 0
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
|
|
Name: python-%{srcname}
|
|
|
|
|
Version: 0.6.5
|
|
|
|
|
Version: 0.7.0
|
|
|
|
|
Release: %autorelease
|
|
|
|
|
Summary: Package and CLI tool to generate release fields and changelogs
|
|
|
|
|
License: MIT
|
|
|
|
@ -49,12 +43,13 @@ Source0: https://github.com/fedora-infra/%{srcname}/releases/download/%{version}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
BuildRequires: argparse-manpage
|
|
|
|
|
BuildRequires: git
|
|
|
|
|
# the langpacks are needed for tests
|
|
|
|
|
BuildRequires: glibc-langpack-de
|
|
|
|
|
BuildRequires: glibc-langpack-en
|
|
|
|
|
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.
|
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
|
%if %{with xdist}
|
|
|
|
@ -137,20 +132,35 @@ cat << EOF > %{pyproject_files}
|
|
|
|
|
EOF
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} argparse-manpage \
|
|
|
|
|
%if %{with manpage_manual_title}
|
|
|
|
|
--manual-title "User Commands" \
|
|
|
|
|
%endif
|
|
|
|
|
--project-name rpmautospec \
|
|
|
|
|
--module rpmautospec.cli \
|
|
|
|
|
--function get_arg_parser > %{buildroot}%{_mandir}/man1/rpmautospec.1
|
|
|
|
|
# Man pages
|
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} click-man rpmautospec
|
|
|
|
|
install -m755 -d %{buildroot}%{_mandir}/man1
|
|
|
|
|
install -m644 man/*.1 %{buildroot}%{_mandir}/man1
|
|
|
|
|
|
|
|
|
|
# RPM macros
|
|
|
|
|
%if %{with rpmmacropkg}
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
%pytest -v \
|
|
|
|
|
%if %{with xdist}
|
|
|
|
@ -162,7 +172,13 @@ install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
|
|
|
|
|
|
|
|
|
|
%files -n %{srcname}
|
|
|
|
|
%{_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}
|
|
|
|
|
%files -n rpmautospec-rpm-macros
|
|
|
|
|