%define debug_package %{nil} %undefine _package_note_file %global __cargo_requires %{nil} %global __cargo_provides %{nil} Name: fish Version: 4.9.0 Release: 1%{?dist} Summary: Friendly interactive shell License: Apache-2.0 OR MIT and GPL-2.0-only AND LGPL-2.0-or-later AND MIT AND PSF-2.0 and Unlicense OR MIT and WTFPL and Zlib URL: https://fishshell.com Source0: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.xz Source1: %{name}-%{version}-cargo-vendor.tar.xz BuildRequires: cargo BuildRequires: cmake >= 3.5 BuildRequires: gcc BuildRequires: gettext BuildRequires: git-core BuildRequires: glibc-langpack-en BuildRequires: gnupg2 BuildRequires: ncurses-devel BuildRequires: ninja-build BuildRequires: pcre2-devel BuildRequires: procps-ng BuildRequires: python3-devel BuildRequires: python3-pexpect BuildRequires: rust BuildRequires: /usr/bin/sphinx-build Requires: ncurses-term # Tab completion wants man-db. Recommends: groff-base Recommends: man-db Recommends: man-pages # For the webconfig interface. Provides: bundled(js-alpine) # Forked pcre2 crate used by fish. Provides: bundled(crate(pcre2)) = 0.2.9 %description fish is a fully-equipped command line shell (like bash or zsh) that is smart and user-friendly. fish supports powerful features like syntax highlighting, autosuggestions, and tab completions that just work, with nothing to learn or configure. %prep %autosetup -p1 # Extract Cargo dependencies vendored separately from the upstream source. tar -xJf "%{SOURCE1}" # Use the exact Cargo source mappings generated by `cargo vendor`. mkdir -p .cargo install -pm 0644 cargo-vendor-config.toml .cargo/config.toml # Force offline operation during all Cargo invocations. cat >> .cargo/config.toml <<'EOF' [net] offline = true EOF # Change bundled scripts to invoke the Python 3 binary directly. find share/tools -type f -name '*.py' -exec \ sed -i '1{s@^#!.*@#!%{__python3}@}' {} + %build export CARGO_NET_OFFLINE=true %cmake \ -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DWITH_DOCS=OFF \ -DFISH_USE_SYSTEM_PCRE2=ON \ -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \ -Dextra_completionsdir=%{_datadir}/%{name}/vendor_completions.d \ -Dextra_functionsdir=%{_datadir}/%{name}/vendor_functions.d \ -Dextra_confdir=%{_datadir}/%{name}/vendor_conf.d %cmake_build # Remove references to /usr/local from the pkg-config file. sed -i 's^/usr/local/^/usr/^g' %{_vpath_builddir}/*.pc %install %cmake_install # Compile the installed Python tools. %py_byte_compile %{__python3} %{buildroot}%{_datadir}/%{name}/tools/ # Install documentation from the source tarball. install -d %{buildroot}%{_pkgdocdir} install -pm 0644 README.rst CONTRIBUTING.rst \ %{buildroot}%{_pkgdocdir}/ %check export CI=1 export CARGO_NET_OFFLINE=true %cmake_build --target fish_run_tests %post if [ "$1" -eq 1 ]; then if [ ! -f %{_sysconfdir}/shells ]; then printf '%s\n' \ "%{_bindir}/fish" \ "/bin/fish" > %{_sysconfdir}/shells else grep -qxF "%{_bindir}/fish" %{_sysconfdir}/shells || echo "%{_bindir}/fish" >> %{_sysconfdir}/shells grep -qxF "/bin/fish" %{_sysconfdir}/shells || echo "/bin/fish" >> %{_sysconfdir}/shells fi fi %postun if [ "$1" -eq 0 ] && [ -f %{_sysconfdir}/shells ]; then sed -i '\!^%{_bindir}/fish$!d' %{_sysconfdir}/shells sed -i '\!^/bin/fish$!d' %{_sysconfdir}/shells fi %files %license COPYING %doc %{_pkgdocdir} %{_bindir}/fish* %config(noreplace) %{_sysconfdir}/fish/ %{_datadir}/fish/ %{_datadir}/pkgconfig/fish.pc %changelog %autochangelog