# fairly minimal RPM spec file, does only packaging
# Based on work by Paul Lahaie of Steamballoon.
# This file is touched up by sed (in the Makefile) before it is actually used.
Summary: Kernel with FreeS/WAN
Name: freeswan
Version: @IPSECVERSION@_@KERNELVERSION@
Release: 0
Copyright: GPL
Source: freeswan-%{version}.tar.gz
Group: System Environment/Daemons
BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
%define __spec_install_post /usr/lib/rpm/brp-compress || :
%define KernelVer @KERNELVERSIONORIG@
Requires: ipsec-userland ipsec-kernel

%package userland
Summary: Kernel with FreeS/WAN
Group: System Environment/Daemons
Provides: ipsec-userland
Requires: ipsec-kernel

%package module
Summary: FreeS/Wan kernel module
Group:  System Environment/Kernel
Provides: ipsec-kernel
# do not make the dependancy circular for now.
#Requires: ipsec-userland

%description userland
This package contains the daemons and userland tools for setting up
FreeS/WAN on a freeswan enabled kernel.

%description module
This package contains only the ipsec module for the RedHat series of kernels.

%description
A dummy package that installs userland and kernel pieces.

%prep

%build

%install

%clean
rm -rf ${RPM_BUILD_ROOT}

%files userland
%defattr(-,root,root)
@PUBDIR@/ipsec
@FINALBINDIR@/*
/etc/rc.d/init.d/ipsec

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

@MANTREE@/man3/ipsec_*.3*
@MANTREE@/man5/ipsec_*.5*
@MANTREE@/man5/ipsec.*.5*
@MANTREE@/man8/ipsec_*.8*

%files module
%defattr (-,root,root)
/lib/modules/%{KernelVer}/kernel/net/ipsec

%preun userland
sh /etc/rc.d/init.d/ipsec stop || exit 0

%post module
echo "do not forget to install the userland utilities"

%post userland
chkconfig --add ipsec
echo "invoke \"service ipsec start\" or reboot to begin"

%changelog
#
# $Log: rpm.in,v $
# Revision 1.9  2002/06/16 21:53:49  mcr
# 	added missing clauses to userland section.
#
# Revision 1.8  2002/06/16 20:18:41  mcr
# 	2.00 series RPM will have a "freeswan-userland" rather than
# 	a "freeswan-X" RPM. Among other things, it makes regexp easier
# 	to locate the different pieces.
#
# Revision 1.7  2002/06/11 23:10:53  mcr
# 	added dependancies from userland->kernel.
# 	cross-dependancies considered but cause too much user pain.
#
# Revision 1.6  2002/06/09 15:46:41  mcr
# 	move installed modules for make rpm to kernel versioned directory.
#
# Revision 1.5  2002/04/11 02:50:30  mcr
# 	added %post to make ipsec start, and %post to shut it down.
# 	added %changelog as well.
#
#
