How to install ipsec-tools on RHEL6

来源:互联网 发布:windows ping命令大全 编辑:程序博客网 时间:2024/04/29 16:18

My Host Environment.

[root@NUT ~]# uname -r
2.6.32-563.el6.x86_64

On RHEL6, the binary ipsec-tools rpm package may not be available. You could follow the step before to build the ipsec-tools rpm package from the Source RPM package first and then use the rpm command to install the binary package.

Contents

  • 1Set up the rpm build environment
  • 2Download the Source ipsec-tools RPM package
  • 3Install the Source ipsec-tools RPM
  • 4Edit the ipsec-tools.spec file
  • 5Build the binary ipsec-tools RPM package
    • 5.1do the rpmbuild again
  • 6Installing the binary ipsec-tools rpm package

Set up the rpm build environment

  • install the rpm-build rpm package
yum install rpm-build
  • install the development environment
yum groupinstall Development

Download the Source ipsec-tools RPM package

  • ftp://ftp.icm.edu.pl/vol/rzm5/linux-fedora-secondary/releases/15/Everything/source/SRPMS/ipsec-tools-0.8.0-1.fc15.src.rpm

Or any other mirror site.

Install the Source ipsec-tools RPM

  • cd to the download directory and run the rpm command to install:
rpm -ivh ipsec-tools-0.8.0-1.fc15.src.rpm

Note: To build the binary ipsec-tools for CentOS 6.4, you must use the above version. Newer version will need the flex-static and systemd-unit which are not available on RHEL6.

Go to the ~/rpmbuild directory and cd to SPECS directory for the ipsec-tools.spec file.

Edit the ipsec-tools.spec file

Remove the word "flex-static" from line 32 in the ipsec-tools.spec file.

Build the binary ipsec-tools RPM package

cd to the SPECS directory and run the following command:

rpmbuild -ba ipsec-tools.spec

If you got the following warning, you need to install the required packages in order to build the ipsec-tools binary:

[rchan@NUT SPECS]$ rpmbuild -ba ipsec-tools.spec error: Failed build dependencies:openssl-devel is needed by ipsec-tools-0.8.0-1.el6.x86_64krb5-devel is needed by ipsec-tools-0.8.0-1.el6.x86_64bison is needed by ipsec-tools-0.8.0-1.el6.x86_64flex is needed by ipsec-tools-0.8.0-1.el6.x86_64flex-static is needed by ipsec-tools-0.8.0-1.el6.x86_64automake is needed by ipsec-tools-0.8.0-1.el6.x86_64 libtool is needed by ipsec-tools-0.8.0-1.el6.x86_64libselinux-devel >= 1.30.28-2 is needed by ipsec-tools-0.8.0-1.el6.x86_64pam-devel is needed by ipsec-tools-0.8.0-1.el6.x86_64audit-libs-devel >= 1.3.1 is needed by ipsec-tools-0.8.0-1.el6.x86_64

As root, run the following command to install the required rpms:

yum install openssl-devel krb5-devel bison flex automake libtool libselinux-devel pam-devel audit-libs-devel

do the rpmbuild again

[rchan@NUT SPECS]$ rpmbuild -ba ipsec-tools.spec <snipped>Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1Requires(post): /bin/sh chkconfigRequires(preun): /bin/sh chkconfig initscriptsRequires: /bin/bash /bin/sh libaudit.so.1()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libcrypt.so.1()(64bit) libcrypt.so.1(GLIBC_2.2.5)(64bit) libcrypto.so.10()(64bit) libgssapi_krb5.so.2()(64bit) libgssapi_krb5.so.2(gssapi_krb5_2_MIT)(64bit) libpam.so.0()(64bit) libpam.so.0(LIBPAM_1.0)(64bit) libresolv.so.2()(64bit) libresolv.so.2(GLIBC_2.2.5)(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) libselinux.so.1()(64bit) rtld(GNU_HASH)Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rchan/rpmbuild/BUILDROOT/ipsec-tools-0.8.0-1.el6.x86_64warning: Could not canonicalize hostname: NUTWrote: /home/rchan/rpmbuild/SRPMS/ipsec-tools-0.8.0-1.el6.src.rpmWrote: /home/rchan/rpmbuild/RPMS/x86_64/ipsec-tools-0.8.0-1.el6.x86_64.rpmExecuting(%clean): /bin/sh -e /var/tmp/rpm-tmp.kLmFKI+ umask 022+ cd /home/rchan/rpmbuild/BUILD+ cd ipsec-tools-0.8.0+ rm -rf /home/rchan/rpmbuild/BUILDROOT/ipsec-tools-0.8.0-1.el6.x86_64+ exit 0[rchan@NUT SPECS]$ Note: you may meet the flowing issue:      src/setkey/token.c:1903: undefined reference to `yywrap'Fix: 1) Download the flex source         Go to http://sourceforge.net/projects/flex/files/        Better download the same version with flex that have installed.     2) Compile/Build         Decompression the pkg, then compile/build the source code        # ./confgure && make        # cp libfl.a /lib

Installing the binary ipsec-tools rpm package

cd ~/rpmbuild/RPMS/x86_64     (for 64 bits system)[root@NUT x86_64]# ls -ltotal 1368-rw-r--r--. 1 root root 399888 Jun 19 16:34 ipsec-tools-0.8.0-1.el6.x86_64.rpm-rw-r--r--. 1 root root 997104 Jun 19 16:34 ipsec-tools-debuginfo-0.8.0-1.el6.x86_64.rpm

Switch to "root" and install the rpm package:

[root@NUT ~]# cd /root/rpmbuild/RPMS/x86_64/[root@NUT x86_64]# lsipsec-tools-0.8.0-1.el6.x86_64.rpm[root@NUT x86_64]# rpm -ivh ipsec-tools-0.8.0-1.el6.x86_64.rpm Preparing...                ########################################### [100%]   1:ipsec-tools            ########################################### [100%]



0 0
原创粉丝点击