]> git.pld-linux.org Git - packages/freeswan.git/blob - freeswan.spec
- some pld.org.pl->pld-linux.org cosmetics
[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 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 Requires:       gmp
31
32 %define x509 1
33 %{?_without_x509:%define x509 0}
34
35 %description
36 The basic idea of IPSEC is to provide security functions
37 (authentication and encryption) at the IP (Internet Protocol) level.
38 It will be required in IP version 6 (better known as IPng, the next
39 generation) and is optional for the current IP, version 4.
40
41 FreeS/WAN is a freely-distributable implementation of IPSEC protocol.
42 FreeS/WAN utilities%{?!_without_x509: compiled with X.509 certificate support}.
43
44 %description -l pl
45 Podstawowa idea IPSEC to zapewnienie funkcji bezpieczeñstwa
46 (autentykacji i szyfrowania) na poziomie IP. Bêdzie wymagany do IP w
47 wersji 6 (znanego tak¿e jako IPng, IP nastêpnej generacji) i jest
48 opcjonalny dla aktualnego IP, w wersji 4.
49
50 FreeS/WAN jest darmow± implementacj± protoko³u IPSEC.
51
52 %prep
53 %setup  -q -a2
54
55 %patch0 -p1
56 %patch1 -p1
57 %patch2 -p1
58 %patch3 -p1
59 %patch4 -p1
60
61 %{?!_without_x509:patch -p1 <%{x509ver}-%{name}-%{version}/freeswan.diff}
62 %{?!_without_x509:%patch5 -p1 }
63
64 %build
65
66 USERCOMPILE="%{rpmcflags}" ; export USERCOMPILE
67 OPT_FLAGS="%{rpmcflags}"; export OPT_FLAGS
68 CC=%{__cc}; export CC
69 %{__make} programs
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
78 %if %{x509}
79  install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d
80  for i in crls cacerts private; do
81   install -d  $RPM_BUILD_ROOT%{_sysconfdir}/ipsec.d/$i
82 done
83 for i in CHANGES README; do
84   install  %{x509ver}-%{name}-%{version}/$i $i.x509 ;   
85         gzip -9nf $i.x509 ;
86
87 done
88 %endif
89
90 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
91
92 gzip -9nf README CREDITS CHANGES BUGS \
93           doc/{kernel.notes,impl.notes,examples,prob.report,standards} 
94                 
95
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
126 %files
127 %defattr(644,root,root,755)
128 %doc *.gz doc/*.gz doc/*.html
129 %{?!_without_x509:%doc CHANGES.x509.gz README.x509.gz}
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/*
138 %if %{x509}
139 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d
140 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/crls
141 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/cacerts
142 %attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d/private
143 %endif
This page took 0.066446 seconds and 3 git commands to generate.