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