]> git.pld-linux.org Git - packages/freeswan.git/blob - freeswan.spec
- fix %build ,%prep, %install section
[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.2
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
56 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}/freeswan.diff}
57 %{?!_without_x509:%patch5 -p1 }
58 %build
59 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
60 %{__make} programs
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ipsec,/etc/rc.d/init.d,/var/run/pluto}
65
66 %{__make} install \
67         DESTDIR="$RPM_BUILD_ROOT"
68
69 %if %{x509}
70  install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d
71  for i in crls cacerts private; do
72   install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d/$i
73 done
74 for i in CHANGES README; do
75   install  %{x509ver}-%{name}-%{version}/$i $i.x509 ;   
76         gzip -9nf $i.x509 ;
77
78 done
79 %endif
80
81 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
82
83 gzip -9nf README CREDITS CHANGES BUGS \
84           doc/{kernel.notes,impl.notes,examples,prob.report,standards} 
85                 
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %post
91 # generate RSA private key... if, and only if, /etc/ipsec/ipsec.secrets does
92 # not already exist
93 if [ ! -f %{_sysconfdir}/ipsec/ipsec.secrets ];
94 then
95     echo generate RSA private key...
96     /usr/sbin/ipsec newhostkey --output %{_sysconfdir}/ipsec/ipsec.secrets
97     chmod 600 %{_sysconfdir}/ipsec/ipsec.secrets
98 fi
99
100 /sbin/chkconfig --add ipsec
101 if [ -f /var/lock/subsys/ipsec ]; then
102         /etc/rc.d/init.d/ipsec restart >&2
103 else
104         echo "Run '/etc/rc.d/init.d/ipsec start' to start IPSEC services." >&2
105 fi
106
107 %preun
108 if [ "$1" = "0" ]; then
109         if [ -f /var/lock/subsys/ipsec ]; then
110                 /etc/rc.d/init.d/ipsec stop >&2
111         fi
112         /sbin/chkconfig --del ipsec >&2
113 fi
114
115 %files
116 %defattr(644,root,root,755)
117 %doc *.gz doc/*.gz doc/*.html
118 %{?!_without_x509:%doc CHANGES.x509.gz README.x509.gz}
119 %{_mandir}/man*/*
120 %lang(pl) %{_mandir}/pl/man*/*
121 %attr(755,root,root) %{_sbindir}/*
122 %attr(754,root,root) /etc/rc.d/init.d/*
123 %dir %{_libdir}/ipsec
124 %attr(755,root,root) %{_libdir}/ipsec/*
125 %attr(751,root,root) %dir %{_sysconfdir}/ipsec
126 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ipsec/*
127 %if %{x509}
128 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d
129 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/crls
130 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/cacerts
131 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/private
132 %endif
This page took 0.058362 seconds and 3 git commands to generate.