Summary:     Displays the users logged into machines on the local network.
Summary(ja): ローカルネットワーク上のマシンにログインしたユーザを表示する
Name: rusers
Version: 0.17
Release: 48%{?_dist_release}

License: BSD
Group: Applications/Internet

Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit-devel/netkit-rusers-%{version}.tar.gz
Source1: rusersd.init
Source2: rstatd.tar.gz
Source3: rstatd.init
Patch0: rstatd-jbj.patch
Patch1: netkit-rusers-0.15-numusers.patch
Patch2: netkit-rusers-0.17-2.4.patch
Patch3: netkit-rusers-0.17-includes.patch
Patch4: netkit-rusers-0.17-truncate.patch
Patch5: netkit-rusers-0.17-stats.patch
Patch6: netkit-rusers-0.17-rstatd-no-static-buffer.patch
Patch7: netkit-rusers-0.17-strip.patch
Patch8: netkit-rusers-0.17-rup.patch
Patch9: netkit-rusers-0.17-rup-timeout.patch
Patch10: netkit-rusers-0.17-procps.patch
Patch11: netkit-rusers-0.17-rup-stack.patch
Patch12: netkit-rusers-0.17-bigendian.patch
Patch13: netkit-rusers-0.17-return.patch
Patch14: netkit-rusers-0.17-procdiskstats.patch
Patch15: netkit-rusers-0.17-rusersd-droppriv.patch
# Oracle explicitly gave permission for this relicensing on August 18, 2010.
Patch16: netkit-rusers-0.17-new-rpc-license.patch

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: procps

%description
The rusers program allows users to find out who is logged into various
machines on the local network.  The rusers command produces output
similar to who, but for the specified list of hosts or for all
machines on the local network.

Install rusers if you need to keep track of who is logged into your
local network.

%description -l ja
rusers プログラムを使うとローカルネットワーク上の様々なマシンに
誰がログインしているかを調べることが出来ます．rusers コマンドは
who に似た出力をしますが，引数で指定したホストあるいはローカル
ネットワーク上の全ホストの情報を出力するところが異なります．

ローカルネットワークで誰がログインしているかを調べるには
rusers パッケージをインストールして下さい．


%package server
Summary: Server for the rusers protocol.
Summary(ja): rusers プロトコルのサーバ
Group: System Environment/Daemons
#Prereq: /sbin/chkconfig /etc/init.d
Requires(pre): /sbin/chkconfig
Requires: portmap


%description server
The rusers program allows users to find out who is logged into various
machines on the local network.  The rusers command produces output
similar to who, but for the specified list of hosts or for all
machines on the local network. The rusers-server package contains the
server for responding to rusers requests.

Install rusers-server if you want remote users to be able to see
who is logged into your machine.

%description server -l ja
rusers プログラムを使うとローカルネットワーク上の様々なマシンに
誰がログインしているかを調べることが出来ます．rusers コマンドは
who に似た出力をしますが，引数で指定したホストあるいはローカル
ネットワーク上の全ホストの情報を出力するところが異なります．
この rusers-server パッケージには rusers のリクエストに答える
サーバが含まれています．

遠隔ユーザがあなたのマシンに誰がログインしているかを調べることが
出来る様にするには，rusers-server パッケージをインストールして下さい．


%prep
%setup -q -n netkit-rusers-%{version} -a 2
%patch0 -p1 -b .jbj
%patch1 -p1 -b .numusers
%patch2 -p1 -b .2.4
%patch3 -p1 -b .includes
%patch4 -p1 -b .truncate
%patch5 -p1 -b .stats
%patch6 -p1 -b .rstatd-no-static-buffer
%patch7 -p1 -b .strip
%patch8 -p1 -b .rup
%patch9 -p1 -b .rup-timeout
%patch10 -p1 -b .procps
%patch11 -p1 -b .rup-stack
%patch12 -p1 -b .bigendian
%patch13 -p1 -b .return
%patch14 -p1 -b .procdiskstats
%patch15 -p1 -b .dropprivs
%patch16 -p1 -b .licensefix

%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
make -C rpc.rstatd


%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man{1,8}
mkdir -p ${RPM_BUILD_ROOT}%{_initdir}

make INSTALLROOT=${RPM_BUILD_ROOT} install
make INSTALLROOT=${RPM_BUILD_ROOT} install -C rpc.rstatd

install -m 755 $RPM_SOURCE_DIR/rusersd.init ${RPM_BUILD_ROOT}%{_initdir}/rusersd
install -m 755 $RPM_SOURCE_DIR/rstatd.init ${RPM_BUILD_ROOT}%{_initdir}/rstatd


%clean
rm -rf ${RPM_BUILD_ROOT}


%post server
/sbin/chkconfig --add rusersd
/sbin/chkconfig --add rstatd


%preun server
if [ $1 = 0 ]; then
    /sbin/chkconfig --del rusersd
    /sbin/chkconfig --del rstatd
