fish.spec: better installation of documentation

The %{_docdir} macro is defined, but due to an oversight is not passed
to CMake in some versions of openSUSE where it should be.

Use doc directives to avoid mucking around with cp.
This commit is contained in:
David Adam 2024-03-21 22:45:51 +08:00
parent b64c210ade
commit 9105d6a82f

View File

@ -53,7 +53,7 @@ is simple but incompatible with other shell languages.
%build %build
# CMake macros define the wrong sysconfdir arguments # CMake macros define the wrong sysconfdir arguments
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}" EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} -DCMAKE_INSTALL_DOCDIR=%{_docdir}/fish"
%if 0%{?rhel} && 0%{?rhel} < 8 %if 0%{?rhel} && 0%{?rhel} < 8
%cmake3 $EXTRA_CMAKE_FLAGS %cmake3 $EXTRA_CMAKE_FLAGS
%else %else
@ -73,14 +73,8 @@ make %{?_smp_mflags}
%endif %endif
%find_lang %{name} %find_lang %{name}
# OpenSUSE has strong opinions about categories which do not apply to other systems # OpenSUSE has strong opinions about categories which do not apply to other systems
# and uses a different path for the documentation
%if 0%{?suse_version} %if 0%{?suse_version}
%suse_update_desktop_file fish "System;TerminalEmulator" %suse_update_desktop_file fish "System;TerminalEmulator"
cp -a README.rst %{buildroot}%{_datadir}/doc/packages/fish/
cp -a CONTRIBUTING.rst %{buildroot}%{_datadir}/doc/packages/fish/
%else
cp -a README.rst %{buildroot}%{_datadir}/doc/fish/
cp -a CONTRIBUTING.rst %{buildroot}%{_datadir}/doc/fish/
%endif %endif
%check %check
@ -114,11 +108,8 @@ fi
%defattr(-,root,root,-) %defattr(-,root,root,-)
# The documentation directory # The documentation directory
%if 0%{?suse_version} %doc %{_docdir}/fish
%doc %{_datadir}/doc/packages/fish/ %doc CONTRIBUTING.rst README.rst
%else
%doc %{_datadir}/doc/fish/
%endif
# man files # man files
%{_mandir}/man1/* %{_mandir}/man1/*