Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 98efc922fbe800f49cd6ea4610acf50e > files > 7

diald-1.0-5mdk.src.rpm

%define name diald
%define version 1.0
%define release 5mdk

Summary: Daemon that provides on demand IP links via SLIP or PPP.
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Url: http://diald.sourceforge.net
Group: Networking/Other
Source0: %{name}-%{version}.tar.bz2
Source1: diald.init
Source2: diald.conf
Source3: diald.filter
#Patch0: diald-Makefile.patch.bz2
#Patch1: diald-route.patch.bz2
#Patch2: diald-ppp.patch.bz2
Patch3: diald-c-files.patch.bz2
Patch4: diald-1.0.patch.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Requires: ppp
PreReq: rpm-helper

%description
Diald is a daemon that provides on demand IP links via SLIP or PPP. The
purpose of diald is to make it transparently appear that you have a
permanent connection to a remote site. Diald sets up a "proxy" device which
stands in for the physical connection to a remote site. It then monitors the
proxy, waiting for packets to arrive. When interesting packets arrive it
will attempt to establish the physical link to the remote site using either
SLIP or PPP, and if it succeeds it will forward traffic from the proxy to
the physical link. As well, diald will monitor traffic once the physical
link is up, and when it has determined that the link is idle, the remote
connection is terminated. The criteria for bringing the link up and taking
it down are configurable at run time, and are based upon the type of traffic
passing over the link.

Note that even if you use ppp for your connections, you still need slip 
compiled, either into the kernel or as a module.

%prep
%setup -q
#%patch0 -p0
#%patch1
#%patch2
%patch3 -p0
%patch4 -p0 -b .mdk

%build
export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
%configure --prefix=/usr --sysconfdir=/etc \
        --localstatedir=/var --mandir=%{_mandir}

%make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/{pam.d,diald}
mkdir -p $RPM_BUILD_ROOT/{%{_bindir},%{_sbindir},%{_mandir},%{_var}/cache/diald,%{_libdir}/diald/}
mkdir -p $RPM_BUILD_ROOT%{_initrddir}/

%makeinstall DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} libdir=%{_libdir}/diald  ROOTUID=`id -un` ROOTGRP=`id -gn` BINGRP=`id -gn` sysconfdir=%{_sysconfdir} bindir=%{_bindir} sbindir=%{_sbindir}

install -m 755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/diald
install -m 644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/diald
install -m 644 %SOURCE3 $RPM_BUILD_ROOT%{_sysconfdir}/diald
mknod -m 0660 $RPM_BUILD_ROOT/var/cache/diald/diald.ctl p

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if [ $1 = "1" ]; then # first installation
# for diald config
grep -q '^alias tap0' /etc/modules.conf  || {
		echo "alias tap0 ethertap" >> /etc/modules.conf
		echo "options tap0 -o tap0 unit=0" >> /etc/modules.conf
}
fi

%post
%_post_service diald

%preun
%_preun_service diald

%postun
if [ $1 = "0" ]; then # full removal
# diald unload modules
perl -ni -e 'print unless ( m!^.*tap0.*$! || /^\s*$/)' /etc/modules.conf
fi


%files
%defattr (-,root,root)
%doc BUGS CHANGES LICENSE NOTES README*
%doc THANKS TODO TODO.budget doc/diald-faq.txt setup contrib
%config(noreplace) %{_initrddir}/
%config(noreplace) %{_sysconfdir}/pam.d/*
%dir %{_sysconfdir}/diald
%config(noreplace) %{_sysconfdir}/diald/*
%{_bindir}/*
%dir %{_libdir}/diald
%{_libdir}/diald/*
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%{_sbindir}/*
%dir %{_var}/cache/diald
%attr(660,root,root) %{_var}/cache/diald/diald.ctl

%changelog
* Wed Feb 25 2004 Lenny Cartier <lenny@mandrakesoft.com> 1.0-5mdk
- rebuild

* Thu Jul 24 2003 Per Øyvind Karlsen <peroyvind@sintrax.net> 1.0-4mdk
- rebuild
- rm -rf $RPM_BUILD_ROOT in %%install, not %%prep
- prereq on rpm-helper

* Fri Jan 17 2003 Lenny Cartier <lenny@mandrakesoft.com> 1.0-3mdk
- rebuild

* Fri Jan 25 2002 Lenny Cartier <lenny@mandrakesoft.com> 1.0-2mdk
- bzip2 patch & remove unused ones
- fix post message that gaves warning
- fix directory permission

* Wed Oct 03 2001 Philippe Libat <philippe@mandrakesoft.com> 1.0-1mdk
- new version
- add contrib, setup
- add config file
- fix ethertap modules

* Mon Jul 02 2001 Lenny Cartier <lenny@mandrakesoft.com> 0.99.4-3mdk
- rebuild
- url

* Wed Mar 28 2001 Florin Grad <florin@mandrakesoft.com> 0.99.4-2mdk 
- add the pam file

* Wed Mar 28 2001 Florin Grad <florin@mandrakesoft.com> 0.99.4-1mdk 
- 0.99.4-1mdk
- update the Makefile patch and add the -p0 option
- comment out patch 1 and 2

* Tue Jan 09 2001  Lenny Cartier <lenny@mandrakesoft.com> 0.99.1-5mdk 
- rebuild

* Thu Aug 31 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 0.99.1-4mdk
- rebuild to fix the init script.
- add a line to description reminding people to have slip in their kernel.
- fix automated build.

* Tue Aug 29 2000 Lenny Cartier <lenny@mandrakesoft.com> 0.99.1-3mdk
- BM

* Wed Apr 26 2000 Lenny Cartier <lenny@mandrakesoft.com> 0.99.1-2mdk
- fix group
- fix files section

* Thu Feb 10 2000 Lenny Cartier <lenny@mandrakesoft.com> 0.99.1-1mdk
- mandrake build
- modified Makefile-patch file for proper owner during install