1 |
kharec |
3447 |
%define LIBMAJ 0 |
2 |
|
|
%define libname %mklibname ipsec %LIBMAJ |
3 |
|
|
%define libnamedev %mklibname -d ipsec |
4 |
|
|
|
5 |
|
|
Name: ipsec-tools |
6 |
|
|
Version: 0.7.3 |
7 |
|
|
Release: %mkrel 4 |
8 |
|
|
Summary: Tools for configuring and using IPSEC |
9 |
|
|
License: BSD |
10 |
|
|
Group: Networking/Other |
11 |
|
|
URL: http://ipsec-tools.sourceforge.net/ |
12 |
|
|
Source: http://prdownloads.sourceforge.net/ipsec-tools/ipsec-tools-%{version}.tar.bz2 |
13 |
|
|
Source3: racoon.conf |
14 |
|
|
Source4: psk.txt |
15 |
|
|
Source6: ipsec-setkey-initscript |
16 |
|
|
Source7: racoon-initscript |
17 |
|
|
Source8: racoon.sysconfig |
18 |
|
|
Patch0: ipsec-tools-0.6.2b3-manfix.patch |
19 |
|
|
Patch1: ipsec-tools-0.5.2-includes.patch |
20 |
|
|
Patch2: ipsec-tools-0.7.3-install.patch |
21 |
|
|
Patch3: ipsec-tools-0.7.3-link.patch |
22 |
|
|
# Fedora patches |
23 |
|
|
Patch103: ipsec-tools-0.7-acquires.patch |
24 |
|
|
Patch104: ipsec-tools-0.7.1-loopback.patch |
25 |
|
|
# the following patches were also submitted upstream: |
26 |
|
|
Patch105: ipsec-tools-0.7-iface.patch |
27 |
|
|
Patch106: ipsec-tools-0.7-dupsplit.patch |
28 |
|
|
Patch109: ipsec-tools-0.7-splitcidr.patch |
29 |
|
|
Patch110: ipsec-tools-0.7.2-natt-linux.patch |
30 |
|
|
Patch111: ipsec-tools-0.7.1-pie.patch |
31 |
|
|
Patch113: ipsec-tools-0.7.1-dpd-fixes.patch |
32 |
|
|
BuildRequires: openssl-devel krb5-devel flex bison |
33 |
|
|
BuildRequires: libpam-devel |
34 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
35 |
|
|
Requires: %{libname} = %{version} |
36 |
|
|
Requires(pre): rpm-helper |
37 |
|
|
Requires: rpm-helper |
38 |
|
|
Provides: kvpnc-backend |
39 |
|
|
|
40 |
|
|
%description |
41 |
|
|
This is the IPsec-Tools package. You need this package in order to |
42 |
|
|
really use the IPsec functionality in the linux-2.6 and above kernels. |
43 |
|
|
This package builds: |
44 |
|
|
|
45 |
|
|
- libipsec, a PFKeyV2 library |
46 |
|
|
- setkey, a program to directly manipulate policies and SAs |
47 |
|
|
- racoon, an IKEv1 keying daemon |
48 |
|
|
|
49 |
|
|
%define old_libname %mklibname ipsec-tools 0 |
50 |
|
|
%define old_libname_devel %mklibname -d ipsec 0 |
51 |
|
|
|
52 |
|
|
%package -n %{libname} |
53 |
|
|
Summary: The shared libraries used by ipsec-tools |
54 |
|
|
Group: System/Libraries |
55 |
|
|
Requires(post): grep, coreutils |
56 |
|
|
Requires(preun): grep, coreutils |
57 |
|
|
Requires: grep, coreutils |
58 |
|
|
Provides: libipsec = %{version}-%{release} |
59 |
|
|
Provides: libipsec-tools = %{version}-%{release} |
60 |
|
|
Obsoletes: libipsec-tools |
61 |
|
|
Provides: %old_libname = %{version}-%{release} |
62 |
|
|
Obsoletes: %old_libname |
63 |
|
|
|
64 |
|
|
%description -n %{libname} |
65 |
|
|
These are the shared libraries for the IPsec-Tools package. |
66 |
|
|
|
67 |
|
|
%package -n %{libnamedev} |
68 |
|
|
Summary: Headers for programs for %libname |
69 |
|
|
Group: Development/C |
70 |
|
|
Requires: %{libname} = %{version} |
71 |
|
|
Provides: libipsec-tools-devel = %{version}-%{release} |
72 |
|
|
Provides: libipsec-devel = %{version}-%{release} |
73 |
|
|
Obsoletes: libipsec-tools-devel |
74 |
|
|
Provides: %{old_libname}-devel = %{version}-%{release} |
75 |
|
|
Obsoletes: %{old_libname}-devel |
76 |
|
|
Obsoletes: %{old_libname_devel} < 0.7 |
77 |
|
|
|
78 |
|
|
|
79 |
|
|
%description -n %{libnamedev} |
80 |
|
|
These are development headers for libipsec |
81 |
|
|
|
82 |
|
|
%prep |
83 |
|
|
%setup -q |
84 |
|
|
%patch0 -p1 -b .manfix |
85 |
|
|
%patch1 -p1 -b .includes |
86 |
|
|
%patch2 -p1 -b .install |
87 |
|
|
%patch3 -p0 -b .link |
88 |
|
|
%patch103 -p1 -b .acquires |
89 |
|
|
%patch104 -p1 -b .loopback |
90 |
|
|
%patch105 -p1 -b .iface |
91 |
|
|
%patch106 -p1 -b .dupsplit |
92 |
|
|
%patch109 -p1 -b .splitcidr |
93 |
|
|
%patch110 -p1 -b .natt-linux |
94 |
|
|
%patch111 -p1 -b .pie |
95 |
|
|
%patch113 -p1 -b .dpd-fixes |
96 |
|
|
|
97 |
|
|
sed -i 's|-Werror||g' configure* |
98 |
|
|
|
99 |
|
|
|
100 |
|
|
%build |
101 |
|
|
./bootstrap |
102 |
|
|
%configure2_5x \ |
103 |
|
|
--prefix=%{_prefix} \ |
104 |
|
|
--mandir=%{_mandir} \ |
105 |
|
|
--libdir=/%{_lib} \ |
106 |
|
|
--sbindir=/sbin \ |
107 |
|
|
--localstatedir=%{_localstatedir}/lib \ |
108 |
|
|
--sysconfdir=%{_sysconfdir}/racoon \ |
109 |
|
|
--with-kernel-headers=%{_includedir} \ |
110 |
|
|
--enable-shared \ |
111 |
|
|
--disable-rpath \ |
112 |
|
|
--enable-hybrid \ |
113 |
|
|
--enable-frag \ |
114 |
|
|
--enable-dpd \ |
115 |
|
|
--enable-adminport \ |
116 |
|
|
--enable-gssapi \ |
117 |
|
|
--enable-natt \ |
118 |
|
|
--with-libpam \ |
119 |
|
|
--enable-security-context=no \ |
120 |
|
|
--disable-audit |
121 |
|
|
make |
122 |
|
|
|
123 |
|
|
%install |
124 |
|
|
rm -rf $RPM_BUILD_ROOT |
125 |
|
|
%makeinstall_std |
126 |
|
|
|
127 |
|
|
mkdir -p $RPM_BUILD_ROOT/etc/racoon/ |
128 |
|
|
|
129 |
|
|
install -m 0600 %{SOURCE3} $RPM_BUILD_ROOT/etc/racoon/racoon.conf |
130 |
|
|
install -m 0600 %{SOURCE4} $RPM_BUILD_ROOT/etc/racoon/psk.txt |
131 |
|
|
mkdir -m 0700 -p $RPM_BUILD_ROOT/etc/racoon/certs |
132 |
|
|
|
133 |
|
|
mkdir -p $RPM_BUILD_ROOT/%{_initrddir} |
134 |
|
|
install -m 0755 %{SOURCE6} $RPM_BUILD_ROOT/%{_initrddir}/ipsec-setkey |
135 |
|
|
install -m 0755 %{SOURCE7} $RPM_BUILD_ROOT/%{_initrddir}/racoon |
136 |
|
|
|
137 |
|
|
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
138 |
|
|
# racoon.sysconfig |
139 |
|
|
install -m 0644 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/racoon |
140 |
|
|
|
141 |
|
|
# pam file |
142 |
|
|
mkdir -p %{buildroot}%{_sysconfdir}/pam.d |
143 |
|
|
cat > %{buildroot}%{_sysconfdir}/pam.d/racoon <<EOF |
144 |
|
|
#%PAM-1.0 |
145 |
|
|
auth required pam_nologin.so |
146 |
|
|
auth include system-auth |
147 |
|
|
account include system-auth |
148 |
|
|
EOF |
149 |
|
|
|
150 |
|
|
# default ipsec.conf file |
151 |
|
|
cat > %{buildroot}%{_sysconfdir}/ipsec.conf <<EOF |
152 |
|
|
#!/usr/sbin/setkey -f |
153 |
|
|
# |
154 |
|
|
# File /etc/ipsec.conf |
155 |
|
|
|
156 |
|
|
# delete the SAD and SPD |
157 |
|
|
flush; |
158 |
|
|
spdflush; |
159 |
|
|
|
160 |
|
|
# Define here your security policies |
161 |
|
|
|
162 |
|
|
# Example |
163 |
|
|
# ipsec between two machines: 192.168.1.10 and 192.168.1.20 |
164 |
|
|
# |
165 |
|
|
# spdadd 192.168.1.10 192.168.1.20 any -P in ipsec |
166 |
|
|
# esp/transport//require |
167 |
|
|
# ah/transport//require; |
168 |
|
|
# |
169 |
|
|
# spdadd 192.168.1.20 192.168.1.10 any -P out ipsec |
170 |
|
|
# esp/transport//require |
171 |
|
|
# ah/transport//require; |
172 |
|
|
|
173 |
|
|
EOF |
174 |
|
|
|
175 |
|
|
# remove some files from the sample dir so we can include it |
176 |
|
|
# in %%doc. Also fix their permissions |
177 |
|
|
rm -f src/racoon/samples/*.in |
178 |
|
|
find src/racoon/samples -type f -exec chmod 0644 {} \; |
179 |
|
|
|
180 |
|
|
%clean |
181 |
|
|
rm -rf $RPM_BUILD_ROOT |
182 |
|
|
|
183 |
|
|
%post |
184 |
|
|
%_post_service ipsec-setkey |
185 |
|
|
%_post_service racoon |
186 |
|
|
|
187 |
|
|
%preun |
188 |
|
|
%_preun_service ipsec-setkey |
189 |
|
|
%_preun_service racoon |
190 |
|
|
|
191 |
|
|
%files |
192 |
|
|
%defattr(-,root,root) |
193 |
|
|
%doc ChangeLog NEWS README |
194 |
|
|
%doc src/racoon/samples |
195 |
|
|
%doc src/racoon/doc/* |
196 |
|
|
/sbin/* |
197 |
|
|
%{_mandir}/man*/* |
198 |
|
|
%dir %{_sysconfdir}/racoon |
199 |
|
|
%dir %{_sysconfdir}/racoon/certs |
200 |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/racoon |
201 |
|
|
%config(noreplace) %{_sysconfdir}/racoon/psk.txt |
202 |
|
|
%config(noreplace) %{_sysconfdir}/racoon/racoon.conf |
203 |
|
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/ipsec.conf |
204 |
|
|
%config(noreplace) %{_sysconfdir}/pam.d/racoon |
205 |
|
|
%attr (0755,root,root) %{_initrddir}/ipsec-setkey |
206 |
|
|
%attr (0755,root,root) %{_initrddir}/racoon |
207 |
|
|
%dir /var/lib/racoon |
208 |
|
|
|
209 |
|
|
%files -n %{libname} |
210 |
|
|
%defattr(-,root,root) |
211 |
|
|
%doc ChangeLog NEWS README |
212 |
|
|
/%{_lib}/*.so.* |
213 |
|
|
|
214 |
|
|
%files -n %{libnamedev} |
215 |
|
|
%defattr(-,root,root) |
216 |
|
|
/%{_lib}/libipsec.la |
217 |
|
|
/%{_lib}/libipsec.a |
218 |
|
|
/%{_lib}/libipsec.so |
219 |
|
|
/%{_lib}/libracoon.la |
220 |
|
|
/%{_lib}/libracoon.a |
221 |
|
|
/%{_lib}/libracoon.so |
222 |
|
|
%{_includedir}/* |
223 |
|
|
|
224 |
|
|
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
|