Initial import of "rc"

This commit is contained in:
Robert Scheck 2015-05-09 23:29:41 +02:00
parent a4a8959b81
commit d9572f2155
4 changed files with 100 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/rc-?.?.*.tar.gz

22
rc-1.7.2-check.patch Normal file
View File

@ -0,0 +1,22 @@
Patch by Jeffrey Johnson for rc >= 1.7.2 which makes "make check"
succeeding if MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) is given (in
accordance to http://udrepper.livejournal.com/11429.html).
--- rc-1.7.2/input.c 2014-08-31 17:57:48.000000000 -0400
+++ rc-1.7.2/input.c.check 2015-04-04 14:14:40.162968439 -0400
@@ -2,6 +2,7 @@
#include "rc.h"
+#include <stdio.h>
#include <errno.h>
#include "edit.h"
@@ -163,6 +164,7 @@ void termchange(void) {
extern void initinput() {
istack = itop = ealloc(istacksize = 256 * sizeof (Input));
+ istack->ungetcount = 0;
ugchar(EOF);
}

76
rc.spec Normal file
View File

@ -0,0 +1,76 @@
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
%global _bindir /bin
%endif
Summary: Re-implementation for Unix of the Plan 9 shell
Name: rc
Version: 1.7.2
Release: 1%{?dist}
License: zlib
Group: System Environment/Shells
URL: http://tobold.org/article/rc
Source0: http://static.tobold.org/%{name}/%{name}-%{version}.tar.gz
Patch0: rc-1.7.2-check.patch
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
Conflicts: filesystem < 3
Provides: /bin/rc
%endif
Requires(post): grep
Requires(postun): sed
BuildRequires: readline-devel, autoconf, automake
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Rc is a command interpreter for Plan 9 that provides similar facilities to
UNIX's Bourne shell, with some small additions and less idiosyncratic syntax.
This is a re-implementation for Unix, by Byron Rakitzis, of the Plan 9 shell.
%prep
%setup -q
%patch0 -p1 -b .check
%build
# Run "autoreconf" because "make" triggers "autoconf" expecting version 2.69
autoreconf -f
%configure --with-edit=gnu
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' install
%check
make check
%post
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
grep -q "^/bin/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \
echo "/bin/%{name}" >> %{_sysconfdir}/shells
%endif
grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \
echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells
%postun
if [ ! -x %{_bindir}/%{name} ]; then
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
sed -e 's@^/bin/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells
%endif
sed -e 's@^%{_bindir}/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc ChangeLog AUTHORS EXAMPLES NEWS README
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%changelog
* Wed Apr 08 2015 Robert Scheck <robert@fedoraproject.org> 1.7.2-1
- Upgrade to 1.7.2
- Initial spec file for Fedora and Red Hat Enterprise Linux

View File

@ -0,0 +1 @@
ef8b4be56cee9a95558f538339dc96f1 rc-1.7.2.tar.gz