2015-07-24 10:23:18 +08:00
|
|
|
Summary: Friendly interactive shell
|
|
|
|
Name: fish
|
|
|
|
|
|
|
|
Version: @RPMVERSION@
|
|
|
|
Release: 0.%{?dist}
|
|
|
|
|
2023-05-25 22:16:17 +08:00
|
|
|
License: GPL-2.0-only AND GPL-2.0-or-later AND BSD-2-Clause AND PSF-2.0 AND ISC AND MIT
|
2015-07-24 10:23:18 +08:00
|
|
|
Group: System/Shells
|
2017-02-17 21:30:43 +08:00
|
|
|
URL: https://fishshell.com/
|
2015-07-24 10:23:18 +08:00
|
|
|
|
2020-02-14 22:41:13 +08:00
|
|
|
Source0: %{name}_@VERSION@.orig.tar.xz
|
2024-04-27 18:05:16 +08:00
|
|
|
Source1: %{name}_@VERSION@.orig-cargo-vendor.tar.xz
|
2024-06-12 14:14:52 +08:00
|
|
|
BuildRequires: cargo gettext gcc xz pcre2-devel
|
2024-04-28 21:43:42 +08:00
|
|
|
BuildRequires: rust >= 1.70
|
2024-04-27 18:05:16 +08:00
|
|
|
# Packaging guidelines say to use a BuildRequires: rust-packaging, but it adds no value for our package
|
2015-07-24 10:23:18 +08:00
|
|
|
|
2024-04-27 18:05:16 +08:00
|
|
|
BuildRequires: cmake >= 3.19
|
2018-05-29 13:46:14 +08:00
|
|
|
|
2020-01-25 22:34:33 +08:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: update-desktop-files
|
2024-04-27 18:05:16 +08:00
|
|
|
# for tests
|
|
|
|
BuildRequires: groff
|
|
|
|
%else
|
|
|
|
BuildRequires: groff-base
|
2020-01-25 22:34:33 +08:00
|
|
|
%endif
|
|
|
|
|
2019-01-05 17:28:37 +08:00
|
|
|
# for tests
|
2024-04-27 18:07:00 +08:00
|
|
|
%if 0%{?fedora}
|
2019-01-05 17:28:37 +08:00
|
|
|
# Need the en_US.utf-8 locale at a minimum
|
|
|
|
BuildRequires: glibc-langpack-en
|
|
|
|
%endif
|
2020-07-27 22:21:37 +08:00
|
|
|
BuildRequires: python3 procps
|
2019-01-05 17:28:37 +08:00
|
|
|
|
2023-04-07 12:22:34 +08:00
|
|
|
Requires: python3
|
|
|
|
Requires: man
|
2024-12-15 23:53:55 +08:00
|
|
|
Requires: ncurses-base
|
|
|
|
Requires: procps
|
2015-07-24 10:23:18 +08:00
|
|
|
|
2020-06-10 20:48:59 +08:00
|
|
|
# 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
|
|
|
|
|
2015-07-24 10:23:18 +08:00
|
|
|
%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
|
2024-04-27 18:05:16 +08:00
|
|
|
# Unpack the source tarball and overlay the vendor tarball
|
|
|
|
%setup -q -n %{name}-@VERSION@ -a 1
|
|
|
|
# Should use cargo_prep here, it overrides our vendor config changes though
|
2015-07-24 10:23:18 +08:00
|
|
|
|
|
|
|
%build
|
2024-04-27 18:05:16 +08:00
|
|
|
export CARGO_NET_OFFLINE=true
|
2019-01-02 21:36:55 +08:00
|
|
|
# CMake macros define the wrong sysconfdir arguments
|
2024-03-21 22:45:51 +08:00
|
|
|
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} -DCMAKE_INSTALL_DOCDIR=%{_docdir}/fish"
|
2019-01-02 21:36:55 +08:00
|
|
|
%cmake $EXTRA_CMAKE_FLAGS
|
2020-11-12 21:50:34 +08:00
|
|
|
%if 0%{?cmake_build:1}
|
2020-11-11 20:08:52 +08:00
|
|
|
%cmake_build
|
2018-05-29 13:46:14 +08:00
|
|
|
%else
|
2015-07-24 10:23:18 +08:00
|
|
|
make %{?_smp_mflags}
|
2018-05-29 13:46:14 +08:00
|
|
|
%endif
|
2015-07-24 10:23:18 +08:00
|
|
|
|
|
|
|
%install
|
2018-05-29 13:46:14 +08:00
|
|
|
%if 0%{?cmake_install:1}
|
|
|
|
%cmake_install
|
|
|
|
%else
|
|
|
|
%make_install
|
|
|
|
%endif
|
2015-07-24 10:23:18 +08:00
|
|
|
%find_lang %{name}
|
2020-01-25 22:34:33 +08:00
|
|
|
# OpenSUSE has strong opinions about categories which do not apply to other systems
|
|
|
|
%if 0%{?suse_version}
|
2020-01-26 21:36:00 +08:00
|
|
|
%suse_update_desktop_file fish "System;TerminalEmulator"
|
2024-03-20 23:45:38 +08:00
|
|
|
%endif
|
2015-07-24 10:23:18 +08:00
|
|
|
|
2019-01-05 17:28:37 +08:00
|
|
|
%check
|
|
|
|
# OpenSUSE does out-of-tree builds and defines __builddir
|
|
|
|
%if 0%{?__builddir:1}
|
|
|
|
cd %__builddir
|
|
|
|
%endif
|
2022-06-08 22:45:55 +08:00
|
|
|
# Fedora uses __cmake_builddir
|
|
|
|
%if 0%{?__cmake_builddir:1}
|
|
|
|
cd %__cmake_builddir
|
|
|
|
%endif
|
2022-06-08 18:37:35 +08:00
|
|
|
make fish_run_tests
|
2019-01-05 17:28:37 +08:00
|
|
|
|
2015-07-24 10:23:18 +08:00
|
|
|
%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
|
2023-04-07 12:22:34 +08:00
|
|
|
echo %{_bindir}/fish >>%{_sysconfdir}/shells
|
2015-07-24 10:23:18 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
|
|
|
# Remove fish from the list of allowed shells in /etc/shells
|
|
|
|
if [ "$1" = 0 ]; then
|
2023-04-07 12:22:34 +08:00
|
|
|
grep -v %{_bindir}/fish %{_sysconfdir}/shells >%{_sysconfdir}/fish.tmp
|
|
|
|
mv %{_sysconfdir}/fish.tmp %{_sysconfdir}/shells
|
2015-07-24 10:23:18 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
%files -f %{name}.lang
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
|
|
|
# The documentation directory
|
2024-03-21 22:45:51 +08:00
|
|
|
%doc %{_docdir}/fish
|
|
|
|
%doc CONTRIBUTING.rst README.rst
|
2015-07-24 10:23:18 +08:00
|
|
|
|
|
|
|
# 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
|
2020-01-25 18:04:14 +08:00
|
|
|
|
|
|
|
# FreeDesktop entry
|
|
|
|
%{_datadir}/applications/fish.desktop
|
|
|
|
%{_datadir}/pixmaps/fish.png
|