Blob Blame Raw
Index: racoon2-20100526a/iked/Makefile.in
===================================================================
--- racoon2-20100526a.orig/iked/Makefile.in
+++ racoon2-20100526a/iked/Makefile.in
@@ -29,7 +29,7 @@ INSTALL_DATA =	@INSTALL_DATA@
 LDFLAGS =	@LDFLAGS@
 CPPFLAGS =	-I. -I./missing
 CPPFLAGS +=	@CPPFLAGS@
-CPPFLAGS += -DSYSCONFDIR=\"${sysconfdir}\"
+CPPFLAGS += -DRACOON2_CONFIG_DIR=\"${sysconfdir}/racoon2\"
 CPPFLAGS += -DDEBUG
 CPPFLAGS += -DDEBUG_TRACE
 # CPPFLAGS += -DSELFTEST
@@ -66,11 +66,12 @@ all:  $(PROG) $(TESTPROG)
 install: install-prog install-doc
 
 install-prog: $(PROG)
-	$(INSTALL) -d $(sbindir)
-	$(INSTALL_PROGRAM) $(PROG) $(sbindir)
+	$(INSTALL) -d $(DESTDIR)$(sbindir)
+	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)
+	$(INSTALL_DATA) $(PROG).8 $(DESTDIR)$(mandir)/man8
 
 install-doc:
-	$(INSTALL) -d $(mandir)/man8
+	$(INSTALL) -d $(DESTDIR)$(mandir)/man8
 # not friendly with -n  :-(
 	sysconfdir="$$(echo '$(sysconfdir)' | sed 's/%/\\\%/g')"; \
 	for f in $(MAN); do \
Index: racoon2-20100526a/lib/Makefile.in
===================================================================
--- racoon2-20100526a.orig/lib/Makefile.in
+++ racoon2-20100526a/lib/Makefile.in
@@ -11,7 +11,7 @@ MKDEP = @MKDEP@
 
 LDFLAGS	= @LDFLAGS@
 CFLAGS	= @CFLAGS@ @CPPFLAGS@ @OPTFLAG@ @DEFS@
-CFLAGS	+=-DSYSCONFDIR=\"${sysconfdir}\"
+CFLAGS	+=-DRACOON2_CONFIG_DIR=\"${sysconfdir}/racoon2\"
 CFLAGS	+=-DCF_DEBUG
 # CFLAGS  +=-DSADB_X_MIGRATE
 YFLAGS	+=-d
Index: racoon2-20100526a/lib/racoon.h
===================================================================
--- racoon2-20100526a.orig/lib/racoon.h
+++ racoon2-20100526a/lib/racoon.h
@@ -42,7 +42,7 @@
 #include "script.h"
 #include "missing/missing.h"
 
-#define RACOON_CONF	SYSCONFDIR "/racoon2.conf"
+#define RACOON_CONF	RACOON2_CONFIG_DIR "/racoon2.conf"
 
 extern int rct2isakmp_exmode (int);
 extern int rct2app_action (int);
Index: racoon2-20100526a/samples/Makefile.in
===================================================================
--- racoon2-20100526a.orig/samples/Makefile.in
+++ racoon2-20100526a/samples/Makefile.in
@@ -12,60 +12,60 @@ INSTALL_SCRIPT=@INSTALL_SCRIPT@
 all:
 
 install: all install-startup-@startup_scripts@ install-samples install-hook
-	$(INSTALL) -d -o 0 -g 0 -m 700 /var/run/racoon2
+	$(INSTALL) -d -m 700 $(DESTDIR)/var/run/racoon2
 
 install-samples:
