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