]> git.pld-linux.org Git - packages/freeswan.git/blob - freeswan.spec
- rel 1
[packages/freeswan.git] / freeswan.spec
1 # Conditional builds
2 # _without_x509
3 # _with_smp
4 # _with_oldconfig
5
6 %define x509ver          x509patch-0.9.11
7
8 Summary:        Free IPSEC implemetation
9 Summary(pl):    Publicznie dostêpna implementacja IPSEC
10 Name:           freeswan
11 Version:        1.97
12 Release:        1
13 License:        GPL
14 Group:          Networking/Daemons
15 Source0:        ftp://ftp.xs4all.nl/pub/crypto/%{name}/%{name}-%{version}.tar.gz
16 Source1:        http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-pl-man-pages.tar.bz2
17 Source2:        http://www.strongsec.com/%{name}/%{x509ver}-%{name}-%{version}.tar.gz
18 Source3:        %{name}-kernel.config
19 Patch0:         %{name}-Makefile.patch
20 Patch1:         %{name}-manlink.patch
21 Patch2:         %{name}-config.patch
22 Patch3:         %{name}-init.patch
23 Patch4:         %{name}-keygen.patch
24 Patch5:         x509-config.patch
25 URL:            http://www.freeswan.org/
26 Prereq:         /sbin/chkconfig
27 Prereq:         rc-scripts
28 BuildRequires:  gmp-devel
29 BuildRequires:  kernel-source
30 BuildRequires:  kernel-headers
31 BuildRequires:  kernel-doc
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Requires:       gmp
34
35 %define x509 1
36 %{?_without_x509:%define x509 0}
37
38 %description
39 The basic idea of IPSEC is to provide security functions
40 (authentication and encryption) at the IP (Internet Protocol) level.
41 It will be required in IP version 6 (better known as IPng, the next
42 generation) and is optional for the current IP, version 4.
43
44 FreeS/WAN is a freely-distributable implementation of IPSEC protocol.
45 FreeS/WAN utilities%{?!_without_x509: compiled with X.509 certificate support}.
46
47 %description -l pl
48 Podstawowa idea IPSEC to zapewnienie funkcji bezpieczeñstwa
49 (autentykacji i szyfrowania) na poziomie IP. Bêdzie wymagany do IP w
50 wersji 6 (znanego tak¿e jako IPng, IP nastêpnej generacji) i jest
51 opcjonalny dla aktualnego IP, w wersji 4.
52
53 FreeS/WAN jest darmow± implementacj± protoko³u IPSEC.
54
55 %prep
56 %setup  -q -a2
57
58 %patch0 -p1
59 %patch1 -p1
60 %patch2 -p1
61 %patch3 -p1
62 %patch4 -p1
63
64 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}/freeswan.diff}
65 %{?!_without_x509:%patch5 -p1 }
66
67 %build
68
69 USERCOMPILE="%{rpmcflags}" ; export USERCOMPILE
70 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
71 CC=%{__cc}; export CC
72 %{__make} programs
73
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ipsec,/etc/rc.d/init.d,/var/run/pluto}
77
78 %{__make} install \
79         DESTDIR="$RPM_BUILD_ROOT"
80
81 %if %{x509}
82  install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d
83  for i in crls cacerts private; do
84   install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d/$i
85 done
86 for i in CHANGES README; do
87   install  %{x509ver}-%{name}-%{version}/$i $i.x509 ;   
88         gzip -9nf $i.x509 ;
89
90 done
91 %endif
92
93 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
94
95 gzip -9nf README CREDITS CHANGES BUGS \
96           doc/{kernel.notes,impl.notes,examples,prob.report,standards} 
97                 
98
99
100 %post
101 # generate RSA private key... if, and only if, /etc/ipsec/ipsec.secrets does
102 # not already exist
103 if [ ! -f %{_sysconfdir}/ipsec/ipsec.secrets ];
104 then
105     echo generate RSA private key...
106     /usr/sbin/ipsec newhostkey --output %{_sysconfdir}/ipsec/ipsec.secrets
107     chmod 600 %{_sysconfdir}/ipsec/ipsec.secrets
108 fi
109
110 /sbin/chkconfig --add ipsec
111 if [ -f /var/lock/subsys/ipsec ]; then
112         /etc/rc.d/init.d/ipsec restart >&2
113 else
114         echo "Run '/etc/rc.d/init.d/ipsec start' to start IPSEC services." >&2
115 fi
116
117 %preun
118 if [ "$1" = "0" ]; then
119         if [ -f /var/lock/subsys/ipsec ]; then
120                 /etc/rc.d/init.d/ipsec stop >&2
121         fi
122         /sbin/chkconfig --del ipsec >&2
123 fi
124
125 %clean
126 rm -rf $RPM_BUILD_ROOT
127
128
129 %files
130 %defattr(644,root,root,755)
131 %doc *.gz doc/*.gz doc/*.html
132 %{?!_without_x509:%doc CHANGES.x509.gz README.x509.gz}
133 %{_mandir}/man*/*
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/*
141 %if %{x509}
142 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d
143 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/crls
144 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/cacerts
145 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/private
146 %endif
This page took 0.079485 seconds and 3 git commands to generate.