-	$(INSTALL) -d $(sysconfdir)
-	$(INSTALL) -m 600 racoon2.conf $(sysconfdir)/racoon2.conf.sample
-	$(INSTALL) -m 600 vals.conf $(sysconfdir)/vals.conf.sample
-	$(INSTALL) -m 600 default.conf $(sysconfdir)/default.conf.sample
-	$(INSTALL) -m 600 transport_ike.conf $(sysconfdir)/transport_ike.conf.sample
-	$(INSTALL) -m 600 tunnel_ike.conf $(sysconfdir)/tunnel_ike.conf.sample
-	$(INSTALL) -m 600 tunnel_ike_natt.conf $(sysconfdir)/tunnel_ike_natt.conf.sample
-	$(INSTALL) -m 600 transport_kink.conf $(sysconfdir)/transport_kink.conf.sample
-	$(INSTALL) -m 600 tunnel_kink.conf $(sysconfdir)/tunnel_kink.conf.sample
-	$(INSTALL) -m 600 local-test.conf $(sysconfdir)/local-test.conf.sample
-	$(INSTALL) -d -m 700 $(sysconfdir)/psk
-	$(INSTALL) -d -m 700 $(sysconfdir)/cert
+	$(INSTALL) -d -m 700 $(DESTDIR)$(sysconfdir)/racoon2
+	$(INSTALL_DATA) racoon2.conf $(DESTDIR)$(sysconfdir)/racoon2/racoon2.conf
+	$(INSTALL_DATA) vals.conf $(DESTDIR)$(sysconfdir)/racoon2/vals.conf
+	$(INSTALL_DATA) default.conf $(DESTDIR)$(sysconfdir)/racoon2/default.conf
+	$(INSTALL_DATA) transport_ike.conf $(DESTDIR)$(sysconfdir)/racoon2/transport_ike.conf
+	$(INSTALL_DATA) tunnel_ike.conf $(DESTDIR)$(sysconfdir)/racoon2/tunnel_ike.conf
+	$(INSTALL_DATA) tunnel_ike_natt.conf $(DESTDIR)$(sysconfdir)/racoon2/tunnel_ike_natt.conf
+	$(INSTALL_DATA) transport_kink.conf $(DESTDIR)$(sysconfdir)/racoon2/transport_kink.conf
+	$(INSTALL_DATA) tunnel_kink.conf $(DESTDIR)$(sysconfdir)/racoon2/tunnel_kink.conf
+	$(INSTALL_DATA) local-test.conf $(DESTDIR)$(sysconfdir)/racoon2/local-test.conf
+	$(INSTALL) -d -m 700 $(DESTDIR)$(sysconfdir)/racoon2/psk
+	$(INSTALL) -d -m 700 $(DESTDIR)$(sysconfdir)/racoon2/cert
 
 install-startup-rc-d:
-	$(INSTALL) -d $(sysconfdir)/rc.d
-	$(INSTALL_SCRIPT) rc.d-iked $(sysconfdir)/rc.d/iked
-	$(INSTALL_SCRIPT) rc.d-kinkd $(sysconfdir)/rc.d/kinkd
-	$(INSTALL_SCRIPT) rc.d-spmd $(sysconfdir)/rc.d/spmd
-	$(INSTALL_SCRIPT) rc.d-racoon2 $(sysconfdir)/rc.d/racoon2
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/rc.d
+	$(INSTALL_SCRIPT) rc.d-iked $(DESTDIR)$(sysconfdir)/rc.d/iked
+	$(INSTALL_SCRIPT) rc.d-kinkd $(DESTDIR)$(sysconfdir)/rc.d/kinkd
+	$(INSTALL_SCRIPT) rc.d-spmd $(DESTDIR)$(sysconfdir)/rc.d/spmd
+	$(INSTALL_SCRIPT) rc.d-racoon2 $(DESTDIR)$(sysconfdir)/rc.d/racoon2
 
 install-startup-init-d:
-	$(INSTALL) -d $(sysconfdir)/init.d
-	$(INSTALL_SCRIPT) init.d-iked $(sysconfdir)/init.d/iked
-	$(INSTALL_SCRIPT) init.d-kinkd $(sysconfdir)/init.d/kinkd
-	$(INSTALL_SCRIPT) init.d-spmd $(sysconfdir)/init.d/spmd
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/rc.d/init.d
+	$(INSTALL_SCRIPT) init.d-iked $(DESTDIR)$(sysconfdir)/rc.d/init.d/racoon2-iked
+	$(INSTALL_SCRIPT) init.d-kinkd $(DESTDIR)$(sysconfdir)/rc.d/init.d/racoon2-kinkd
+	$(INSTALL_SCRIPT) init.d-spmd $(DESTDIR)$(sysconfdir)/rc.d/init.d/racoon2-spmd
 
 install-startup-none:
 
 install-hook:
