Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > d0302ff307e7fe7152343c2db22ce25d > files > 8

mserver-0.5.5-1mdk.src.rpm

%define version 0.5.5
%define rel 1mdk

Summary: 	C-Mserver Masqdialer daemon.
Name: 		mserver
Version: 	%version
Release: 	%rel
License: 	GPL
Group: 		Networking/Other
URL: 		http://w3.cpwright.com/mserver
Source: 	ftp://ftp.cpwright.com:/pub/mserver/c-mserver-%{version}.tar.bz2
Provides:	c-mserver
Obsoletes: 	c-mserver
Prereq: 	chkconfig sed grep
BuildRoot: 	%{_tmppath}/%{name}-%{version}
Source1:	mserver.pamd
Source2:	mserver.conf.bz2
Source3:	mserver.init
Patch0: 	c-mserver-%{version}-makefile.patch.bz2
Patch1: 	mserver-0.5.5-config.patch.bz2
Patch2: 	mserver-0.5.5-dial.patch.bz2

%description
The masqdialer system will allow authorized LAN users to manipulate
the network interface (usually a modem) that gives the Internet
access on a Linux box without having to use telnet. It's based on
a client/server approach so any TCP/IP enabled system should be able
to take advantage of this server, if a client is written for it.
Currently; Linux, Windows, NetBSD, and any system with a Java
implementation or Web Browser have clients.

Note: Please make changes to /etc/mserver.conf.

%prep
%setup -q
%patch0 -p1
%patch1
%patch2

%build
#First clean up CVS files for rpmlint:
find . -name CVS -type d -exec rm -Rf {} \;|| true
find . -name .cvsignore -type f -exec rm -f {} \;|| true

./configure
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/etc/ppp
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/{man5,man8}
#mkdir -p $RPM_BUILD_ROOT/usr/doc/c-mserver-%{version}/{images,ipchainscripts,ipfwadmscripts,isdn,pppsetup,sampleconf,authgen}
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
mkdir -p $RPM_BUILD_ROOT/usr/share/mserver
install -m 755 -s mserver/mserver $RPM_BUILD_ROOT%{_sbindir}/mserver
install -m 755 -s mchat/mchat $RPM_BUILD_ROOT%{_sbindir}/mchat
install -m 755 -s authgen/authgen $RPM_BUILD_ROOT%{_sbindir}/authgen
install -m 755 -s checkstat/findstat $RPM_BUILD_ROOT%{_sbindir}/findstat
install -m 755 -s checkstat/checkstat $RPM_BUILD_ROOT%{_sbindir}/checkstat
install -m 755 -s fakelink/linkcheck $RPM_BUILD_ROOT%{_sbindir}/fakelink
install -m 755 -s fakelink/linkdown $RPM_BUILD_ROOT%{_sbindir}/linkdown
install -m 755 -s fakelink/linkup $RPM_BUILD_ROOT%{_sbindir}/linkup
install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/mserver
install -m 664 pam/mserver $RPM_BUILD_ROOT/etc/pam.d/mserver
install -m 644 pppsetup/options.sample $RPM_BUILD_ROOT/etc/ppp/options.sample
#install -m 755 sampleconf/rc.firewall $RPM_BUILD_ROOT/etc/rc.d/
install -m 755 pppsetup/ppp-off $RPM_BUILD_ROOT%{_sbindir}
install -m 755 pppsetup/pppsetup $RPM_BUILD_ROOT%{_sbindir}

bzcat %{SOURCE2}|sed -e 's/_VERSION_/%{version}/'> $RPM_BUILD_ROOT/etc/mserver.conf
install -m 644 mchat/mchat.8 $RPM_BUILD_ROOT/%{_mandir}/man8/mchat.8
install -m 644 docs/mserver.8 $RPM_BUILD_ROOT/%{_mandir}/man8/mserver.8
install -m 644 docs/mserver.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/mserver.conf.5

%clean
rm -rf $RPM_BUILD_ROOT

%post
%_post_service mserver

# Add masqdialer entry to /etc/services if not already there
if ! ( grep ^[:space:]*224/tcp /etc/services > /dev/null ) then
       echo 'masqdialer      224/tcp	         masqdialer	# added by c-mserver' >> /etc/services
fi
if ! ( grep ^[:space:]*224/udp /etc/services > /dev/null ) then
       echo 'masqdialer      224/udp	         masqdialer	# added by c-mserver' >> /etc/services
fi

%preun
%_preun_service mserver

%postun
# Remove masqdialer entries from /etc/services
    cd /etc
    tmpfile=/etc/tmp.$$
    sed -e '/^[:space:]*masqdialer.*$/d' /etc/services > $tmpfile
    mv $tmpfile services
    sed -e '/^[:space:]*masqdialer.*$/d' /etc/services > $tmpfile
    mv $tmpfile services
