%define _snapshot -pre20000412 %define subrel 1 Summary: Clients for remote access commands (rsh, rlogin, rcp) Name: rsh Version: 0.17 Release: %mkrel 19 License: BSD Group: Networking/Remote access URL: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/ Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-rsh-%{version}%{_snapshot}.tar.bz2 Source1: rexec.pam Source2: rlogin.pam Source3: rsh.pam Source4: http://www.tc.cornell.edu/~sadd/rexec-1.5.tar.bz2 Source5: rsh-xinetd Source6: rlogin-xinetd Source7: rexec-xinetd Patch1: netkit-rsh-0.17-pre20000412-varargs.patch Patch2: netkit-rsh-0.17-sectty.patch Patch3: netkit-rsh-0.10-rexec.patch Patch4: netkit-rsh-0.10-stdarg.patch Patch5: netkit-rsh-0.16-jbj.patch Patch9: netkit-rsh-0.16-jbj4.patch Patch10: netkit-rsh-0.16-prompt.patch Patch11: netkit-rsh-0.16-rlogin=rsh.patch Patch12: netkit-rsh-0.16-nokrb.patch Patch13: netkit-rsh-0.17-pre20000412-jbj5.patch Patch14: netkit-rsh-0.17-pre20000412-glibc22.patch Patch15: netkit-rsh-0.17-userandhost.patch BuildRequires: libtermcap-devel BuildRequires: pam-devel Conflicts: krb5-workstation <= 1.3-4mdk Requires(post): update-alternatives Requires(preun): update-alternatives Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description The rsh package contains a set of programs which allow users to run commmands on remote machines, login to other machines and copy files between machines (rsh, rlogin and rcp). All three of these commands use rhosts style authentication. This package contains the clients needed for all of these services. The rsh package should be installed to enable remote access to other machines. %package server Summary: Servers for remote access commands (rsh, rlogin, rcp) Group: System/Servers Requires: pam >= 0.59, xinetd %description server The rsh-server package contains a set of programs which allow users to run commmands on remote machines, login to other machines and copy files between machines (rsh, rlogin and rcp). All three of these commands use rhosts style authentication. This package contains the servers needed for all of these services. It also contains a server for rexec, an alternate method of executing remote commands. All of these servers are run by xinetd and configured using /etc/xinetd.d/ and PAM. All the server is disabled by default. %prep %setup -q -n netkit-rsh-%{version}%{_snapshot} -a 4 %patch1 -p1 -b .varargs %patch2 -p1 -b .sectty %patch3 -p1 -b .rexec %patch4 -p1 -b .stdarg %patch5 -p1 -b .jbj %patch9 -p1 -b .jbj4 %patch10 -p1 -b .prompt %patch11 -p1 -b .rsh %patch12 -p1 -b .rsh.nokrb %patch13 -p1 -b .jbj5 %patch14 -p1 -b .glibc22 %patch15 -p1 -b userandhost # No, I don't know what this is doing in the tarball. rm -f rexec/rexec %build sh configure perl -pi -e ' s,^CC=.*$,CC=cc,; s,-O2,\$(RPM_OPT_FLAGS),; s,^BINDIR=.*$,BINDIR=%{_bindir},; s,^MANDIR=.*$,MANDIR=%{_mandir},; s,^SBINDIR=.*$,SBINDIR=%{_sbindir},; ' MCONFIG %make %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/pam.d mkdir -p %{buildroot}{%{_bindir},%{_sbindir}} mkdir -p %{buildroot}%{_mandir}/{man1,man5,man8} make INSTALLROOT=%{buildroot} MANDIR=%{_mandir} install install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/rexec install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/rlogin install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/rsh make INSTALLROOT=%{buildroot} MANDIR=%{_mandir} install -C rexec cd %{buildroot}%{_mandir}/man8 for i in rexecd rlogind rshd; do rm $i.8 echo ".so man8/in.$i.8" > $i.8 done install -D -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/xinetd.d/rsh install -m644 %{SOURCE6} %{buildroot}%{_sysconfdir}/xinetd.d/rlogin install -m644 %{SOURCE7} %{buildroot}%{_sysconfdir}/xinetd.d/rexec # rexec.1 lands in the wrong place mv %{buildroot}%{_mandir}/rexec.1 %{buildroot}%{_mandir}/man1/ # use alternatives to prevent conflict with krb5 provided binaries for i in rcp rlogin rsh; do mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i.netkit mv %{buildroot}%{_mandir}/man1/$i.1 %{buildroot}%{_mandir}/man1/$i.netkit.1 done %post %{_sbindir}/update-alternatives --install %{_bindir}/rcp rcp %{_bindir}/rcp.netkit 10 --slave \ %{_mandir}/man1/rcp.1%{_extension} man-rcp %{_mandir}/man1/rcp.netkit.1%{_extension} %{_sbindir}/update-alternatives --install %{_bindir}/rlogin rlogin %{_bindir}/rlogin.netkit 10 --slave \ %{_mandir}/man1/rlogin.1%{_extension} man-rlogin %{_mandir}/man1/rlogin.netkit.1%{_extension} %{_sbindir}/update-alternatives --install %{_bindir}/rsh rsh %{_bindir}/rsh.netkit 10 --slave \ %{_mandir}/man1/rsh.1%{_extension} man-rsh %{_mandir}/man1/rsh.netkit.1%{_extension} %preun if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives --remove rcp %{_bindir}/rcp.netkit %{_sbindir}/update-alternatives --remove rlogin %{_bindir}/rlogin.netkit %{_sbindir}/update-alternatives --remove rsh %{_bindir}/rsh.netkit fi %triggerpostun -- %{name} <= 0.17-12mdk if [ ! -f %{_bindir}/rcp ]; then %{_sbindir}/update-alternatives --install %{_bindir}/rcp rcp %{_bindir}/rcp.netkit 10 --slave \ %{_mandir}/man1/rcp.1%{_extension} man-rcp %{_mandir}/man1/rcp.netkit.1%{_extension} %{_sbindir}/update-alternatives --install %{_bindir}/rlogin rlogin %{_bindir}/rlogin.netkit 10 --slave \ %{_mandir}/man1/rlogin.1%{_extension} man-rlogin %{_mandir}/man1/rlogin.netkit.1%{_extension} %{_sbindir}/update-alternatives --install %{_bindir}/rsh rsh %{_bindir}/rsh.netkit 10 --slave \ %{_mandir}/man1/rsh.1%{_extension} man-rsh %{_mandir}/man1/rsh.netkit.1%{_extension} fi %clean rm -rf %{buildroot} %files %defattr(-,root,root) %{_bindir}/rexec %{_mandir}/man1/*.1* %defattr(4755,root,root) %{_bindir}/rcp.netkit %{_bindir}/rlogin.netkit %{_bindir}/rsh.netkit %files server %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/xinetd.d/* %config(noreplace) %{_sysconfdir}/pam.d/* %{_mandir}/man8/*.8* %{_sbindir}/in.* %changelog * Mon May 19 2008 Oden Eriksson <oeriksson@mandriva.com> 0.17-19.1mdv2008.0 + Revision: 209003 - fix the man pages (%%{_extension}) - fix deps (fixes #40600) * Tue Oct 02 2007 Andreas Hasenack <andreas@mandriva.com> 0.17-18mdv2008.0 + Revision: 94722 - fixed pam files for new include syntax (#34367) * Wed Jun 27 2007 Adam Williamson <awilliamson@mandriva.com> 0.17-17mdv2008.0 + Revision: 45195 - fix pam config (#31656) * Sat Mar 17 2007 Oden Eriksson <oeriksson@mandriva.com> 0.17-16mdv2007.1 + Revision: 145558 - Import rsh * Sat Mar 17 2007 Oden Eriksson <oeriksson@mandriva.com> 0.17-16mdv2007.1 - use the %%mrel macro - bunzip patches * Mon May 08 2006 Stefan van der Eijk <stefan@eijk.nu> 0.17-15mdk - rebuild for sparc * Wed Aug 24 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 0.17-14mdk - varargs fixes