]> git.ipfire.org Git - people/ms/strongswan.git/blame - packaging/redhat/freeswan.spec
(no commit message)
[people/ms/strongswan.git] / packaging / redhat / freeswan.spec
CommitLineData
997358a6
MW
1Summary: FreeS/WAN IPSEC implementation
2Name: freeswan
3Version: 2.04
4%define defkv %(rpm -q --qf='%{Version}-%{Release}\\n' kernel-source|tail -1)
5# The default kernel version to build for is the latest of
6# the installed kernel-source RPMs.
7# This can be overridden by "--define 'kversion x.x.x-y.y.y'"
8%{!?kversion: %{expand: %%define kversion %defkv}}
9%define krelver %(echo %{kversion} | tr -s '-' '_')
10# FreeS/WAN -pre/-rc nomenclature has to co-exist with hyphen paranoia
11%define srcpkgver %(echo %{version} | tr -s '_' '-')
12%define our_release 1fs
13%define debug_package %{nil}
14Release: %{our_release}
15License: GPL
16Url: http://www.freeswan.org/
17Source: freeswan-%{srcpkgver}.tar.gz
18Group: System Environment/Daemons
19BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
20%define __spec_install_post /usr/lib/rpm/brp-compress || :
21BuildRequires: kernel-source = %{kversion}
22
23%package userland
24Summary: FreeS/WAN IPSEC usermod tools
25Group: System Environment/Daemons
26Provides: ipsec-userland
27Obsoletes: freeswan
28Requires: ipsec-kernel
29Release: %{our_release}
30
31%package doc
32Summary: FreeS/WAN IPSEC full documentation
33Group: System Environment/Daemons
34Release: %{our_release}
35
36%package module
37Summary: FreeS/Wan kernel module
38Group: System Environment/Kernel
39Release: %{krelver}_%{our_release}
40Provides: ipsec-kernel
41Requires: kernel = %{kversion}
42# do not make the dependancy circular for now.
43#Requires: ipsec-userland
44
45%description userland
46FreeS/WAN is a free implementation of IPSEC & IKE for Linux. IPSEC is
47the Internet Protocol Security and uses strong cryptography to provide
48both authentication and encryption services. These services allow you
49to build secure tunnels through untrusted networks. Everything passing
50through the untrusted net is encrypted by the ipsec gateway machine and
51decrypted by the gateway at the other end of the tunnel. The resulting
52tunnel is a virtual private network or VPN.
53
54This package contains the daemons and userland tools for setting up
55FreeS/WAN on a freeswan enabled kernel.
56
57%description module
58This package contains only the ipsec module for the RedHat series of kernels.
59
60%description doc
61This package contains extensive documentation of the FreeeS/WAN IPSEC
62system.
63
64%description
65A dummy package that installs userland and kernel pieces.
66
67%prep
68%setup -q -n freeswan-%{srcpkgver}
69
70%build
71%{__make} \
72 USERCOMPILE="-g %{optflags}" \
73 INC_USRLOCAL=%{_prefix} \
74 MANTREE=%{_mandir} \
75 INC_RCDEFAULT=%{_initrddir} \
76 programs
77FS=$(pwd)
78mkdir -p BUILD.%{_target_cpu}
79mkdir -p BUILD.%{_target_cpu}-smp
80
81cd packaging/redhat
82for smp in -smp ""
83do
84%{__make} -C $FS MODBUILDDIR=$FS/BUILD.%{_target_cpu}$smp \
85 FREESWANSRCDIR=$FS \
86 KERNELSRC=/usr/src/linux-%{kversion} \
87 ARCH=%{_arch} \
88 SUBARCH=%{_arch} \
89 MODULE_DEF_INCLUDE=$FS/packaging/redhat/config-%{_target_cpu}$smp.h \
90 module
91done
92
93%install
94%{__make} \
95 DESTDIR=%{buildroot} \
96 INC_USRLOCAL=%{_prefix} \
97 MANTREE=%{buildroot}%{_mandir} \
98 INC_RCDEFAULT=%{_initrddir} \
99 install
100install -d -m700 %{buildroot}%{_localstatedir}/run/pluto
101install -d %{buildroot}%{_sbindir}
102
103mkdir -p %{buildroot}/lib/modules/%{kversion}/kernel/net/ipsec
104cp BUILD.%{_target_cpu}/ipsec.o \
105 %{buildroot}/lib/modules/%{kversion}/kernel/net/ipsec
106
107mkdir -p %{buildroot}/lib/modules/%{kversion}smp/kernel/net/ipsec
108cp BUILD.%{_target_cpu}-smp/ipsec.o \
109 %{buildroot}/lib/modules/%{kversion}smp/kernel/net/ipsec
110
111%clean
112rm -rf ${RPM_BUILD_ROOT}
113
114%files doc
115%defattr(-,root,root)
116%doc doc
117%doc %{_defaultdocdir}/freeswan/ipsec.conf-sample
118
119%files userland
120%defattr(-,root,root)
121%doc BUGS CHANGES COPYING
122%doc CREDITS INSTALL README
123%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ipsec.conf
124%attr(0700,root,root) %dir %{_sysconfdir}/ipsec.d
125%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ipsec.d/policies/*
126%config(noreplace) %{_initrddir}/ipsec
127%{_libdir}/ipsec
128%{_sbindir}/ipsec
129%{_libexecdir}/ipsec
130%doc %{_mandir}/*/*
131%{_localstatedir}/run/pluto
132
133%files module
134%defattr (-,root,root)
135/lib/modules/%{kversion}/kernel/net/ipsec
136/lib/modules/%{kversion}smp/kernel/net/ipsec
137
138%pre userland
139%preun userland
140if [ $1 = 0 ]; then
141 /sbin/service ipsec stop || :
142 /sbin/chkconfig --del ipsec
143fi
144
145%postun userland
146if [ $1 -ge 1 ] ; then
147 /sbin/service ipsec stop 2>&1 > /dev/null && /sbin/service ipsec start 2>&1 > /dev/null || :
148fi
149
150%postun module
151%post module
152
153%post userland
154chkconfig --add ipsec
155
156%changelog
157* Fri Aug 22 2003 Sam Sgro <sam@freeswan.org>
158- Juggling release/source package names to allow for
159 -pre/-rc releases to build.
160
161* Thu Aug 14 2003 Sam Sgro <sam@freeswan.org>
162- Reverting back to pre-x.509 version, cosmetic changes.
163
164* Tue May 20 2003 Charlie Brady <charlieb@e-smith.com> 2.0.0-x509_1.3.2_2es
165- Add "Obsoletes: freeswan" to userland RPM.
166
167* Fri May 16 2003 Charlie Brady <charlieb@e-smith.com> 2.0.0-x509_1.3.2_1es
168- Add version 1.3.2 of the x509 patch.
169- Add missing /usr/libexec/ipsec dir and files.
170- Minor tidy up of spec file.
171
172* Thu May 15 2003 Charlie Brady <charlieb@e-smith.com> 2.0.0-1es
173- Based on work by Paul Lahaie of Steamballoon, Michael
174 Richardson of freeS/WAN team and Tuomo Soini <tis@foobar.fi>.
175- Build freeswan RPMs from a single source RPM, for RedHat, but
176 should work on any RPM based system.