-diff -durN freeswan-1.4.orig/Makefile freeswan-1.4/Makefile
---- freeswan-1.4.orig/Makefile Mon May 22 06:37:52 2000
-+++ freeswan-1.4/Makefile Sat Jun 10 13:26:12 2000
-@@ -17,24 +17,20 @@
+diff -Naur freeswan-1.95/Makefile.inc freeswan-1.95-p/Makefile.inc
+--- freeswan-1.95/Makefile.inc Fri Feb 1 04:26:40 2002
++++ freeswan-1.95-p/Makefile.inc Thu Feb 7 19:23:59 2002
+@@ -45,7 +45,7 @@
+ DESTDIR=
+
+ # "local" part of tree, used in building other pathnames
+-INC_USRLOCAL=/usr/local
++INC_USRLOCAL=/usr
+
# PUBDIR is where the "ipsec" command goes; beware, many things define PATH
# settings which are assumed to include it (or at least, to include *some*
- # copy of the "ipsec" command).
--PUBDIR=$(DESTDIR)/usr/local/sbin
-+PUBDIR=$(DESTDIR)/usr/sbin
- # PRIVDIR is where commands get put, REALPRIVDIR is where they think they
- # will be run from in the end (currently only used by utils/ipsec)
--REALPRIVDIR=/usr/local/lib/ipsec
-+REALPRIVDIR=/usr/lib/ipsec
- PRIVDIR=$(DESTDIR)$(REALPRIVDIR)
- # where manpages go
--MANTREE=$(DESTDIR)/usr/local/man
-+MANTREE=$(DESTDIR)/usr/share/man
- # all relevant manpage subdirectories
- MANPLACES=man3 man5 man8
- # where configuration files go
--CONFDIR=$(DESTDIR)/etc
-+CONFDIR=$(DESTDIR)/etc/freeswan
- # REALRCDIR is where boot/shutdown scripts go (first RCDIRS that exists gets
- # it); RCDIR is where they think they will ultimately be (for utils/Makefile)
--RCDIRS=/etc/rc.d/init.d /etc/rc.d /etc/init.d /sbin/init.d
--REALRCDIR=$(shell for d in $(RCDIRS) ; \
-- do if test -d $$d ; \
+@@ -80,10 +80,7 @@
+ # will finally be (so utils/Makefile can create a symlink in BINDIR to the
+ # place where the boot/shutdown script will finally be, rather than the
+ # place where it is installed).
+-FINALRCDIR=$(shell for d in $(INC_RCDIRS) ; \
+- do if test -d $(DESTDIR)/$$d ; \
- then echo $$d ; exit 0 ; \
-- fi ; done ; echo /etc/rc.d/init.d )
-+REALRCDIR=/etc/rc.d/init.d
- RCDIR=$(DESTDIR)$(REALRCDIR)
-
- # kernel location, and location of kernel patches in the distribution
-diff -durN freeswan-1.4.orig/klips/utils/Makefile freeswan-1.4/klips/utils/Makefile
---- freeswan-1.4.orig/klips/utils/Makefile Mon May 22 06:37:31 2000
-+++ freeswan-1.4/klips/utils/Makefile Sat Jun 10 13:26:39 2000
-@@ -14,7 +14,7 @@
- # RCSID $Id$
-
- CC=gcc
--CFLAGS=-O2 -I../net/ipsec -I../../lib -g
-+CFLAGS=$(OPT_FLAGS) -I../net/ipsec -I../../lib
-
- CFLAGS+= -Wall
- #CFLAGS+= -Wconversion
-@@ -30,8 +30,8 @@
- CFLAGS+= -Wbad-function-cast
-
- ALL=spi eroute spigrp tncfg klipsdebug
--BINDIR=/usr/local/lib/ipsec
--MANTREE=/usr/local/man
-+BINDIR=/usr/lib/ipsec
-+MANTREE=/usr/share/man
- MANDIR=$(MANTREE)/man8
- FREESWANLIB=../../lib/libfreeswan.a
- INSTALL=install
-diff -durN freeswan-1.4.orig/lib/Makefile freeswan-1.4/lib/Makefile
---- freeswan-1.4.orig/lib/Makefile Mon May 22 06:37:32 2000
-+++ freeswan-1.4/lib/Makefile Sat Jun 10 13:26:12 2000
-@@ -19,9 +19,9 @@
- HDRS=freeswan.h internal.h
- LIB=libfreeswan.a
- # Original flags
--CFLAGS=-O3 -I.
-+CFLAGS=$(OPT_FLAGS) -I.
- # Add debugging symbols
--CFLAGS+= -g
-+#CFLAGS+= -g
- CFLAGS+= -Wall
- #CFLAGS+= -Wconversion
- #CFLAGS+= -Wmissing-prototypes
-@@ -36,9 +36,9 @@
- CFLAGS+= -Wbad-function-cast
-
- ARFLAGS=crvs
--EXTHDRS=des.h gmp.h
--EXTLIBS=libdes.a libgmp.a
--MANTREE=/usr/local/man
-+EXTHDRS=des.h
-+EXTLIBS=libdes.a
-+MANTREE=/usr/share/man
- MANDIR=$(MANTREE)/man3
- MANS=atoaddr.3 atoasr.3 atodata.3 atosa.3 atoul.3 goodmask.3 optionsfrom.3 \
- subnetof.3
-@@ -50,11 +50,11 @@
- all: $(EXTHDRS) $(LIB) $(EXTLIBS)
-
- install:
-- mkdir -p $(MANDIR)
-+ mkdir -p $(DESTDIR)$(MANDIR)
- for f in $(MANS) ; \
- do \
-- $(INSTALL) $$f $(MANDIR)/ipsec_$$f || exit 1 ; \
-- ../utils/manlink $(MANDIR) ipsec_$$f ; \
-+ $(INSTALL) $$f $(DESTDIR)$(MANDIR)/ipsec_$$f || exit 1 ; \
-+ ../utils/manlink $(DESTDIR)$(MANDIR) ipsec_$$f ; \
- done
-
- $(LIB): $(OBJS)
-diff -durN freeswan-1.4.orig/libdes/Makefile freeswan-1.4/libdes/Makefile
---- freeswan-1.4.orig/libdes/Makefile Thu Nov 25 18:04:25 1999
-+++ freeswan-1.4/libdes/Makefile Sat Jun 10 13:26:12 2000
-@@ -46,7 +46,7 @@
-
- CC=gcc
- #CFLAG= -O4 -funroll-loops -fomit-frame-pointer
--CFLAG= -O3 -fomit-frame-pointer
-+CFLAG= $(OPT_FLAGS) -fomit-frame-pointer
-
- CFLAGS=$(OPTS) $(CFLAG)
- CPP=$(CC) -E
-@@ -59,10 +59,10 @@
- #DES_ENC=asm/dx86-sol.o asm/yx86-sol.o # solaris format x86
- #DES_ENC=asm/dx86bsdi.o asm/yx86basi.o # bsdi format x86
+- fi ; done ; echo $(INC_RCDEFAULT) )
++FINALRCDIR=/etc/rc.d/init.d
+ RCDIR=$(DESTDIR)$(FINALRCDIR)
--LIBDIR=/usr/local/lib
--BINDIR=/usr/local/bin
--INCDIR=/usr/local/include
--MANDIR=/usr/local/man
-+LIBDIR=/usr/lib
-+BINDIR=/usr/bin
-+INCDIR=/usr/include
-+MANDIR=/usr/man
- MAN1=1
- MAN3=3
- SHELL=/bin/sh
-@@ -231,20 +231,16 @@
- chmod 644 $(INSTALLTOP)/include/des.h; \
- else \
- echo Standalone install; \
-- cp $(DLIB) $(LIBDIR)/$(DLIB); \
-+ cp $(DLIB) $(DESTDIR)$(LIBDIR)/$(DLIB); \
- if test -s /bin/ranlib; then \
-- /bin/ranlib $(LIBDIR)/$(DLIB); \
-+ /bin/ranlib $(DESTDIR)$(LIBDIR)/$(DLIB); \
- else \
- if test -s /usr/bin/ranlib; then \
-- /usr/bin/ranlib $(LIBDIR)/$(DLIB); \
-+ /usr/bin/ranlib $(DESTDIR)$(LIBDIR)/$(DLIB); \
- fi; \
- fi; \
-- chmod 644 $(LIBDIR)/$(DLIB); \
-- cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
-- chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
-- cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
-- chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
-- cp des.h $(INCDIR)/des.h; \
-- chmod 644 $(INCDIR)/des.h; \
-+ cp des_crypt.man $(DESTDIR)$(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
-+ cp des.man $(DESTDIR)$(MANDIR)/man$(MAN1)/des.$(MAN1); \
-+ cp des.h $(DESTDIR)$(INCDIR)/des.h; \
- fi
- # DO NOT DELETE THIS LINE -- make depend depends on it.
-diff -durN freeswan-1.4.orig/pluto/Makefile freeswan-1.4/pluto/Makefile
---- freeswan-1.4.orig/pluto/Makefile Mon May 22 06:37:44 2000
-+++ freeswan-1.4/pluto/Makefile Sat Jun 10 13:26:12 2000
-@@ -19,10 +19,10 @@
- CC = gcc
- # directory in which to install programs
--BINDIR=/usr/local/lib/ipsec
-+BINDIR=/usr/lib/ipsec
+@@ -124,8 +121,8 @@
- # directory in which to install man pages
--MANTREE=/usr/local/man
-+MANTREE=/usr/share/man
- FMANDIR=$(MANTREE)/man5
- PMANDIR=$(MANTREE)/man8
+ # extra compile flags, for userland and kernel stuff, e.g. -g for debug info
+ # (caution, this stuff is still being sorted out, will change in future)
+-USERCOMPILE=-g -O3
+-KLIPSCOMPILE=-O3
++USERCOMPILE=$(OPT_FLAGS)
++KLIPSCOMPILE=$(OPT_FLAGS)
-@@ -37,7 +37,7 @@
- INSTALL=install
-
- # -O on Linux makes gcc coredump when compiling sha1.c
--CFLAGS = -g -Wall -W -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast \
-+CFLAGS = $(OPT_FLAGS) -Wall -W -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast \
- -Wcast-qual -Wmissing-declarations -Wwrite-strings -Wstrict-prototypes
-
- # where to find klips headers and FreeS/WAN headers
-@@ -74,7 +74,7 @@
+ # extra options for use in kernel build
+ KERNMAKEOPTS=
+diff -Naur freeswan-1.95/pluto/Makefile freeswan-1.95-p/pluto/Makefile
+--- freeswan-1.95/pluto/Makefile Tue Nov 27 17:33:42 2001
++++ freeswan-1.95-p/pluto/Makefile Thu Feb 7 19:26:29 2002
+@@ -71,7 +71,8 @@
CPPFLAGS = $(HDRDIRS) $(BYTE_ORDER) \
- -DPLUTO -DKLIPS -DDODGE_DH_MISSING_ZERO_BUG -DOLD_RESOLVER \
-- -DDEBUG -DGCC_LINT
+ -DPLUTO -DKLIPS -DDODGE_DH_MISSING_ZERO_BUG \
+- -DDEBUG -DGCC_LINT # -DLEAK_DETECTIVE
+ -DDEBUG -DGCC_LINT -DSHARED_SECRETS_FILE='"/etc/freeswan/ipsec.secrets"'
++ # -DLEAK_DETECTIVE
ALLFLAGS = $(CPPFLAGS) $(CFLAGS)
-@@ -143,7 +143,7 @@
- OBJSPLUTO = connections.o constants.o cookie.o crypto.o defs.o log.o \
- state.o main.o server.o timer.o id.o ipsec_doi.o kernel.o \
- kernel_comm.o demux.o packet.o preshared.o dnskey.o rnd.o spdb.o \
-- sha1.o md5.o $(OBJSGCRYPT) $(LIBDESLITE) $(LIBGMP) $(FREESWANLIB)
-+ sha1.o md5.o $(OBJSGCRYPT) $(LIBDESLITE) $(FREESWANLIB)
-
- OBJSWHACK = whack.o $(FREESWANLIB)
-
-@@ -157,7 +157,7 @@
- ../utils/manlink $(FMANDIR) ipsec.secrets.5
-
- $(BINNAMEPLUTO): $(OBJSPLUTO)
-- $(CC) -o $(BINNAMEPLUTO) $(LDFLAGS) $(OBJSPLUTO) $(LIBSPLUTO)
-+ $(CC) -o $(BINNAMEPLUTO) $(LDFLAGS) $(OBJSPLUTO) $(LIBSPLUTO) -lgmp
-
- $(BINNAMEWHACK): $(OBJSWHACK)
- $(CC) -o $(BINNAMEWHACK) $(OBJSWHACK) $(LIBSWHACK)
-diff -durN freeswan-1.4.orig/utils/Makefile freeswan-1.4/utils/Makefile
---- freeswan-1.4.orig/utils/Makefile Mon May 22 06:37:54 2000
-+++ freeswan-1.4/utils/Makefile Sat Jun 10 13:26:12 2000
-@@ -14,13 +14,13 @@
- # RCSID $Id$
-
- # pathnames, subject to overrides from main Makefile
--PUBDIR=/usr/local/sbin
--PRIVDIR=/usr/local/lib/ipsec
--REALPRIVDIR=/usr/local/lib/ipsec
-+PUBDIR=/usr/sbin
-+PRIVDIR=/usr/lib/ipsec
-+REALPRIVDIR=/usr/lib/ipsec
- RCDIR=/etc/rc.d/init.d
- REALRCDIR=/etc/rc.d/init.d
--CONFDIR=/etc
--MANTREE=/usr/local/man
-+CONFDIR=/etc/freeswan
-+MANTREE=/usr/share/man
-
- FMANDIR=$(MANTREE)/man5
- CMANDIR=$(MANTREE)/man8
-@@ -53,7 +53,7 @@
- $(CC) $(CFLAGS) ranbits.o $(LIB) -o $@
-
- rsasigkey: rsasigkey.o
-- $(CC) $(CFLAGS) rsasigkey.o $(LIB) ../lib/libgmp.a -o $@
-+ $(CC) $(CFLAGS) rsasigkey.o $(LIB) -lgmp -o $@
-
- man_xref: man_xref.o
- $(CC) $(CFLAGS) man_xref.o $(LIB) -o $@