@ -1,26 +1,35 @@
Name: fish
Version: 2.6.0
Release: 1%{?dist}
Summary: A friendly interactive shell
Group: System Environment/Shells
License: GPLv2
URL: https://fishshell.com/
Source0: https://fishshell.com/files/%{version}/fish-%{version}.tar.gz
BuildRequires: python%{python3_pkgversion}-devel
%global __python %{expand:%{__python%{python3_pkgversion}}}
Name: fish
Version: 2.7.1
Release: 1%{?dist}
Summary: Friendly interactive shell
License: GPLv2
URL: https://fishshell.com
Source0: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: doxygen
BuildRequires: ncurses-devel
BuildRequires: pcre2-devel
BuildRequires: python%{python3_pkgversion}-devel
%global __python %{__python3}
# fish's 'math' command requires bc
Requires: bc
Requires: bc
# tab completion wants man-db
Requires: man-db man-pages
%if 0%{?rhel} && 0%{?rhel} <= 7
Requires: man-db
Requires: man-pages
Requires: groff-base
%else
Recommends: man-db
Recommends: man-pages
Recommends: groff-base
%endif
# Other misc requirements
Requires: hostname
BuildRequires: ncurses-devel gettext groff doxygen pcre2-devel
Requires: hostname
%description
fish is a fully-equipped command line shell (like bash or zsh) that is
@ -28,79 +37,69 @@ smart and user-friendly. fish supports powerful features like syntax
highlighting, autosuggestions, and tab completions that just work, with
nothing to learn or configure.
# EPEL compatibility
%if 0%{?rhel}
%global _pkgdocdir %{_docdir}/%{name}
%endif
%prep
%setup -q
%autosetup -p1
# Change the bundled scripts to invoke the python binary directly.
for i in share/tools/*.py share/tools/*/*.py ; do
sed -i -e "1 s@^#!/usr/bin/env python\$@#!%{__python}@g" "$i "
for f in $(find share/tools -type f -name '*.py'); do
sed -i -e '1{s@^#!.*@#!%{__python3}@}' "$f "
done
%build
%configure --docdir=%{_pkgdocdir} --without-included-pcre2
make %{?_smp_mflags} all fish_tests
%configure --docdir=%{_pkgdocdir} --without-included-pcre2 --disable-silent-rules
%make_build all fish_tests
%install
%make_install
# Fish has magical manpages (visible from inside fish) that live in
# /usr/share/fish/man/man1. Compress them (rpm won't do it automatically).
gzip %{buildroot}%{_datadir}/fish/man/man1/*.1
%find_lang %{name}
# Fish has what appears to be a useless pkgconfig file
rm %{buildroot}/usr/share/pkgconfig/fish.pc
# https://github.com/rpm-software-management/rpm/pull/381
gzip -9 -n %{buildroot}%{_datadir}/fish/man/man1/*.1
# Install docs from tarball root
cp README.md %{buildroot}%{_pkgdocdir}
cp CONTRIBUTING.md %{buildroot}%{_pkgdocdir}
cp -a README.md %{buildroot}%{_pkgdocdir}
cp -a CONTRIBUTING.md %{buildroot}%{_pkgdocdir}
# filesystem will own a couple of config directories so that other packages
# can ship fish config snippets without requiring fish:
rmdir %{buildroot}%{_datadir}/fish/vendor_completions.d
rmdir %{buildroot}%{_datadir}/fish/vendor_conf.d
%check
%find_lang %{name}
# fish_tests is somewhat sensitive to the contents of the filesystem.
# If imake is installed, then fish_tests will fail. This shouldn't be
# a problem under mock, though.
#
# See: https://github.com/fish-shell/fish-shell/issues/2322
%check
./fish_tests
%post
# Add fish to the list of allowed shells in /etc/shells
if [ "$1" = 1 ]; then
if ! [ -f "%{_sysconfdir}/shells" ] || ! grep -q '^%{_bindir}/fish$' "%{_sysconfdir}/shells"; then
echo '%{_bindir}/fish' >>"%{_sysconfdir}/shells"
if [ ! -f %{_sysconfdir}/shells ] ; then
echo "%{_bindir}/fish" > %{_sysconfdir}/shells
echo "/bin/fish" >> %{_sysconfdir}/shells
else
grep -q "^%{_bindir}/fish$" %{_sysconfdir}/shells || echo "%{_bindir}/fish" >> %{_sysconfdir}/shells
grep -q "^/bin/fish$" %{_sysconfdir}/shells || echo "/bin/fish" >> %{_sysconfdir}/shells
fi
fi
%postun
# Remove fish from the list of allowed shells in /etc/shells
if [ "$1" = 0 ]; then
sed -i -e '\#^%{_bindir}/fish$#d' "%{_sysconfdir}/shells"
if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then
sed -i '\!^%{_bindir}/fish$!d' %{_sysconfdir}/shells
sed -i '\!^/bin/fish$!d' %{_sysconfdir}/shells
fi
%files -f %{name}.lang
%{_mandir}/man1/*.1*
%{_bindir}/*
%license COPYING
%{_mandir}/man1/fish*.1*
%{_bindir}/fish*
%config(noreplace) %{_sysconfdir}/fish/
%{_datadir}/fish/
%{_datadir}/pkgconfig/fish.pc
%{_pkgdocdir}
%changelog
* Sun Jan 14 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.7.1-1
- Update to 2.7.1
* Wed Oct 04 2017 Andy Lutomirski <luto@kernel.org> - 2.6.0-1
- Update to 2.6.0
- Stop using bundled pcre2