tcsh/tcsh.spec
2020-01-08 19:18:10 +08:00

115 lines
3.3 KiB
RPMSpec

Name: tcsh
Version: 6.21.00
Release: 3
Summary: C shell with file name completion and command line editing
License: BSD
URL: http://www.tcsh.org/
Source0: http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/%{name}/%{name}-%{version}.tar.gz
BuildRequires: gettext-devel ncurses-devel autoconf
Requires(post): coreutils grep
Requires(postun): sed
Provides: /bin/csh /bin/tcsh
Provides: csh = %{version}
Patch6000: 0061-PR-81-oldping-Fix-range-matching-issue-where-we-were.patch
Patch6001: 0063-PR-88-sharifib-Preserve-empty-arguments-in-arrays-as.patch
%description
Tcsh is an enhanced but completely compatible version of the Berkeley
C-Shell, with the addition of a command line editor, command and file
name completion, listing, etc., and a bunch of small additions to the
shell itself.
%package help
Summary: help document for tcsh
BuildArch: noarch
%description help
help document for tcsh.
%prep
%autosetup -p1
%build
%configure
%make_build all
%install
%make_install
gzip $RPM_BUILD_ROOT%{_mandir}/man1/tcsh.1
rm -f $RPM_BUILD_ROOT%{_bindir}/tcsh.old
ln -sf tcsh $RPM_BUILD_ROOT%{_bindir}/csh
ln -sf tcsh.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/csh.1.gz
localedir="$RPM_BUILD_ROOT%{_datadir}/locale";
for lang in $(ls $localedir); do
if [ -d $localedir/$lang ]; then
dir="$localedir/$lang/LC_MESSAGES"
if [[ -f "$dir/tcsh.cat" ]]; then
mv $dir/tcsh.cat $dir/tcsh
echo "%lang($lang) %{_datadir}/locale/$lang/LC_MESSAGES/tcsh"
fi
fi
done > %{name}.lang
%check
%make_build check
%pre
%preun
%post
if [[ "$1" -eq 1 ]]; then
if [[ ! -f %{_sysconfdir}/shells ]]; then
echo "/bin/csh" >> %{_sysconfdir}/shells
echo "/bin/tcsh" >> %{_sysconfdir}/shells
echo "%{_bindir}/csh" >> %{_sysconfdir}/shells
echo "%{_bindir}/tcsh" >> %{_sysconfdir}/shells
else
grep -q "^/bin/csh$" %{_sysconfdir}/shells || echo "/bin/csh" >> %{_sysconfdir}/shells
grep -q "^/bin/tcsh$" %{_sysconfdir}/shells || echo "/bin/tcsh" >> %{_sysconfdir}/shells
grep -q "^%{_bindir}/csh$" %{_sysconfdir}/shells || echo "%{_bindir}/csh" >> %{_sysconfdir}/shells
grep -q "^%{_bindir}/tcsh$" %{_sysconfdir}/shells || echo "%{_bindir}/tcsh" >> %{_sysconfdir}/shells
fi
fi
%postun
if [[ "$1" -eq 0 && -f %{_sysconfdir}/shells ]]; then
sed -i -e '\!^/bin/csh$!d' %{_sysconfdir}/shells
sed -i -e '\!^/bin/tcsh$!d' %{_sysconfdir}/shells
sed -i -e '\!^%{_bindir}/csh$!d' %{_sysconfdir}/shells
sed -i -e '\!^%{_bindir}/tcsh$!d' %{_sysconfdir}/shells
fi
%files -f %{name}.lang
%defattr(-,root,root)
%doc Copyright FAQ Fixes README.md complete.tcsh
%{_bindir}/tcsh
%{_bindir}/csh
%files help
%defattr(-,root,root)
%{_mandir}/man1/*.1*
%changelog
* Wed Jan 8 2020 openEuler Buildteam <buildteam@openeuler.org> - 6.21.00-3
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: revise source0
* Wed Dec 18 2019 jiangchuangang <jiangchuangang@huawei.com> - 6.21.00-2
- Type:enhancement
- ID:NA
- SUG:restart
- DESC:Synchronize patches
* Wed Sep 04 2019 Huiming Xue <xiehuiming@huawei.com> - 6.21.00.1
- modify spec file
* Tue Sep 03 2019 Huiming Xue <xiehuiming@huawei.com> - 6.20.00.11
- Package init