openswan/openswan.spec

152 lines
4.3 KiB
RPMSpec
Raw Normal View History

%{?build_selinux}%{?!build_selinux:%bcond_with selinux}
2012-02-01 22:31:05 +04:00
Summary: An implementation of IPSEC & IKE for Linux
Name: openswan
2015-02-05 18:34:38 +03:00
Version: 2.6.41
Release: 6
2012-02-01 22:31:05 +04:00
License: GPLv2+
Group: System/Servers
2014-03-24 22:18:48 +11:00
Url: http://www.openswan.org/
2012-02-01 22:31:05 +04:00
Source0: http://www.openswan.org/download/openswan-%{version}.tar.gz
Source1: http://www.openswan.org/download/openswan-%{version}.tar.gz.asc
2014-03-24 22:18:48 +11:00
Source2: openswan.service
2012-02-01 22:31:05 +04:00
Patch0: openswan-2.6.28-manfix.patch
BuildRequires: bison
2012-07-19 02:03:12 +00:00
BuildRequires: docbook-dtd412-xml
2014-03-24 22:39:25 +11:00
BuildRequires: docbook-style-xsl
2012-02-01 22:31:05 +04:00
BuildRequires: dos2unix
BuildRequires: flex
2014-03-24 22:18:48 +11:00
BuildRequires: xmlto
2012-07-19 02:03:12 +00:00
BuildRequires: gmp-devel
BuildRequires: openldap-devel
BuildRequires: pam-devel
%if %{with selinux}
BuildRequires: selinux-devel
%endif
2014-03-24 22:18:48 +11:00
BuildRequires: pkgconfig(libcap-ng)
BuildRequires: pkgconfig(libcurl)
2012-07-19 02:03:12 +00:00
Requires: curl
Requires: iproute2
Requires: ipsec-tools
Requires: lsof
Requires: openldap
2014-03-24 22:18:48 +11:00
Requires(post,preun): rpm-helper
Provides: ipsec-userland
2012-07-19 02:03:12 +00:00
Conflicts: freeswan
2012-02-01 22:31:05 +04:00
%description
Openswan is a free implementation of IPSEC & IKE for Linux, a fork of the
FreeS/WAN project.
IPSEC is Internet Protocol Security and uses strong cryptography to
provide both authentication and encryption services. These services
allow you to build secure tunnels through untrusted networks.
Everything passing through the untrusted net is encrypted by the ipsec
gateway machine and decrypted by the gateway at the other end of the
tunnel. The resulting tunnel is a virtual private network or VPN.
This package contains the daemons and userland tools for setting up
Openswan on a kernel with either the 2.6 native IPsec code, or
FreeS/WAN's KLIPS.
2014-03-24 22:18:48 +11:00
%files
%doc BUGS CHANGES COPYING CREDITS README
%{_unitdir}/%{name}.service
%{_prefix}/lib/systemd/scripts/ipsec
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/ipsec.conf
%attr(0700,root,root) %dir %{_sysconfdir}/%{name}/ipsec.d
%attr(0700,root,root) %dir %{_sysconfdir}/%{name}/ipsec.d/examples
%attr(0700,root,root) %dir %{_sysconfdir}/%{name}/ipsec.d/policies
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/ipsec.d/*/*
%{_sbindir}/ipsec
%dir %{_libdir}/ipsec
%{_libdir}/ipsec/*
%{_localstatedir}/lib/run/pluto
%{_mandir}/*/*
%preun
%_preun_service %{name}
%post
%_post_service %{name}
#----------------------------------------------------------------------------
%package doc
2012-02-01 22:31:05 +04:00
Summary: An implementation of IPSEC & IKE for Linux
Group: System/Servers
2012-07-19 02:03:12 +00:00
BuildArch: noarch
2012-02-01 22:31:05 +04:00
2014-03-24 22:18:48 +11:00
%description doc
2012-02-01 22:31:05 +04:00
Openswan is a free implementation of IPSEC & IKE for Linux, a fork of the
FreeS/WAN project.
This is the documentation for Openswan.
2014-03-24 22:18:48 +11:00
%files doc
%doc docs/README.* docs/CREDITS.* docs/*.txt
%doc docs/quickstarts docs/html-old-need-merge-with-wiki
#----------------------------------------------------------------------------
2012-02-01 22:31:05 +04:00
2014-03-24 22:18:48 +11:00
%prep
2012-02-01 22:31:05 +04:00
%setup -q -n openswan-%{version}
%patch0 -p0 -b .manfix
2012-07-19 02:03:12 +00:00
find . -type f -name "*.html" -exec dos2unix {} \;
2012-02-01 22:31:05 +04:00
%build
%serverbuild
find . -name "Makefile*" | xargs perl -pi -e "s|libexec|%{_lib}|g"
export CLFAGS=$(echo %{optflags} -fno-strict-aliasing)
# the %make macro doesn't seem to work
make \
USERCOMPILE="-g $CLFAGS" \
INC_USRLOCAL=%{_prefix} \
MANTREE=%{_mandir} \
INC_RCDEFAULT=%{_initrddir} \
2014-03-24 22:18:48 +11:00
CONFDIR=%{_sysconfdir}/%{name} \
FINALCONFDIR=%{_sysconfdir}/%{name} \
FINALCONFFILE=%{_sysconfdir}/%{name}/ipsec.conf \
2012-02-01 22:31:05 +04:00
FINALLIBEXECDIR=%{_libdir}/ipsec \
FINALLIBDIR=%{_libdir}/ipsec \
2012-07-19 02:03:12 +00:00
USE_LIBCAP_NG=true \
%if %{with selinux}
USE_LABELED_IPSEC=true \
%endif
2012-07-19 02:03:12 +00:00
USE_LDAP=true \
USE_LIBCURL=true \
HAVE_THREADS=true \
2012-02-01 22:31:05 +04:00
programs
%install
2012-07-19 02:03:12 +00:00
make \
2012-02-01 22:31:05 +04:00
DESTDIR=%{buildroot} \
INC_USRLOCAL=%{_prefix} \
MANTREE=%{buildroot}%{_mandir} \
INC_RCDEFAULT=%{_initrddir} \
INC_USRLOCAL=%{_prefix} \
INC_RCDEFAULT=%{_initrddir} \
2014-03-24 22:18:48 +11:00
FINALCONFDIR=%{_sysconfdir}/%{name} \
2012-02-01 22:31:05 +04:00
FINALLIBEXECDIR=%{_libdir}/ipsec \
FINALLIBDIR=%{_libdir}/ipsec \
install
install -d -m700 %{buildroot}%{_localstatedir}/lib/run/pluto
install -d %{buildroot}%{_sbindir}
# Remove old documentation for the time being.
rm -rf %{buildroot}%{_defaultdocdir}/freeswan
# cleanup
rm -rf %{buildroot}%{_sysconfdir}/rc.d/rc*
rm -rf %{buildroot}%{_sysconfdir}/rc.d/init.d/setup
rm -rf %{buildroot}%{_docdir}/%{name}
2014-03-24 22:18:48 +11:00
install -Dm644 %{SOURCE2} %{buildroot}%{_unitdir}/openswan.service
mkdir -p %{buildroot}%{_prefix}/lib/systemd/scripts/
mv %{buildroot}/%{_initrddir}/ipsec %{buildroot}/%{_prefix}/lib/systemd/scripts/
2012-02-01 22:31:05 +04:00