Use RPM macros for shell completions and clean up directory ownership

... as recommended by the Fedora packaging guidelines [1,2].

This was made possible by two recent developments.

First, the parent directories for shell completions are now owned by the
filesystem RPM [3,4].  So, there won't be any unowned directories, if
the toolbox RPM doesn't own them without depending on some other package
that owns those directories.

Second, there are now RPM macros for the parent directories for shell
completions [5].

There's no need to do a build just for this.

[1] https://docs.fedoraproject.org/es/packaging-guidelines/ShellCompletions/

[2] https://docs.fedoraproject.org/es/packaging-guidelines/UnownedDirectories/

[3] Fedora filesystem commit 47d37ac94192f792
    https://src.fedoraproject.org/rpms/filesystem/c/47d37ac94192f792
    https://bugzilla.redhat.com/show_bug.cgi?id=1312594

[4] Fedora filesystem commit 4c45982cd067557e
    https://src.fedoraproject.org/rpms/filesystem/c/4c45982cd067557e
    https://bugzilla.redhat.com/show_bug.cgi?id=1504616

[5] Fedora redhat-rpm-config commit 483a3b89d74c6f0b
    https://src.fedoraproject.org/rpms/redhat-rpm-config/c/483a3b89d74c6f0b

Resolves: RHEL-95210
This commit is contained in:
Debarshi Ray 2025-06-16 21:19:19 +02:00
parent 9c99bd7f09
commit 84e5d828d1

View File

@ -162,14 +162,14 @@ export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_
%meson \
%if 0%{?rhel}
-Dfish_completions_dir=%{_datadir}/fish/vendor_completions.d \
-Dfish_completions_dir=%{fish_completions_dir} \
%if 0%{?rhel} <= 9
-Dmigration_path_for_coreos_toolbox=true \
%endif
%endif
-Dprofile_dir=%{_sysconfdir}/profile.d \
-Dtmpfiles_dir=%{_tmpfilesdir} \
-Dzsh_completions_dir=%{_datadir}/zsh/site-functions
-Dzsh_completions_dir=%{zsh_completions_dir}
%meson_build
@ -192,15 +192,15 @@ install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf
%doc CODE-OF-CONDUCT.md CONTRIBUTING.md GOALS.md NEWS README.md SECURITY.md
%license COPYING %{?rhel:src/vendor/modules.txt}
%{_bindir}/%{name}
%{_datadir}/bash-completion
%{_datadir}/fish
%{_datadir}/zsh
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}-*.1*
%{_mandir}/man5/%{name}.conf.5*
%config(noreplace) %{_sysconfdir}/containers/%{name}.conf
%{_sysconfdir}/profile.d/%{name}.sh
%{_tmpfilesdir}/%{name}.conf
%{bash_completions_dir}/%{name}.bash
%{fish_completions_dir}/%{name}.fish
%{zsh_completions_dir}/_%{name}
%files tests