forked from fish-shell/fish-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fish.spec.in
146 lines (120 loc) · 3.39 KB
/
fish.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Summary: Friendly interactive shell
Name: fish
Version: @RPMVERSION@
Release: 0.%{?dist}
License: GPL-2.0
Group: System/Shells
URL: https://fishshell.com/
Source0: %{name}_@[email protected]
BuildRequires: ncurses-devel gettext gcc-c++ xz
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: cmake3
%else
BuildRequires: cmake pcre2-devel
%endif
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: gcc48 gcc48-c++
%endif
# for tests
%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} > 7 )
# Need the en_US.utf-8 locale at a minimum
BuildRequires: glibc-langpack-en
%endif
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: python
%else
BuildRequires: python3
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?rhel} && 0%{?rhel} < 8
Requires: python
%else
Requires: python3
%endif
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
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
export CC=gcc48
export CXX=g++48
EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo"
%endif
# 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"
# CMake macros define the wrong sysconfdir arguments
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}"
%if 0%{?rhel} && 0%{?rhel} < 8
%cmake3 $EXTRA_CMAKE_FLAGS
%else
%cmake $EXTRA_CMAKE_FLAGS
%endif
%if 0%{?make_jobs:1}
%make_jobs
%else
make %{?_smp_mflags}
%endif
%install
%if 0%{?cmake_install:1}
%cmake_install
%else
%make_install
%endif
%find_lang %{name}
# OpenSUSE has strong opinions about categories which do not apply to other systems
%if 0%{?suse_version}
%suse_update_desktop_file fish "System;TerminalEmulator"
%endif
cp -a README.md %{buildroot}%{_pkgdocdir}
cp -a CONTRIBUTING.md %{buildroot}%{_pkgdocdir}
%check
# OpenSUSE does out-of-tree builds and defines __builddir
%if 0%{?__builddir:1}
cd %__builddir
%endif
# 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
make test SHOW_INTERACTIVE_LOG=1
%endif
%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
%doc %{_datadir}/doc/fish/
# 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
# FreeDesktop entry
%{_datadir}/applications/fish.desktop
%{_datadir}/pixmaps/fish.png