Summary: A BBS, menu system, file viewer, and text editor.
Name: mconv
Version: 1.2.7
Release: 2
Copyright: GPL
Group: Applications/Communications
Source: ftp://ftp.ibiblio.org/pub/Linux/system/bbs/mconv-1.2.7.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-root
Autoreq: 0
Requires: libc.so.6, libcrypt.so.1, libtermcap.so.2

%description
A fully functional Internet BBS.  Telnet-based, its features
include single-keypress menu-driven operation, full colour
operation with easy to use encoding system, user to user
messaging facility, and in-BBS account handling tools. 
Outside the BBS itself there are conversion utilities to
enable output to email or web pages or input from "screen"
scrollback buffers, a special in-BBS text editor, and a
standalone file viewer with simple forward and backward search
and automatic rescanning.

As well as using it as a BBS, `mconv' can be used as a simple
overlay on the Unix filesystem, providing an easy way to
organise and view text files and system logs.

%prep
%setup

%build
CFLAGS="$RPM_OPT_FLAGS" sh ./configure \
  --prefix=/usr \
  --infodir=/usr/share/info \
  --mandir=/usr/share/man \
  --sysconfdir=/etc \
  --with-group=bbs
make

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
[ -e "$RPM_BUILD_ROOT" ] || mkdir -m 755 "$RPM_BUILD_ROOT"
[ -e "$RPM_BUILD_ROOT/etc" ] || mkdir -m 755 "$RPM_BUILD_ROOT/etc"
[ -e "$RPM_BUILD_ROOT/usr" ] || mkdir -m 755 "$RPM_BUILD_ROOT/usr"
[ -e "$RPM_BUILD_ROOT/usr/bin" ] || mkdir -m 755 "$RPM_BUILD_ROOT/usr/bin"
[ -e "$RPM_BUILD_ROOT/usr/share" ] || mkdir -m 755 "$RPM_BUILD_ROOT/usr/share"
[ -e "$RPM_BUILD_ROOT/usr/share/man" ] || mkdir -m 755 "$RPM_BUILD_ROOT/usr/share/man"
[ -e "$RPM_BUILD_ROOT/usr/share/man/man1" ] || mkdir -m 755 "$RPM_BUILD_ROOT/usr/share/man/man1"
[ -e "$RPM_BUILD_ROOT/usr/share/info" ] || mkdir -m 755 "$RPM_BUILD_ROOT/usr/share/info"
make install
make install-bbs

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"

%pre
groupadd bbs || true

%post
[ -x /sbin/install-info ] \
&& [ -e /usr/share/info/dir ] \
&& /sbin/install-info /usr/share/info/mconv.info.gz /usr/share/info/dir

%preun
[ -x /sbin/install-info ] \
&& [ -e /usr/share/info/dir ] \
&& /sbin/install-info --delete /usr/share/info/mconv.info.gz \
                               /usr/share/info/dir

%postun
#groupdel bbs || true

%files
%defattr(-, root, root)
%doc README doc/AUTHORS doc/NEWS doc/TODO doc/COPYING
%attr(2755, root, bbs) /usr/bin/mbbs
%attr(2755, root, bbs) /usr/bin/mgid
/usr/bin/mconv
/usr/bin/mte
/usr/bin/mtime
/usr/bin/mtrunc
/usr/bin/mview
%docdir /usr/share/man/man1
%docdir /usr/share/info
/usr/share/man/man1/*
/usr/share/info/*
%defattr(640, root, bbs)
%config(noreplace) /etc/bbsrc
%config(noreplace) /usr/share/mconv/sys/list/admin
%config(noreplace) /usr/share/mconv/sys/paths
%config(noreplace) /usr/share/mconv/sys/xwarn.ro
/usr/share/mconv/sys/log/index.mn
/usr/share/mconv/sys/options.mn
/usr/share/mconv/sys/escape.mn
%config(noreplace) /usr/share/mconv/index.mn
%config(noreplace) /usr/share/mconv/motd.cm
/usr/share/mconv/help/help.mn
/usr/share/mconv/help/*.ro
%defattr(750, root, bbs)
%dir /usr/share/mconv
%dir /usr/share/mconv/sys
%dir /usr/share/mconv/sys/log
%dir /usr/share/mconv/sys/list
%dir /usr/share/mconv/listdirs
%dir /usr/share/mconv/help
%defattr(770, root, bbs)
%dir /usr/share/mconv/sys/udb
%dir /usr/share/mconv/sys/ldb
%dir /usr/share/mconv/sys/u2u
%dir /usr/share/mconv/sys/status
%dir /usr/share/mconv/sys/friends
%defattr(660, root, bbs)
%config /usr/share/mconv/sys/log/add.log
%config /usr/share/mconv/sys/log/del.log
%config /usr/share/mconv/sys/log/edit.log
%config /usr/share/mconv/sys/log/mail.log
%config /usr/share/mconv/sys/log/run.log
%config /usr/share/mconv/sys/log/client.log
%config /usr/share/mconv/sys/log/u2u.log
/usr/share/mconv/sys/udb/guest
/usr/share/mconv/sys/ldb/guest
/usr/share/mconv/sys/friends/guest

%changelog
* Wed Jan 30 2002 Andrew Wood <mconv@ivarch.com>
- changed /usr/share/mconv/help/ to *.ro instead of specifying manually
- set *.log to be %config so they don't get overwritten on upgrade

* Wed Nov 14 2001 Andrew Wood <mconv@ivarch.com>
- added help files
- added Autoreq and Requires fields

* Sat Nov 10 2001 Andrew Wood <mconv@ivarch.com>
- altered .spec file to not remove "bbs" group on uninstall
- fixed permissions on .spec file for /usr/share/mconv/*
- made the main index.mn a "config" file so it is preserved on upgrade
- ditto for the MOTD, the X-rating warning, and paths list
- added %docdir directives for /usr/share/{info,man} just in case

* Tue Nov  6 2001 Andrew Wood <mconv@ivarch.com>
- initial .spec file created
