commit f07153d5b4c21533a97c162473c759c14e8693b9 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:18:15 2019 -0400 Package init diff --git a/tcsh-6.21.00.tar.gz b/tcsh-6.21.00.tar.gz new file mode 100644 index 0000000..e17b6d7 Binary files /dev/null and b/tcsh-6.21.00.tar.gz differ diff --git a/tcsh.spec b/tcsh.spec new file mode 100644 index 0000000..e89a547 --- /dev/null +++ b/tcsh.spec @@ -0,0 +1,100 @@ +Name: tcsh +Version: 6.21.00 +Release: 1 +Summary: C shell with file name completion and command line editing +License: BSD +URL: http://www.tcsh.org/ +Source0: %{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} + + +%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 Sep 04 2019 Huiming Xue - 6.21.00.1 +- modify spec file + +* Tue Sep 03 2019 Huiming Xue - 6.20.00.11 +- Package init