]> git.pld-linux.org Git - packages/freeswan.git/blob - freeswan.spec
- added patch which fix path to des.h
[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 %{!?_without_dist_kernel:BuildRequires: kernel-headers(freeswan)}
22 BuildRequires:  gmp-devel
23 Prereq:         /sbin/chkconfig
24 Prereq:         rc-scripts
25 Requires:       gmp
26 %{!?_without_dist_kernel:Requires:      kernel(freeswan)}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-%{_rc}-root-%(id -u -n)
28
29 %define x509 1
30 %{?_without_x509:%define x509 0}
31
32 %description
33 The basic idea of IPSEC is to provide security functions
34 (authentication and encryption) at the IP (Internet Protocol) level.
35 It will be required in IP version 6 (better known as IPng, the next
36 generation) and is optional for the current IP, version 4.
37
38 FreeS/WAN is a freely-distributable implementation of IPSEC protocol.
39 FreeS/WAN utilities%{?!_without_x509: compiled with X.509 certificate support}.
40
41 %description -l pl
42 Podstawowa idea IPSEC to zapewnienie funkcji bezpieczeñstwa
43 (autentykacji i szyfrowania) na poziomie IP. Bêdzie wymagany do IP w
44 wersji 6 (znanego tak¿e jako IPng, IP nastêpnej generacji) i jest
45 opcjonalny dla aktualnego IP, w wersji 4.
46
47 FreeS/WAN jest darmow± implementacj± protoko³u IPSEC.
48
49 %prep
50 %setup  -q -a2 -n %{name}-%{version}-%{_rc}
51
52 %patch0 -p1
53 %patch1 -p1
54
55 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}-%{_rc}/freeswan.diff}
56 #%{?!_without_x509:%patch5 -p1 }
57
58 %patch2 -p1
59
60 %build
61
62 USERCOMPILE="%{rpmcflags}" ; export USERCOMPILE
63 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
64 CC=%{__cc}; export CC
65 %{__make} programs \
66         FINALCONFDIR=%{_sysconfdir}/ipsec \
67         INC_USRLOCAL=/usr \
68         INC_MANDIR=share/man \
69         FINALRCDIR=%{_sysconfdir}/rc.d/init.d \
70         FINALLIBEXECDIR=${_libdir}/ipsec 
71
72 %install
73 rm -rf $RPM_BUILD_ROOT
74 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ipsec,/etc/rc.d/init.d,/var/run/pluto}
75
76 %{__make} install \
77         DESTDIR="$RPM_BUILD_ROOT" \
78         INC_USRLOCAL=/usr \
79         INC_MANDIR=share/man \
80         FINALCONFDIR=%{_sysconfdir}/ipsec \
81         FINALRCDIR=%{_sysconfdir}/rc.d/init.d \
82         FINALLIBEXECDIR=%{_libdir}/ipsec \
83         FINALEXAMPLECONFDIR=/usr/share/doc/%{name}-%{version}
84
85 %if %{x509}
86  install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec/ipsec.d
87  for i in crls cacerts private policies; do
88   install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec/ipsec.d/$i
89 done
90 for i in CHANGES README; do
91   install  %{x509ver}-%{name}-%{version}-%{_rc}/$i $i.x509 ;    
92 done
93 %endif
94
95 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
96
97 %post
98 # generate RSA private key... if, and only if, /etc/ipsec/ipsec.secrets does
99 # not already exist
100 if [ ! -f %{_sysconfdir}/ipsec/ipsec.secrets ];
101 then
102     echo generate RSA private key...
103     /usr/sbin/ipsec newhostkey --output %{_sysconfdir}/ipsec/ipsec.secrets
104     chmod 600 %{_sysconfdir}/ipsec/ipsec.secrets
105 fi
106
107 /sbin/chkconfig --add ipsec
108 if [ -f /var/lock/subsys/ipsec ]; then
109         /etc/rc.d/init.d/ipsec restart >&2
110 else
111         echo "Run '/etc/rc.d/init.d/ipsec start' to start IPSEC services." >&2
112 fi
113
114 %preun
115 if [ "$1" = "0" ]; then
116         if [ -f /var/lock/subsys/ipsec ]; then
117                 /etc/rc.d/init.d/ipsec stop >&2
118         fi
119         /sbin/chkconfig --del ipsec >&2
120 fi
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %files
126 %defattr(644,root,root,755)
127 %doc README CREDITS CHANGES BUGS 
128 %doc doc/{kernel.notes,impl.notes,examples,prob.report,standards} doc/*.html
129 %{?!_without_x509:%doc CHANGES.x509 README.x509}
130 %{_mandir}/man*/*
131 %lang(pl) %{_mandir}/pl/man*/*
132 %attr(755,root,root) %{_sbindir}/*
133 %attr(754,root,root) /etc/rc.d/init.d/*
134 %dir %{_libdir}/ipsec
135 %attr(755,root,root) %{_libdir}/ipsec/*
136 %attr(751,root,root) %dir %{_sysconfdir}/ipsec
137 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ipsec/ipsec.conf
138 %if %{x509}
139 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d
140 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/crls
141 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/cacerts
142 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/private
143 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec/ipsec.d/policies
144 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ipsec/ipsec.d/policies/*
145 %endif
This page took 0.038708 seconds and 3 git commands to generate.