]> git.pld-linux.org Git - packages/freeswan.git/blob - freeswan.spec
- add Requires: kernel(freeswan) >= %{version}-%{_rc}
[packages/freeswan.git] / freeswan.spec
1 # Conditional builds
2 # _without_x509         - without x509 support
3 # _without_dist_kernel  - without distribution kernel
4
5 %define _rc             rc2
6 %define x509ver          x509-1.2.1
7 Summary:        Free IPSEC implemetation
8 Summary(pl):    Publicznie dostêpna implementacja IPSEC
9 Name:           freeswan
10 Version:        2.00
11 Release:        0.%{_rc}.1
12 License:        GPL
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
23 Prereq:         rc-scripts
24 Requires:       gmp
25 %{!?_without_dist_kernel:Requires:      kernel(freeswan) >= %{version}-%{_rc}}
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-%{_rc}-root-%(id -u -n)
27
28 %define x509 1
29 %{?_without_x509:%define x509 0}
30
31 %description
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.
36
37 FreeS/WAN is a freely-distributable implementation of IPSEC protocol.
38 FreeS/WAN utilities%{?!_without_x509: compiled with X.509 certificate support}.
39
40 %description -l pl
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.
45
46 FreeS/WAN jest darmow± implementacj± protoko³u IPSEC.
47
48 %prep
49 %setup  -q -a2 -n %{name}-%{version}-%{_rc}
50
51 %patch0 -p1
52 %patch1 -p1
53
54 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}-%{_rc}/freeswan.diff}
55 #%{?!_without_x509:%patch5 -p1 }
56
57 %patch2 -p1
58
59 %build
60
61 USERCOMPILE="%{rpmcflags}" ; export USERCOMPILE
62 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
63 CC=%{__cc}; export CC
64 %{__make} programs \
65         FINALCONFDIR=%{_sysconfdir}/ipsec \
66         INC_USRLOCAL=/usr \
67         INC_MANDIR=share/man \
68         FINALRCDIR=%{_sysconfdir}/rc.d/init.d \
69         FINALLIBEXECDIR=${_libdir}/ipsec 
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ipsec,/etc/rc.d/init.d,/var/run/pluto}
74
75 %{__make} install \
76         DESTDIR="$RPM_BUILD_ROOT" \
77         INC_USRLOCAL=/usr \
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}
83
84 %if %{x509}
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
88 done
89 for i in CHANGES README; do
90   install  %{x509ver}-%{name}-%{version}-%{_rc}/$i $i.x509 ;    
91 done
92 %endif
93
94 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
95
96 %post
97 # generate RSA private key... if, and only if, /etc/ipsec/ipsec.secrets does
98 # not already exist
99 if [ ! -f %{_sysconfdir}/ipsec/ipsec.secrets ];
100 then
101     echo generate RSA private key...
102     /usr/sbin/ipsec newhostkey --output %{_sysconfdir}/ipsec/ipsec.secrets
103     chmod 600 %{_sysconfdir}/ipsec/ipsec.secrets
104 fi
105
106 /sbin/chkconfig --add ipsec
107 if [ -f /var/lock/subsys/ipsec ]; then
108         /etc/rc.d/init.d/ipsec restart >&2
109 else
110         echo "Run '/etc/rc.d/init.d/ipsec start' to start IPSEC services." >&2
111 fi
112
113 %preun
114 if [ "$1" = "0" ]; then
115         if [ -f /var/lock/subsys/ipsec ]; then
116                 /etc/rc.d/init.d/ipsec stop >&2
117         fi
118         /sbin/chkconfig --del ipsec >&2
119 fi
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %files
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}
129 %{_mandir}/man*/*
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
137 %if %{x509}
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/*
144 %endif
This page took 0.041147 seconds and 4 git commands to generate.