fi


%files
%defattr(-,root,root)
%doc README
%{_bindir}/rup
%{_bindir}/rusers
%{_mandir}/man1/*

%files server
%defattr(-,root,root)
%{_mandir}/man8/*
%{_sbindir}/rpc.rstatd
%{_sbindir}/rpc.rusersd
%config %{_initdir}/rusersd
%config %{_initdir}/rstatd


%changelog
* Sun May  1 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.17-48
- rebuilt with current VineSeed
- added Patch 14, 15 and 16 from FC
  * Thu Aug 26 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 0.17-60
  - replace SunRPC license with BSD (thanks to Oracle)
  * Sat Sep 15 2007 Steve Dickson <steved@redaht.com> 0.17-51
  - Removed portmap dependency and re-worked when the user
    privilege are drop; allowing port registration with
    rpcbind. (#247985)
  * Wed Aug 09 2006 Phil Knirsch <pknirsch@redhat.com> 0.17-47
  - Modified the RHEL3 procpartitions patch to work on recent 2.6 
    kernels (#201839)

* Fri Oct 10 2008 Shu KONNO <owa@bg.wakwak.com> 0.17-47vl5
- applied new versioning policy, spec in utf-8

* Sun Jun 25 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.17-46vl1
- added Patch 10, 11, 12 and 13 from Fedora 0.17-46
  * Tue Mar 21 2006 Phil Knirsch <pknirsch@redhat.com> - 0.17-46
  - Included fix for correct return values for rup (#177419)
  * Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 0.17-45.2.1
  - bump again for double-long bug on ppc(64)
  * Wed Sep 07 2005 Phil Knirsch <pknirsch@redhat.com> 0.17-45
  - Fixed 64bit bigendian problem in rpc.rstatd (#130286)
  * Wed May 04 2005 Phil Knirsch <pknirsch@redhat.com> 0.17-44
  - Fixed rup stack problem (#154396)
  * Mon Jul 12 2004 Phil Knirsch <pknirsch@redhat.com> 0.17-40
  - Made patch to make rpc.rstatd independant of procps (#127512)
- changed Group to Applications/Internet

* Mon Jul 16 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.17-30vl1
- based on Redhat Rawhide 0.17-30
- rebuild with new toolchains
- to use License instead of Copyright

* Wed Jan 10 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 0.17-6vl1
- based on 0.17-6 from Rawhide
- use better macros (%%{_initdir})
- added Japanese summary and description

* Sat Aug 05 2000 Bill Nottingham <notting@redhat.com>
- condrestart fixes

* Thu Jul 20 2000 Bill Nottingham <notting@redhat.com>
- move initscript back

* Sun Jul 16 2000 Matt Wilson <msw@redhat.com>
- rebuilt against new procps

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jul 10 2000 Preston Brown <pbrown@redhat.com>
- move initscripts

* Sun Jun 18 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.
- update to 0.17.

* Wed Feb  9 2000 Jeff Johnson <jbj@redhat.com>
- compress man pages (again).

* Wed Feb 02 2000 Cristian Gafton <gafton@redhat.com>
- fix description and summary
- man pages are compressed

* Tue Jan  4 2000 Bill Nottingham <notting@redhat.com>
- split client and server

* Tue Dec 21 1999 Jeff Johnson <jbj@redhat.com>
- update to 0.16.

* Wed Nov 10 1999 Bill Nottingham <notting@redhat.com>
- rebuild against new procps

* Wed Sep 22 1999 Jeff Johnson <jbj@redhat.com>
- rusers init script started rstatd.

* Mon Sep 20 1999 Jeff Johnson <jbj@redhat.com>
- (re-)initialize number of users (#5244).

* Fri Aug 27 1999 Preston Brown <pbrown@redhat.com>
- initscripts check for portmapper running before starting (#2615)

* Fri Aug 27 1999 Jeff Johnson <jbj@redhat.com>
- return monitoring statistics like solaris does (#4237).

* Thu Aug 26 1999 Jeff Johnson <jbj@redhat.com>
- update to netkit-0.15.
- on startup, rpc.rstatd needs to read information twice (#3994).

* Mon Aug 16 1999 Bill Nottingham <notting@redhat.com>
- initscript munging

* Tue Apr  6 1999 Jeff Johnson <jbj@redhat.com>
- add rpc.rstatd (#2000)

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 22)

* Mon Mar 15 1999 Jeff Johnson <jbj@redhat.com>
- compile for 6.0.

* Tue May 05 1998 Cristian Gafton <gafton@redhat.com>
- added /etc/rc.d/init.d/functions to the init script

* Tue May 05 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Sat May 02 1998 Cristian Gafton <gafton@redhat.com>
- enhanced initscript

* Tue Oct 21 1997 Erik Troan <ewt@redhat.com>
- added init script
- users %attr
- supports chkconfig

* Tue Jul 15 1997 Erik Troan <ewt@redhat.com>
- initial build
