Blob Blame History Raw
Name:		conman
Version:	0.1.9.2
Release:	3%{?dist}
Summary:	ConMan - The Console Manager

Group:		Applications/System
License:	GPL
URL:		http://www.llnl.gov/linux/conman/
Source0:	ftp://ftp.llnl.gov/pub/linux/%{name}/%{name}-%{version}.tar.bz2
Source1:	%{name}.init
Source2:	%{name}.logrotate
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires:	logrotate
BuildRequires:	tcp_wrappers

%description
ConMan is a serial console management program designed to support a large
number of console devices and simultaneous users.  It currently supports
local serial devices and remote terminal servers (via the telnet protocol).
Its features include:

  - mapping symbolic names to console devices
  - logging all output from a console device to file
  - supporting monitor (R/O), interactive (R/W), and
    broadcast (W/O) modes of console access
  - allowing clients to join or steal console "write" privileges
  - executing Expect scripts across multiple consoles in parallel

%prep
%setup -q

%build
# not really lib material, more like share
mv lib share
chmod -x share/examples/*.exp
%{__perl} -pi.orig -e 's|cd lib|cd share|g' \
    Makefile.in
%{__perl} -pi -e 's|lib\/|share\/|g' \
    Makefile.in share/examples/*.exp
# don't strip the bins on install, let find-debug.sh do it
%{__perl} -pi -e 's|-m 755 -s conman|-m 755 conman|g' \
    Makefile.in

# don't run service by default
%{__perl} -pi -e 's|chkconfig:.*345 95 5|chkconfig: - 95 5|g' \
    etc/%{name}.init.in

%configure --with-tcp-wrappers
make

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# put in our own initscript and logrotate
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/%{name}
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
# make log directories
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.old
# examples don't belong in datadir...
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/examples
# these shouldn't be executable
chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
# adjust perms on main config file
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf

%clean
rm -rf "$RPM_BUILD_ROOT"

%post
/sbin/chkconfig --add conman

%preun
if [ "$1" = 0 ]; then
  /sbin/service conman stop >/dev/null 2>&1 || :
  /sbin/chkconfig --del conman
fi

%postun
if [ "$1" -ge 1 ]; then
  /sbin/service conman condrestart >/dev/null 2>&1 || :
fi

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING DISCLAIMER FAQ NEWS
%doc share/examples
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_sysconfdir}/init.d/%{name}
%{_localstatedir}/log/%{name}
%{_localstatedir}/log/%{name}.old
%{_bindir}/*
%{_sbindir}/*
%{_datadir}/%{name}
%{_mandir}/*/*

%changelog
* Wed Jul 05 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-3
- Add missing condrestart fuction to initscript

* Tue Jun 27 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-2
- Don't strip bins on make install, leave for find-debug.sh

* Tue Jun 27 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-1
- Update to 0.1.9.2

* Tue Jun 20 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.1-3
- Add Requires: logrotate
- Ugh, conmand exits cleanly if no CONSOLE(s) are defined in
  /etc/conman.conf, add check to initscript to report failure
  if none are defined

* Wed Jun 14 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.1-2
- Create log directories and install working logrotate config
- Use a much cleaner RH/FC-specific initscript

* Tue Jun 13 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.1-1
- Initial build for Fedora Extras