2 # _without_x509 - without x509 support
3 # _without_dist_kernel - without distribution kernel
6 %define x509ver x509-1.2.1
7 Summary: Free IPSEC implemetation
8 Summary(pl): Publicznie dostêpna implementacja IPSEC
13 Group: Networking/Daemons
14 Source0: ftp://ftp.xs4all.nl/pub/crypto/%{name}/development/%{name}-%{version}-%{_rc}.tar.gz
15 Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-pl-man-pages.tar.bz2
16 Source2: http://www.strongsec.com/%{name}/%{x509ver}-%{name}-%{version}-%{_rc}.tar.gz
17 Patch0: %{name}-showhostkey.patch
18 Patch1: %{name}-init.patch
19 Patch2: %{name}-des.patch
20 URL: http://www.freeswan.org/
21 BuildRequires: gmp-devel
22 Prereq: /sbin/chkconfig
25 %{!?_without_dist_kernel:Requires: kernel(freeswan) >= %{version}-%{_rc}}
26 BuildRoot: %{tmpdir}/%{name}-%{version}-%{_rc}-root-%(id -u -n)
29 %{?_without_x509:%define x509 0}
32 The basic idea of IPSEC is to provide security functions
33 (authentication and encryption) at the IP (Internet Protocol) level.
34 It will be required in IP version 6 (better known as IPng, the next
35 generation) and is optional for the current IP, version 4.
37 FreeS/WAN is a freely-distributable implementation of IPSEC protocol.
38 FreeS/WAN utilities%{?!_without_x509: compiled with X.509 certificate support}.
41 Podstawowa idea IPSEC to zapewnienie funkcji bezpieczeñstwa
42 (autentykacji i szyfrowania) na poziomie IP. Bêdzie wymagany do IP w
43 wersji 6 (znanego tak¿e jako IPng, IP nastêpnej generacji) i jest
44 opcjonalny dla aktualnego IP, w wersji 4.
46 FreeS/WAN jest darmow± implementacj± protoko³u IPSEC.
49 %setup -q -a2 -n %{name}-%{version}-%{_rc}
54 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}-%{_rc}/freeswan.diff}
55 #%{?!_without_x509:%patch5 -p1 }
61 USERCOMPILE="%{rpmcflags}" ; export USERCOMPILE
62 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
65 FINALCONFDIR=%{_sysconfdir}/ipsec \
67 INC_MANDIR=share/man \
68 FINALRCDIR=%{_sysconfdir}/rc.d/init.d \
69 FINALLIBEXECDIR=${_libdir}/ipsec
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ipsec,/etc/rc.d/init.d,/var/run/pluto}
76 DESTDIR="$RPM_BUILD_ROOT" \
78 INC_MANDIR=share/man \
79 FINALCONFDIR=%{_sysconfdir}/ipsec \
80 FINALRCDIR=%{_sysconfdir}/rc.d/init.d \
81 FINALLIBEXECDIR=%{_libdir}/ipsec \
82 FINALEXAMPLECONFDIR=/usr/share/doc/%{name}-%{version}
85 install -d $RPM_BUILD_ROOT%{_sysconfdir}/ipsec/ipsec.d
86 for i in crls cacerts private policies; do
87 install -d $RPM_BUILD_ROOT%{_sysconfdir}/ipsec/ipsec.d/$i
89 for i in CHANGES README; do
90 install %{x509ver}-%{name}-%{version}-%{_rc}/$i $i.x509 ;
94 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
97 # generate RSA private key... if, and only if, /etc/ipsec/ipsec.secrets does
99 if [ ! -f %{_sysconfdir}/ipsec/ipsec.secrets ];
101 echo generate RSA private key...
102 /usr/sbin/ipsec newhostkey --output %{_sysconfdir}/ipsec/ipsec.secrets
103 chmod 600 %{_sysconfdir}/ipsec/ipsec.secrets
106 /sbin/chkconfig --add ipsec
107 if [ -f /var/lock/subsys/ipsec ]; then
108 /etc/rc.d/init.d/ipsec restart >&2
110 echo "Run '/etc/rc.d/init.d/ipsec start' to start IPSEC services." >&2
114 if [ "$1" = "0" ]; then
115 if [ -f /var/lock/subsys/ipsec ]; then
116 /etc/rc.d/init.d/ipsec stop >&2
118 /sbin/chkconfig --del ipsec >&2
122 rm -rf $RPM_BUILD_ROOT
125 %defattr(644,root,root,755)
126 %doc README CREDITS CHANGES BUGS
127 %doc doc/{kernel.notes,impl.notes,examples,prob.report,standards} doc/*.html
128 %{?!_without_x509:%doc CHANGES.x509 README.x509}
130 %lang(pl) %{_mandir}/pl/man*/*
131 %attr(755,root,root) %{_sbindir}/*
132 %attr(754,root,root) /etc/rc.d/init.d/*
133 %dir %{_libdir}/ipsec
134 %attr(755,root,root) %{_libdir}/ipsec/*
135 %attr(751,root,root) %dir %{_sysconfdir}/ipsec
136 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ipsec/ipsec.conf
138 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d
139 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/crls
140 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/cacerts
141 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/private
142 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/policies
143 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ipsec/ipsec.d/policies/*