2015-07-24 10:23:18 +08:00
Summary : Friendly interactive shell
Name : fish
Version : @RPMVERSION@
Release : 0.%{?dist}
License : GPL-2.0
Group : System/Shells
2017-02-17 21:30:43 +08:00
URL : https://fishshell.com/
2015-07-24 10:23:18 +08:00
Source0 : %{name} _@VERSION@.orig.tar.gz
BuildRequires : ncurses-devel gettext gcc-c++ autoconf
2018-05-29 13:46:14 +08:00
%if 0%{?rhel_version} && 0%{?rhel_version} && 0%{?rhel_version} < 800
BuildRequires : cmake3
%else
BuildRequires : cmake
%endif
%if 0%{?opensuse_bs} && 0%{?rhel_version} && 0%{?rhel_version} < 700
2016-12-11 16:58:13 +08:00
BuildRequires : gcc48 gcc48-c++
%endif
2017-08-26 00:16:29 +08:00
%if 0%{?is_opensuse} || 0%{?fedora}
BuildRequires : pcre2-devel
%endif
2015-07-24 10:23:18 +08:00
BuildRoot : %{_tmppath} /%{name} -%{version} -%{release} -root-%(%{__id_u} -n)
2016-03-06 19:24:02 +08:00
Requires : python
2015-07-24 10:23:18 +08: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
2018-05-29 13:46:14 +08:00
%if 0%{?opensuse_bs} && 0%{?rhel_version} && 0%{?rhel_version} < 700
2016-12-11 16:58:13 +08:00
export CC=gcc48
export CXX=g++48
2018-05-29 13:46:14 +08:00
EXTRA_CMAKE_FLAGS=" - D C U R S E S _ E X T R A _ L I B R A R Y = t i n f o "
2016-12-16 09:32:50 +08:00
%if 0%{?rhel} < 6
# i686 required for atomic instructions; default is i386
export CXXFLAGS=" $ C X X F L A G S - m a r c h = i 6 8 6 "
%endif
2016-12-11 16:58:13 +08:00
%endif
2018-05-29 13:46:14 +08:00
# CMake macros on OpenSUSE and Fedora define the wrong sysconfdir arguments
%if 0%{?rhel_version} && 0%{?rhel_version} < 800
%cmake3 -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} $EXTRA_CMAKE_FLAGS
2016-12-13 08:04:28 +08:00
%else
2018-05-29 13:46:14 +08:00
%cmake -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} $EXTRA_CMAKE_FLAGS
2016-12-13 08:04:28 +08:00
%endif
2018-05-29 13:46:14 +08:00
%if 0%{?make_jobs:1}
%make_jobs
%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}
%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
%docdir %{_datadir} /doc/fish/
%{_datadir} /doc/fish/
# man files
%{_mandir} /man1/*
%docdir %{_datadir} /fish/man/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