Summary: NetWare file and print servers which run on Linux systems.
Name: mars-nwe
Version: 0.99pl20
Release: 6vl1
License: GPL
Source:  ftp://ftp.gwdg.de/pub/linux/misc/ncpfs/mars_nwe-0.99.pl19.tgz
Source1: mars_nwe-mk.li
Source2: mars_nwe-config.h
Source4: mars_nwe-readme.txt
Source5: mars_nwe.init
Source6: mars_nwe.log
Patch1: mars_nwe-glibc21.patch
Patch2: mars_nwe-0.99.pl19-buffer.patch
Patch3: mars_nwe-rh.patch
Patch4: mars_nwe-format.patch
Group: System Environment/Daemons
Prereq: /sbin/chkconfig, /sbin/service
BuildPrereq: gdbm-devel
Requires: ipxutils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
ExcludeArch: s390 s390x

%description
The mars_nwe (MARtin Stover's NetWare Emulator) package enables Linux
to provide both file and print services for NetWare clients (i.e.,
providing the services of a Novell NetWare file server).  Mars_nwe
allows the sharing of files between Linux machines and Novell NetWare
clients, using NetWare's native IPX protocol suite.

Install the mars_nwe package if you need a Novell NetWare file server
on your Red Hat Linux system.

%prep
%setup -q -n mars_nwe
%patch1 -p1 -b .glibc21
%patch2 -p1 -b .buffer
%patch3 -p1 -b .rh
%patch4 -p1 -b .format
cp -f $RPM_SOURCE_DIR/mars_nwe-config.h ./config.h
cp -f $RPM_SOURCE_DIR/mars_nwe-mk.li ./mk.li

%build
chmod 755 mk.li
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE_ -DUSE_GDBM"

%install
rm -rf $RPM_BUILD_ROOT
for I in sys/login sys/public sys/system bindery; do \
	mkdir -p --mode=0755 $RPM_BUILD_ROOT/var/mars_nwe/$I
done

mkdir -p $RPM_BUILD_ROOT/var/log $RPM_BUILD_ROOT/var/run
install -m644 $RPM_SOURCE_DIR/mars_nwe-readme.txt $RPM_BUILD_ROOT/var/mars_nwe/sys/readme.txt
:> $RPM_BUILD_ROOT/var/log/mars_nwe.log
chmod 0644 $RPM_BUILD_ROOT/var/log/mars_nwe.log
:> $RPM_BUILD_ROOT/var/run/mars_nwe.routes
chmod 0644 $RPM_BUILD_ROOT/var/run/mars_nwe.routes

mkdir -p $RPM_BUILD_ROOT/etc $RPM_BUILD_ROOT/usr/sbin
install -m644 examples/nwserv.stations $RPM_BUILD_ROOT/etc/nwserv.stations
for I in nwserv nwconn ncpserv nwclient nwbind; do
	install -s -m 755 $I $RPM_BUILD_ROOT/usr/sbin/$I
done
install -m600 examples/nw.ini $RPM_BUILD_ROOT/etc/nwserv.conf

mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d $RPM_BUILD_ROOT/etc/logrotate.d
install -m755 $RPM_SOURCE_DIR/mars_nwe.init $RPM_BUILD_ROOT/etc/rc.d/init.d/mars-nwe
install -m644 $RPM_SOURCE_DIR/mars_nwe.log $RPM_BUILD_ROOT/etc/logrotate.d/mars-nwe.log

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add mars-nwe

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

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

%files
%defattr(-,root,root)
%dir /var/mars_nwe
/var/mars_nwe/sys
%dir /var/mars_nwe/bindery
%ghost /var/log/mars_nwe.log
%ghost /var/run/mars_nwe.routes
%config(noreplace) /etc/nwserv.conf
%config(noreplace) /etc/nwserv.stations
%config /etc/logrotate.d/mars-nwe.log
%doc README COPYING doc examples
/usr/sbin/nwserv
/usr/sbin/nwconn
/usr/sbin/ncpserv
/usr/sbin/nwclient
/usr/sbin/nwbind
%config /etc/rc.d/init.d/mars-nwe

%changelog
* Sat Aug 18 2001 <sagami@vinelinux.org>
- 0.99pl20-6vl1: was ported to Vine

* Mon Jul 16 2001 Philipp Knirsch <pknirsch@redhat.de>
- Fixed missing BuildPrerequ for gdbm-devel (#44864)

* Tue Jun 19 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- add ExcludeArch: s390 s390x

* Tue Mar 13 2001 Bill Nottingham <notting@redhat.com>
- fix usage translation message in init script

* Tue Feb 27 2001 Bill Nottingham <notting@redhat.com>
- fix subsys in init script

* Thu Feb  1 2001 Trond Eivind Glomsrød <teg@redhat.com>
- don't use gprintf

* Fri Jan 19 2001 Bill Nottingham <notting@redhat.com>
- fix format string error (#17911)
- i18n-ize initscript
- update to 0.99.pl20

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

* Mon Jul 23 2000 Nalin Dahyabhai <nalin@redhat.com>
- fix %%post and %%postun scripts

* Sun Jul 23 2000 Trond Eivind Glomsrød <teg@redhat.com>
- source files from /etc/rc.d/init.d
- don't prereq /etc/init.d anymore
- rename "rh-status"

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

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

* Tue Jun 27 2000 Preston Brown <pbrown@redhat.com> 
- don't prereq, only require initscripts

* Mon Jun 26 2000 Bill Nottingham <notting@redhat.com>
- initscript munging

* Sat Jun 17 2000 Matt Wilson <msw@redhat.com>
- added defattr

* Wed Jun 14 2000 Nalin Dahyabhai <nalin@redhat.com>
- tweak logrotate configuration file to use the PID file in /var/run

* Sat Jun 10 2000 Bill Nottingham <notting@redhat.com>
- update to pl19

* Tue Apr 18 2000 Bill Nottingham <notting@redhat.com>
- build on alpha again
- require ipxutils
- futz with default config some (use included sample)

* Thu Feb 24 2000 Bill Nottingham <notting@redhat.com>
- don't build on alpha for now

* Tue Dec 22 1999 Bill Nottingham <notting@redhat.com>
- fix buffer overflow patch oops

* Mon Oct 18 1999 Bill Nottingham <notting@redhat.com>
- fix typo in buffer overflow patch
- fix path to killall in logrotate file

* Fri Sep  3 1999 Bill Nottingham <notting@redhat.com>
- add patch to fix some buffer overflows.

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

* Sat Jun 12 1999 Jeff Johnson <jbj@redhat.com>
- update to 0.99.pl17

* Thu Jun 10 1999 Dale Lovelace <dale@redhat.com>
- fixed logrotate script

* Mon May 24 1999 Bill Nottingham <notting@redhat.com>
- update to 0.99.pl16

* Thu May 13 1999 Bill Nottingham <notting@redhat.com>
- actually update source to 0.99.pl15. Doh!

* Tue Mar 23 1999 Bill Nottingham <notting@redhat.com>
- logrotate fixes

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

* Tue Mar  9 1999 Bill Nottingham <notting@redhat.com>
- update to 0.99.pl15

* Tue Feb 23 1999 Bill Nottingham <notting@redhat.com>
- update to 0.99.pl14

* Tue Aug 18 1998 Cristian Gafton <gafton@redhat.com>
- buildroot

* Sun May 10 1998 Alan Cox <alan@redhat.com>
- Made it compile with 2.1.* kernels and also gcc 2.0.7 where sysv_signal
  is correctly hidden as __sysv_signal.

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

* Sat May 02 1998 Cristian Gafton <gafton@redhat.com>
- upgraded to 0.99pl6
- enhanced initscripts

* Tue Jan 13 1998 Erik Troan <ewt@redhat.com>
- use sysv_signal everywhere instead of normal signal -- this makes signal
  handlers not block signals, which mars_nwe expects
- changed _ to - in name of logrotate config file

* Sun Oct 19 1997 Erik Troan <ewt@redhat.com>
- updated for chkconfig
- doesn't start by default
- added status, restart options to init script

* Fri Aug 22 1997 Erik Troan <ewt@redhat.com>
- built against glibc
