You must modify the Makefile under the FreeS/WAN source directory and subdirectories named utils, klips/utils, Pluto,
and lib to specify installation paths. We must modify these files to be compliant with Red Hat's file system structure and install FreeS/WAN files under our PATH environment variable.
Move to the top-level directory of the new FreeS/WAN distribution and type the following commands on your terminal: Edit the
Makefilefile, viMakefileand change the following lines:PUBDIR=/usr/local/sbinTo read:
PUBDIR=/usr/sbinPRIVDIR=/usr/local/lib/ipsecTo read:
PRIVDIR=/usr/lib/ipsecFINALPRIVDIR=/usr/local/lib/ipsecTo read:
FINALPRIVDIR=/usr/lib/ipsecMANTREE=/usr/local/manTo read:
MANTREE=/usr/man
Edit the
Makefilefile of the subdirectoryutils, viutils/Makefileand change the following lines:PUBDIR=/usr/local/sbinTo read:
PUBDIR=/usr/sbinPRIVDIR=/usr/local/lib/ipsecTo read:
PRIVDIR=/usr/lib/ipsecFINALPRIVDIR=/usr/local/lib/ipsecTo read:
FINALPRIVDIR=/usr/lib/ipsecMANTREE=/usr/local/manTo read:
MANTREE=/usr/man
Edit the
Makefilefile of the subdirectoryklips/utils, viklips/utils/Makefileand change the following lines:BINDIR=/usr/local/lib/ipsecTo read:
BINDIR=/usr/lib/ipsecMANTREE=/usr/local/manTo read:
MANTREE=/usr/man
Edit the
Makefilefile of the subdirectorypluto, vipluto/Makefileand change the following lines:BINDIR=/usr/local/lib/ipsecTo read:
BINDIR=/usr/lib/ipsecMANTREE=/usr/local/manTo read:
MANTREE=/usr/man
Edit the
Makefilefile of the subdirectorylib, vilib/Makefileand change the following lines:MANTREE=/usr/local/manTo read:
MANTREE=/usr/manEdit the
Makefilefile of the subdirectorylibdes, vilibdes/Makefileand change the following lines:LIBDIR=/usr/local/libTo read:
LIBDIR=/usr/libBINDIR=/usr/local/binTo read:
BINDIR=/usr/binINCDIR=/usr/local/includeTo read:
INCDIR=/usr/includeMANDIR=/usr/local/manTo read:
MANDIR=/usr/manThe above changes, from step1 to step 6, will locate all files related to the FreeS/WAN software to the destination target directories we have chosen in order to be compliant with the Red Hat file system structure.
Now, we must compile and install FreeSWAN on the server:
[root@deep ]/freeswan-1.3# make insert
[root@deep ]/freeswan-1.3# make programs
[root@deep ]/freeswan-1.3# make install
The make insert command creates a symbolic link
/usr/src/linux/net/ipsec, pointing to the KLIPS source directory. It patches some kernel files, where necessary, to know about KLIPS and/or to fix bugs. It also adds its default configuration to the kernel configuration file, and finally, it makes the KLIPS communication file,/dev/ipsec, if it's not already there.The make programs command builds the libraries, Pluto, and various user-level utilities.
The make install will install the Pluto daemon and user-level utilities, and set things up for boot-time startup.