fi

%files
%defattr(-,root,root)
%attr(-,root,root) /etc/pam.d/mserver
%attr(-,root,root) /etc/rc.d/init.d/mserver
%attr(0644,root,root) /etc/ppp/options.sample
%attr(-,root,root) %{_sbindir}/mserver
%attr(-,root,root) %{_sbindir}/mchat
%attr(-,root,root) %{_sbindir}/authgen
%attr(-,root,root) %{_sbindir}/findstat
%attr(-,root,root) %{_sbindir}/checkstat
%attr(-,root,root) %{_sbindir}/fakelink
%attr(-,root,root) %{_sbindir}/linkdown
%attr(-,root,root) %{_sbindir}/linkup
%attr(0644,root,root) %{_mandir}/man5/mserver.conf.5*
%attr(0644,root,root) %{_mandir}/man8/mchat.8*
%attr(0644,root,root) %{_mandir}/man8/mserver.8*
%attr(-,root,root) %{_sbindir}/ppp-off
%attr(-,root,root) %{_sbindir}/pppsetup
%doc ChangeLog AUTHORS COPYING README
%doc docs/clients.html docs/doc.html docs/index.html
%doc docs/images sampleconf pppsetup firewallscripts/ipchainscripts

%attr(0644,root,root) %config(noreplace) /etc/mserver.conf

%changelog
* Mon Aug 19 2002 Buchan Milne <bgmilne@cae.co.za> 0.5.5-1mdk
- Change package name to mserver (with provides/obsoletes just in case)
- Better default mserver.conf
- Many cleanups
- Fix init script
- Cooker time!

* Mon Apr 29 2002 Buchan Milne <bgmilne@cae.co.za> 0.5.5-0.2mdk
- Fix docs, bzip2 man pages, remove stupid defintions
- add defattr

* Wed Mar 13 2002 Buchan Milne <bgmilne@cae.co.za> 0.5.5-0.1mdk
- First Mandrake-ish release

* Tue Nov 9 1999 Willi Eigenmann <weigenmann@yahoo.com>
 - Release c-mserver-0.5.5-4.i386.rpm.
 - Paul Howarth submitted patches (Thank you very much Paul).
   His patches are based on release 2. Release 3 only had one minor change.
 - Changes to spec file to incorporate the change in release 3.
 - Cosmetic changes to spec file.

* Tue Nov 2 1999 Paul Howarth <paul@city-fan.org> c-mserver-0.5.5-2
 - Patched config.c to prevent insertion of null parameters into the parameter database
   when reading blank or comment-only lines in the configuration file.
 - Patched dial.c to get the linkup script working; the snprintf call used to
   build the command was overwriting the script name.
 - Cosmetic changes to spec file.

* Mon Sep 13 1999 Willi Eigenmann <weigenmann@yahoo.com>
 - Release c-mserver-0.5.5-3.i386.rpm
 - Change spec file not to replace /etc/rc.d/rc.firewall without a backup
   Thanks to Alan Sobey for letting me know.
 - c-mserver-0.5.5-2.i386.rpm was never released by me.

* Sat Aug 7 1999 Willi Eigenmann <weigenmann@yahoo.com>
 - Work on c-mserver-0.5.5-2.i386.rpm
 - Modified my sample in /usr/doc/c-mserver-0.0.5/sampleconf/mserver.conf.
 - Corrected some minor mistakes in the spec file.

* Fri Jul 30 1999 Willi Eigenmann <weigenmann@yahoo.com>
 - Begin work on c-mserver-0.5.5-1.i386.rpm (missed out on v0.5.3 and v0.5.4).
 - c-mserver-0.5.2-2.i386.rpm was never released by me. 
 - Implemented changes outlined in ChangeLog.
 - Changed URL in /usr/doc/c-mserver-0.5.5/README to reflect current address (Charles please change)
 - Corrected some minor mistakes in the spec file.

* Wed Jul 7 1999 Willi Eigenmann <weigenmann@yahoo.com>
 - Finalised c-mserver-0.5.2-2.i386.rpm
 - Added entry to /etc/services when c-mserver is installed. 

* Sat Jul 3 1999 Willi Eigenmann <weigenmann@yahoo.com>
 - Added %changelog section to this spec file.
 - Made some cosmetic changes to c-mserver-0.5.2.spec file.
 - Use compound mkdir -p line instead of individual calls to mkdir.
 - Changed URL in /usr/doc/c-mserver-0.5.2/README to reflect current address
 - Changed *configure ac_default_prefix=/usr/local to ac_default_prefix=/usr/sbin
 - Added pppsetup V2.16.
 - Cleaned out /usr/doc/c-mserver-0.5.2 directory.