Summary: Friendly interactive shell Name: fish Version: 4.5.0 Release: 7.1 License: GPL-2.0-only AND GPL-2.0-or-later AND BSD-2-Clause AND PSF-2.0 AND ISC AND MIT Group: System/Shells URL: https://fishshell.com/ %global is_amzn 0 %if 0%{?amzn} %global is_amzn 1 %endif Source0: %{name}_4.5.0.orig.tar.xz Source1: %{name}_4.5.0.orig-cargo-vendor.tar.xz BuildRequires: cargo gettext gcc xz pcre2-devel groff BuildRequires: rust >= 1.85 # Packaging guidelines say to use a BuildRequires: rust-packaging, but it adds no value for our package BuildRequires: /usr/bin/sphinx-build # OBS: add eg "FileProvides: /usr/bin/sphinx-build python3-sphinx python3-Sphinx" to project config BuildRequires: /usr/bin/man # OBS: add eg "FileProvides: /usr/bin/man man-db man" to project config BuildRequires: cmake >= 3.15 # for tests BuildRequires: python3 procps %if 0%{?fedora} # Need the en_US.utf-8 locale at a minimum BuildRequires: glibc-langpack-en %endif Requires: file Requires: /usr/bin/man Requires: python3 Requires: procps # Although the build scripts mangle the version number to be RPM compatible # for continuous builds (transforming the output of `git describe`), Fedora 32+ # also validates the version inside the pkgconfig file. There's no impetus for this # with fish. %define _wrong_version_format_terminate_build 0 %description fish is a shell geared towards interactive use. Its features are focused on user friendliness and discoverability. The language syntax is simple but incompatible with other shell languages. %prep # Unpack the source tarball and overlay the vendor tarball %setup -q -n %{name}-4.5.0 -a 1 # Should use cargo_prep here, it overrides our vendor config changes though # Amazon Linux 2023: disable Red Hat package note linker script %if %{is_amzn} %global _package_note 0 %undefine _enable_package_note %endif %build export CARGO_NET_OFFLINE=true # CMake macros define the wrong sysconfdir arguments EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} -DCMAKE_INSTALL_DOCDIR=%{_docdir}/fish" %if %{is_amzn} # Rust + lld cannot handle RH linker scripts export LDFLAGS="$(echo %{__global_ldflags} | sed 's/-Wl,-dT[^ ]*//g')" export RUSTFLAGS="${RUSTFLAGS:-} -C link-arg=-Wl,--build-id=sha1" %endif %cmake $EXTRA_CMAKE_FLAGS %if 0%{?cmake_build:1} %cmake_build %else make %{?_smp_mflags} %endif %install %if 0%{?cmake_install:1} %cmake_install %else %make_install %endif %check # OpenSUSE does out-of-tree builds and defines __builddir %if 0%{?__builddir:1} cd %__builddir %endif # Fedora uses __cmake_builddir %if 0%{?__cmake_builddir:1} cd %__cmake_builddir %endif make fish_run_tests %clean rm -rf $RPM_BUILD_ROOT %post # Add fish to the list of allowed shells in /etc/shells if ! grep %{_bindir}/fish %{_sysconfdir}/shells >/dev/null; then echo %{_bindir}/fish >>%{_sysconfdir}/shells fi %postun # Remove fish from the list of allowed shells in /etc/shells if [ "$1" = 0 ]; then grep -v %{_bindir}/fish %{_sysconfdir}/shells >%{_sysconfdir}/fish.tmp mv %{_sysconfdir}/fish.tmp %{_sysconfdir}/shells fi %files %defattr(-,root,root,-) # The documentation directory %doc %{_docdir}/fish %doc CONTRIBUTING.rst README.rst # man files %{_mandir}/man1/* # The program binaries %attr(0755,root,root) %{_bindir}/* # Configuration files %dir %{_sysconfdir}/fish/ %config(noreplace) %{_sysconfdir}/fish/config.fish # Support files %{_datadir}/fish/ # pkgconfig %{_datadir}/pkgconfig/fish.pc