-	$(INSTALL) -d $(sysconfdir)/hook
-	$(INSTALL_DATA) functions $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/ikesa-up.d
-	$(INSTALL_SCRIPT) ikesa-up $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/ikesa-down.d
-	$(INSTALL_SCRIPT) ikesa-down $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/ikesa-rekey.d
-	$(INSTALL_SCRIPT) ikesa-rekey $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/child-up.d
-	$(INSTALL_SCRIPT) child-up $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/child-down.d
-	$(INSTALL_SCRIPT) child-down $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/child-rekey.d
-	$(INSTALL_SCRIPT) child-rekey $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/migration.d
-	$(INSTALL_SCRIPT) migration $(sysconfdir)/hook
-	$(INSTALL_SCRIPT) 00ikesaup_sample $(sysconfdir)/hook/ikesa-up.d
-	$(INSTALL_SCRIPT) 00childup_sample $(sysconfdir)/hook/child-up.d
-	$(INSTALL) -d $(sysconfdir)/hook/ph1-up.d
-	$(INSTALL_SCRIPT) ph1-up $(sysconfdir)/hook
-	$(INSTALL) -d $(sysconfdir)/hook/ph1-down.d
-	$(INSTALL_SCRIPT) ph1-down $(sysconfdir)/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL_DATA) functions $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/ikesa-up.d
+	$(INSTALL_SCRIPT) ikesa-up $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/ikesa-down.d
+	$(INSTALL_SCRIPT) ikesa-down $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/ikesa-rekey.d
+	$(INSTALL_SCRIPT) ikesa-rekey $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/child-up.d
+	$(INSTALL_SCRIPT) child-up $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/child-down.d
+	$(INSTALL_SCRIPT) child-down $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/child-rekey.d
+	$(INSTALL_SCRIPT) child-rekey $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/migration.d
+	$(INSTALL_SCRIPT) migration $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL_SCRIPT) 00ikesaup_sample $(DESTDIR)$(sysconfdir)/racoon2/hook/ikesa-up.d
+	$(INSTALL_SCRIPT) 00childup_sample $(DESTDIR)$(sysconfdir)/racoon2/hook/child-up.d
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/ph1-up.d
+	$(INSTALL_SCRIPT) ph1-up $(DESTDIR)$(sysconfdir)/racoon2/hook
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2/hook/ph1-down.d
+	$(INSTALL_SCRIPT) ph1-down $(DESTDIR)$(sysconfdir)/racoon2/hook
 
 # empty
 depend:
Index: racoon2-20100526a/spmd/Makefile.in
===================================================================
--- racoon2-20100526a.orig/spmd/Makefile.in
+++ racoon2-20100526a/spmd/Makefile.in
@@ -1,6 +1,6 @@
 CC = @CC@
 MKDEP = @MKDEP@
-CFLAGS = @CFLAGS@ @CPPFLAGS@ @DEFS@ -DSYSCONFDIR=\"${sysconfdir}\" 
+CFLAGS = @CFLAGS@ @CPPFLAGS@ @DEFS@ -DRACOON2_CONFIG_DIR=\"${sysconfdir}/racoon2\"
 # CFLAGS +=-DSADB_X_MIGRATE
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
@@ -38,11 +38,11 @@ spmdctl: spmdctl.o ../lib/libracoon.a
 spmdctl.o: spmd_internal.h
 
 install: all
-	$(INSTALL_DIR) $(sbindir)
-	$(INSTALL_PROGRAM) $(DAEMON) $(sbindir)
-	$(INSTALL_PROGRAM) $(COMMAND) $(sbindir)
-	$(INSTALL_DIR) $(man8dir)
-	$(INSTALL_DATA) $(MANFILES) $(man8dir)
+	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
+	$(INSTALL_PROGRAM) $(DAEMON) $(DESTDIR)$(sbindir)
+	$(INSTALL_PROGRAM) $(COMMAND) $(DESTDIR)$(sbindir)
+	$(INSTALL_DIR) $(DESTDIR)$(man8dir)
+	$(INSTALL_DATA) $(MANFILES) $(DESTDIR)$(man8dir)
 
 clean:
 	-rm -f $(TARGET) *.o $(COMMAND)
Index: racoon2-20100526a/pskgen/Makefile.in
===================================================================
--- racoon2-20100526a.orig/pskgen/Makefile.in
+++ racoon2-20100526a/pskgen/Makefile.in
@@ -17,10 +17,10 @@ PROG=pskgen
 all:
 
 install: all
-	$(INSTALL) -d $(sbindir)
-	$(INSTALL_SCRIPT) $(PROG) $(sbindir)
-	$(INSTALL_DATA) $(PROG).8 $(mandir)/man8
-	$(INSTALL) -d $(prefix)/etc/racoon2
+	$(INSTALL) -d $(DESTDIR)$(sbindir)
+	$(INSTALL_SCRIPT) $(PROG) $(DESTDIR)$(sbindir)
+	$(INSTALL_DATA) $(PROG).8 $(DESTDIR)$(mandir)/man8
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/racoon2
 	sh ./autogen.spmd.pwd
 
 depend:
Index: racoon2-20100526a/spmd/spmd_internal.h
===================================================================
--- racoon2-20100526a.orig/spmd/spmd_internal.h
+++ racoon2-20100526a/spmd/spmd_internal.h
@@ -35,7 +35,7 @@ extern char spmd_version[];
 
 extern int spmd_foreground;
 
-#define RACOON2_CONFIG_FILE SYSCONFDIR"/racoon2.conf"
+#define RACOON2_CONFIG_FILE RACOON2_CONFIG_DIR "/racoon2.conf"
 
 #if defined(HAVE_NSSWITCH_CONF)
 # define NSSWITCH_CONF_FILE "/etc/nsswitch.conf"