2015-07-24 02:23:18 +00:00
|
|
|
Summary: Friendly interactive shell
|
|
|
|
Name: fish
|
|
|
|
|
|
|
|
Version: @RPMVERSION@
|
|
|
|
Release: 0.%{?dist}
|
|
|
|
|
|
|
|
License: GPL-2.0
|
|
|
|
Group: System/Shells
|
2017-02-17 13:30:43 +00:00
|
|
|
URL: https://fishshell.com/
|
2015-07-24 02:23:18 +00:00
|
|
|
|
2020-02-14 14:41:13 +00:00
|
|
|
Source0: %{name}_@VERSION@.orig.tar.xz
|
2020-02-14 14:44:59 +00:00
|
|
|
BuildRequires: ncurses-devel gettext gcc-c++ xz
|
2015-07-24 02:23:18 +00:00
|
|
|
|
2019-01-05 12:27:06 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
2018-05-29 05:46:14 +00:00
|
|
|
BuildRequires: cmake3
|
|
|
|
%else
|
2019-12-03 06:47:52 +00:00
|
|
|
BuildRequires: cmake pcre2-devel
|
2018-05-29 05:46:14 +00:00
|
|
|
%endif
|
|
|
|
|
2020-01-25 14:34:33 +00:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: update-desktop-files
|
|
|
|
%endif
|
|
|
|
|
2019-01-05 12:27:06 +00:00
|
|
|
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
|
2020-04-01 09:16:52 +00:00
|
|
|
BuildRequires: gcc48 gcc48-c++
|
2016-12-11 08:58:13 +00:00
|
|
|
%endif
|
|
|
|
|
2019-01-05 09:28:37 +00:00
|
|
|
# for tests
|
2020-02-06 05:15:49 +00:00
|
|
|
%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} > 7 )
|
2019-01-05 09:28:37 +00:00
|
|
|
# Need the en_US.utf-8 locale at a minimum
|
|
|
|
BuildRequires: glibc-langpack-en
|
|
|
|
%endif
|
2020-01-28 08:55:05 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
|
|
|
BuildRequires: python
|
|
|
|
%else
|
2019-12-03 07:05:38 +00:00
|
|
|
BuildRequires: python3
|
|
|
|
%endif
|
2019-01-05 09:28:37 +00:00
|
|
|
|
2015-07-24 02:23:18 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
|
2020-02-13 15:18:23 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
2016-03-06 11:24:02 +00:00
|
|
|
Requires: python
|
2020-02-13 15:18:23 +00:00
|
|
|
%else
|
|
|
|
Requires: python3
|
|
|
|
%endif
|
2015-07-24 02:23:18 +00:00
|
|
|
Requires: man
|
|
|
|
|
|
|
|
%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
|
|
|
|
%setup -q -n %{name}-@VERSION@
|
|
|
|
|
|
|
|
%build
|
2019-01-05 12:27:06 +00:00
|
|
|
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
|
2016-12-11 08:58:13 +00:00
|
|
|
export CC=gcc48
|
|
|
|
export CXX=g++48
|
2018-05-29 05:46:14 +00:00
|
|
|
EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo"
|
2016-12-11 08:58:13 +00:00
|
|
|
%endif
|
2019-01-02 13:38:30 +00:00
|
|
|
# CMake macros define -DBUILD_SHARED_LIBS:BOOL=ON, which breaks the
|
|
|
|
# bundled PCRE2 static library.
|
|
|
|
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS:BOOL=OFF"
|
2019-01-02 13:36:55 +00:00
|
|
|
# CMake macros define the wrong sysconfdir arguments
|
|
|
|
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}"
|
2019-01-05 12:27:06 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 8
|
2019-01-02 13:36:55 +00:00
|
|
|
%cmake3 $EXTRA_CMAKE_FLAGS
|
2016-12-13 00:04:28 +00:00
|
|
|
%else
|
2019-01-02 13:36:55 +00:00
|
|
|
%cmake $EXTRA_CMAKE_FLAGS
|
2016-12-13 00:04:28 +00:00
|
|
|
%endif
|
2018-05-29 05:46:14 +00:00
|
|
|
%if 0%{?make_jobs:1}
|
|
|
|
%make_jobs
|
|
|
|
%else
|
2015-07-24 02:23:18 +00:00
|
|
|
make %{?_smp_mflags}
|
2018-05-29 05:46:14 +00:00
|
|
|
%endif
|
2015-07-24 02:23:18 +00:00
|
|
|
|
|
|
|
%install
|
2018-05-29 05:46:14 +00:00
|
|
|
%if 0%{?cmake_install:1}
|
|
|
|
%cmake_install
|
|
|
|
%else
|
|
|
|
%make_install
|
|
|
|
%endif
|
2015-07-24 02:23:18 +00:00
|
|
|
%find_lang %{name}
|
2020-01-25 14:34:33 +00:00
|
|
|
# OpenSUSE has strong opinions about categories which do not apply to other systems
|
|
|
|
%if 0%{?suse_version}
|
2020-01-26 13:36:00 +00:00
|
|
|
%suse_update_desktop_file fish "System;TerminalEmulator"
|
2020-01-25 14:34:33 +00:00
|
|
|
%endif
|
2020-02-18 14:02:13 +00:00
|
|
|
cp -a README.md %{buildroot}%{_pkgdocdir}
|
|
|
|
cp -a CONTRIBUTING.md %{buildroot}%{_pkgdocdir}
|
2015-07-24 02:23:18 +00:00
|
|
|
|
2019-01-05 09:28:37 +00:00
|
|
|
%check
|
|
|
|
# OpenSUSE does out-of-tree builds and defines __builddir
|
|
|
|
%if 0%{?__builddir:1}
|
|
|
|
cd %__builddir
|
|
|
|
%endif
|
2020-04-01 09:16:52 +00:00
|
|
|
# Turn off tests on RHEL 6, they are hard to keep running
|
|
|
|
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
|
|
|
|
./fish -c 'exit 0'
|
|
|
|
%else
|
2019-01-11 16:06:27 +00:00
|
|
|
make test SHOW_INTERACTIVE_LOG=1
|
2020-04-01 09:16:52 +00:00
|
|
|
%endif
|
2019-01-05 09:28:37 +00:00
|
|
|
|
2015-07-24 02:23:18 +00: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
|
|
|
|
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 -f %{name}.lang
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
|
|
|
# The documentation directory
|
2020-02-18 14:02:13 +00:00
|
|
|
%doc %{_datadir}/doc/fish/
|
2015-07-24 02:23:18 +00:00
|
|
|
|
|
|
|
# man files
|
|
|
|
%{_mandir}/man1/*
|
|
|
|
%{_datadir}/fish/man/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 10:04:14 +00:00
|
|
|
|
|
|
|
# FreeDesktop entry
|
|
|
|
%{_datadir}/applications/fish.desktop
|
|
|
|
%{_datadir}/pixmaps/fish.png
|