]> git.pld-linux.org Git - packages/freeswan.git/blob - freeswan.spec
- started update to 1.97
[packages/freeswan.git] / freeswan.spec
1 # Conditional builds
2 # _without_x509
3
4 %define x509ver          x509patch-0.9.11
5
6 Summary:        Free IPSEC implemetation
7 Summary(pl):    Publicznie dostêpna implementacja IPSEC
8 Name:           freeswan
9 Version:        1.97
10 Release:        0.1
11 License:        GPL
12 Group:          Networking/Daemons
13 Source0:        ftp://ftp.xs4all.nl/pub/crypto/%{name}/%{name}-%{version}.tar.gz
14 Source1:        http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-pl-man-pages.tar.bz2
15 Source2:        http://www.strongsec.com/%{name}/%{x509ver}-%{name}-%{version}.tar.gz
16 Patch0:         %{name}-Makefile.patch
17 Patch1:         %{name}-manlink.patch
18 Patch2:         %{name}-config.patch
19 Patch3:         %{name}-init.patch
20 Patch4:         %{name}-keygen.patch
21 Patch5:         x509-config.patch
22 URL:            http://www.freeswan.org/
23 Prereq:         /sbin/chkconfig
24 Prereq:         rc-scripts
25 BuildRequires:  gmp-devel
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-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
50 %patch0 -p1
51 %patch1 -p1
52 %patch2 -p1
53 %patch3 -p1
54 %patch4 -p1
55 %patch5 -p1
56
57 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}/freeswan.diff}
58
59 %build
60 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
61 %{__make} programs
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ipsec,/etc/rc.d/init.d,/var/run/pluto}
66
67 %{__make} install \
68         DESTDIR="$RPM_BUILD_ROOT"
69
70 %if %{x509}
71  install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d
72  for i in crls cacerts private; do
73   install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d/$i
74 done
75 for i in CHANGES README; do
76   install  %{x509ver}-%{name}-%{version}/$i $i.x509 ;   
77         gzip -9nf $i.x509 ;
78
79 done
80 %endif
81
82 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
83
84 gzip -9nf README CREDITS CHANGES BUGS \
85           doc/{kernel.notes,impl.notes,examples,prob.report,standards} 
86                 
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %post
92 # generate RSA private key... if, and only if, /etc/ipsec/ipsec.secrets does
93 # not already exist
94 if [ ! -f %{_sysconfdir}/ipsec/ipsec.secrets ];
95 then
96     echo generate RSA private key...
97     /usr/sbin/ipsec newhostkey --output %{_sysconfdir}/ipsec/ipsec.secrets
98     chmod 600 %{_sysconfdir}/ipsec/ipsec.secrets
99 fi
100
101 /sbin/chkconfig --add ipsec
102 if [ -f /var/lock/subsys/ipsec ]; then
103         /etc/rc.d/init.d/ipsec restart >&2
104 else
105         echo "Run '/etc/rc.d/init.d/ipsec start' to start IPSEC services." >&2
106 fi
107
108 %preun
109 if [ "$1" = "0" ]; then
110         if [ -f /var/lock/subsys/ipsec ]; then
111                 /etc/rc.d/init.d/ipsec stop >&2
112         fi
113         /sbin/chkconfig --del ipsec >&2
114 fi
115
116 %files
117 %defattr(644,root,root,755)
118 %doc *.gz doc/*.gz doc/*.html
119 %{?!_without_x509:%doc CHANGES.x509.gz README.x509.gz}
120 %{_mandir}/man*/*
121 %lang(pl) %{_mandir}/pl/man*/*
122 %attr(755,root,root) %{_sbindir}/*
123 %attr(754,root,root) /etc/rc.d/init.d/*
124 %dir %{_libdir}/ipsec
125 %attr(755,root,root) %{_libdir}/ipsec/*
126 %attr(751,root,root) %dir %{_sysconfdir}/ipsec
127 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ipsec/*
128 %if %{x509}
129 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d
130 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/crls
131 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/cacerts
132 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/private
133 %endif
This page took 0.064585 seconds and 3 git commands to generate.