File ipsec-tools.spec of Package ipsec-tools
#
# spec file for package ipsec-tools (Version 0.7.3)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: ipsec-tools
Summary: IPsec Utilities
Version: 0.7.3
Release: 2
License: BSD 3-clause (or similar)
Group: Productivity/Networking/Security
AutoReqProv: on
Url: http://ipsec-tools.sourceforge.net/
Source: http://prdownloads.sourceforge.net/ipsec-tools/ipsec-tools-%{version}.tar.bz2
Source1: racoon.init
Source2: sysconfig.racoon
Source3: setkey.conf.sample
Source4: racoon.pam
Patch0: no_werror.patch
Patch3: racoon.conf_macros.patch
Prefix: /usr
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq %fillup_prereq
BuildRequires: bison flex kernel-source krb5-devel openldap2-devel
BuildRequires: openssl-devel pam pam-devel readline-devel
%if 0%{?suse_version} >= 1100
BuildRequires: fdupes libselinux-devel
%endif
Provides: racoon
%description
This is the IPsec-Tools package. This package is needed to really make
use of the IPsec functionality in the version 2.5 and 2.6 Linux
kernels. This package builds:
- libipsec, a PFKeyV2 library
- setkey, a program to directly manipulate policies and SAs
- racoon, an IKEv1 keying daemon
These sources can be found at the IPsec-Tools home page at:
http://ipsec-tools.sourceforge.net/
Authors:
--------
Derek Atkins <derek@ihtfp.com>
Michal Ludvig <michal@logix.cz>
Emmanuel Dreyfus <manu@netbsd.org>
Yvan Vanhullebus <vanhu@free.fr>
%prep
%setup -q
%patch0 -p1
%patch3 -p1
%build
%{suse_update_config -f . src/racoon}
export PATH=$PATH:/usr/lib/mit/bin
CFLAGS="$RPM_OPT_FLAGS" \
%configure \
--disable-shared \
--libexecdir=%{_libdir} \
--sysconfdir=/etc/racoon \
--sharedstatedir=/var/run \
--localstatedir=/var/run \
--enable-dpd \
--enable-hybrid \
--enable-frag \
--enable-natt=yes \
--enable-gssapi=yes \
--enable-stats=yes \
--enable-adminport \
--with-libpam \
%if 0%{?suse_version} >= 1100
--enable-security-context=yes \
%else
--enable-security-context=no \
%endif
--with-libldap
make
%check
make check
%install
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT/usr/include/racoon/admin.h \
$RPM_BUILD_ROOT/usr/include/racoon/evt.h \
$RPM_BUILD_ROOT/usr/include/racoon/gcmalloc.h \
$RPM_BUILD_ROOT/usr/include/racoon/ipsec_doi.h \
$RPM_BUILD_ROOT/usr/include/racoon/isakmp.h \
$RPM_BUILD_ROOT/usr/include/racoon/isakmp_cfg.h \
$RPM_BUILD_ROOT/usr/include/racoon/isakmp_unity.h \
$RPM_BUILD_ROOT/usr/include/racoon/isakmp_var.h \
$RPM_BUILD_ROOT/usr/include/racoon/isakmp_xauth.h \
$RPM_BUILD_ROOT/usr/include/racoon/misc.h \
$RPM_BUILD_ROOT/usr/include/racoon/racoonctl.h \
$RPM_BUILD_ROOT/usr/include/racoon/schedule.h \
$RPM_BUILD_ROOT/usr/include/racoon/sockmisc.h \
$RPM_BUILD_ROOT/usr/include/racoon/var.h \
$RPM_BUILD_ROOT/usr/include/racoon/vmbuf.h \
$RPM_BUILD_ROOT/usr/%{_lib}/libracoon.a \
$RPM_BUILD_ROOT/usr/%{_lib}/libracoon.la
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m 0755 $RPM_SOURCE_DIR/racoon.init $RPM_BUILD_ROOT/etc/init.d/racoon
ln -sf /etc/init.d/racoon $RPM_BUILD_ROOT/usr/sbin/rcracoon
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
install -m 0644 %{S:4} $RPM_BUILD_ROOT/etc/pam.d/racoon
%{__install} -d $RPM_BUILD_ROOT/etc/racoon/cert
install -m 0600 src/racoon/samples/psk.txt $RPM_BUILD_ROOT/etc/racoon/
install -m 0644 src/racoon/samples/racoon.conf $RPM_BUILD_ROOT/etc/racoon/
cp -v $RPM_SOURCE_DIR/setkey.conf.sample $RPM_BUILD_ROOT/etc/racoon/setkey.conf
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 $RPM_SOURCE_DIR/sysconfig.racoon $RPM_BUILD_ROOT/var/adm/fillup-templates/
touch $RPM_BUILD_ROOT/var/run/racoon/racoon.sock
# manage doc
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/examples/{setkey,racoon}
cp -rv src/racoon/samples $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/examples/racoon
cp -v src/setkey/sample* $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/examples/setkey
for i in ChangeLog NEWS README; do
install -D -m 0644 $i $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/
done
#some rpmlint stuff
%if 0%{?suse_version} >= 1100
%fdupes -s $RPM_BUILD_ROOT/
%endif
%post
%{fillup_and_insserv racoon}
%preun
%stop_on_removal racoon
%postun
%{insserv_cleanup}
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc /usr/share/doc/packages/%{name}/
%config(noreplace) /etc/racoon/psk.txt
%config(noreplace) /etc/racoon/racoon.conf
%config(noreplace) /etc/racoon/setkey.conf
%config /etc/init.d/racoon
%config /etc/pam.d/racoon
%dir /etc/racoon
%dir /etc/racoon/cert
/usr/sbin/rcracoon
%dir /usr/include/libipsec/
/usr/include/libipsec/libpfkey.h
/usr/%{_lib}/libipsec.a
/usr/%{_lib}/libipsec.la
/usr/sbin/racoon
/usr/sbin/racoonctl
/usr/sbin/setkey
/usr/sbin/plainrsa-gen
/var/adm/fillup-templates/sysconfig.racoon
/var/run/racoon
%ghost /var/run/racoon/racoon.sock
%{_mandir}/man*/*
%changelog