Update to 0.7.0

- Split off man pages for sub-commands
- Ship scriptlets needed for shell completion

Signed-off-by: Nils Philippsen <nils@redhat.com>
epel9 imports/epel9/python-rpmautospec-0.7.0-1.el9
Nils Philippsen 3 months ago
parent 2278b6db5a
commit d403840fa9

@ -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 dont get auto-generated. # The dependencies needed for testing dont 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

@ -1 +1 @@
SHA512 (rpmautospec-0.6.5.tar.gz) = 4740a471d25896314cbb37ab7a34d24fa7d3b6512ea4d5d7444528e0669bca79cb23a180b8a591378a40e832df4a6673ac20930f38672d268d9c70fb49748771 SHA512 (rpmautospec-0.7.0.tar.gz) = 187d93bf4c687803f8d297183a7d0656de77bf421f06acec795252a974c8e736e46e061bdc497afe6f639f0cd2feb4024a289928a1bb23b76175012437297ba9

Loading…
Cancel
Save