2006-01-23 22:43:28 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# ipsec-tools
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
2009-06-22 13:21:38 +02:00
|
|
|
IPSEC_TOOLS_VERSION:=0.7.2
|
2007-07-11 16:06:06 +02:00
|
|
|
IPSEC_TOOLS_SOURCE:=ipsec-tools-$(IPSEC_TOOLS_VERSION).tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
IPSEC_TOOLS_CAT:=$(BZCAT)
|
2007-07-11 16:06:06 +02:00
|
|
|
IPSEC_TOOLS_DIR:=$(BUILD_DIR)/ipsec-tools-$(IPSEC_TOOLS_VERSION)
|
2006-01-23 22:43:28 +01:00
|
|
|
|
|
|
|
IPSEC_TOOLS_BINARY_SETKEY:=src/setkey/setkey
|
|
|
|
IPSEC_TOOLS_BINARY_RACOON:=src/racoon/racoon
|
|
|
|
IPSEC_TOOLS_BINARY_RACOONCTL:=src/racoon/racoonctl
|
|
|
|
|
|
|
|
IPSEC_TOOLS_TARGET_BINARY_SETKEY:=usr/sbin/setkey
|
|
|
|
IPSEC_TOOLS_TARGET_BINARY_RACOON:=usr/sbin/racoon
|
|
|
|
IPSEC_TOOLS_TARGET_BINARY_RACOONCTL:=usr/sbin/racoonctl
|
2009-06-22 13:21:38 +02:00
|
|
|
IPSEC_TOOLS_SITE=http://ftp.sunet.se/pub/NetBSD/misc/ipsec-tools/0.7/
|
2006-01-23 22:43:28 +01:00
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_ADMINPORT), y)
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-adminport
|
2006-01-23 22:43:28 +01:00
|
|
|
else
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --disable-adminport
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_NATT), y)
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-natt
|
2006-01-23 22:43:28 +01:00
|
|
|
else
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --disable-natt
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_FRAG), y)
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-frag
|
2006-01-23 22:43:28 +01:00
|
|
|
else
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --disable-frag
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_STATS), y)
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-stats
|
2006-01-23 22:43:28 +01:00
|
|
|
else
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --disable-stats
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
2007-06-26 19:45:08 +02:00
|
|
|
ifeq ($(BR2_INET_IPV6),y)
|
2006-01-23 22:43:28 +01:00
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_IPV6), y)
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-ipv6
|
2006-01-23 22:43:28 +01:00
|
|
|
else
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= $(DISABLE_IPV6)
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
else # ignore user's choice if it doesn't
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= $(DISABLE_IPV6)
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifneq ($(BR2_PACKAGE_IPSEC_TOOLS_READLINE), y)
|
2007-08-22 14:35:41 +02:00
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --without-readline
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
2009-06-22 13:21:38 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_SECCTX_DISABLE),y)
|
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-security-context=no
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_SECCTX_ENABLE),y)
|
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-security-context=yes
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_SECCTX_KERNEL),y)
|
|
|
|
IPSEC_TOOLS_CONFIG_FLAGS+= --enable-security-context=kernel
|
|
|
|
endif
|
|
|
|
|
2006-01-23 22:43:28 +01:00
|
|
|
$(DL_DIR)/$(IPSEC_TOOLS_SOURCE):
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(IPSEC_TOOLS_SITE),$(IPSEC_TOOLS_SOURCE))
|
2006-01-23 22:43:28 +01:00
|
|
|
|
2007-06-25 11:41:35 +02:00
|
|
|
$(IPSEC_TOOLS_DIR)/.patched: $(DL_DIR)/$(IPSEC_TOOLS_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(IPSEC_TOOLS_CAT) $(DL_DIR)/$(IPSEC_TOOLS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2007-07-11 16:06:06 +02:00
|
|
|
toolchain/patch-kernel.sh $(IPSEC_TOOLS_DIR) package/ipsec-tools ipsec-tools-$(IPSEC_TOOLS_VERSION)\*.patch
|
2007-06-25 11:41:35 +02:00
|
|
|
$(CONFIG_UPDATE) $(IPSEC_TOOLS_DIR)
|
|
|
|
touch $@
|
2006-01-23 22:43:28 +01:00
|
|
|
|
2007-06-25 11:41:35 +02:00
|
|
|
$(IPSEC_TOOLS_DIR)/.configured: $(IPSEC_TOOLS_DIR)/.patched
|
2007-08-22 11:56:41 +02:00
|
|
|
( cd $(IPSEC_TOOLS_DIR); rm -rf config.cache; \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2009-10-01 21:24:42 +02:00
|
|
|
./configure $(QUIET) \
|
2006-01-23 22:43:28 +01:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--disable-hybrid \
|
|
|
|
--without-libpam \
|
|
|
|
--disable-gssapi \
|
2007-06-25 11:41:35 +02:00
|
|
|
--with-kernel-headers=$(STAGING_DIR)/usr/include \
|
2006-01-23 22:43:28 +01:00
|
|
|
$(IPSEC_TOOLS_CONFIG_FLAGS) \
|
2007-08-22 14:35:41 +02:00
|
|
|
)
|
2007-06-25 11:41:35 +02:00
|
|
|
# simpler than patching that cruft..
|
2007-08-22 11:56:41 +02:00
|
|
|
(echo '#undef bzero'; \
|
|
|
|
echo '#define bzero(a, b) memset((a), 0, (b))'; \
|
|
|
|
echo '#undef bcopy'; \
|
|
|
|
echo '#define bcopy(src, dest, len) memmove(dest, src, len)'; \
|
|
|
|
echo '#undef index'; \
|
|
|
|
echo '#define index(a, b) strchr(a, b)'; \
|
2007-06-25 11:41:35 +02:00
|
|
|
) >> $(IPSEC_TOOLS_DIR)/config.h
|
|
|
|
touch $@
|
2006-01-23 22:43:28 +01:00
|
|
|
|
|
|
|
$(IPSEC_TOOLS_DIR)/$(IPSEC_TOOLS_BINARY_SETKEY) \
|
|
|
|
$(IPSEC_TOOLS_DIR)/$(IPSEC_TOOLS_BINARY_RACOON) \
|
|
|
|
$(IPSEC_TOOLS_DIR)/$(IPSEC_TOOLS_BINARY_RACOONCTL): \
|
|
|
|
$(IPSEC_TOOLS_DIR)/.configured
|
2007-11-29 14:06:42 +01:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(IPSEC_TOOLS_DIR)
|
2007-08-22 14:35:41 +02:00
|
|
|
|
2006-01-23 22:43:28 +01:00
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_SETKEY) \
|
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOON) \
|
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOONCTL): \
|
|
|
|
$(IPSEC_TOOLS_DIR)/$(IPSEC_TOOLS_BINARY_SETKEY) \
|
|
|
|
$(IPSEC_TOOLS_DIR)/$(IPSEC_TOOLS_BINARY_RACOON) \
|
2007-08-22 14:35:41 +02:00
|
|
|
$(IPSEC_TOOLS_DIR)/$(IPSEC_TOOLS_BINARY_RACOONCTL)
|
2006-08-28 15:46:38 +02:00
|
|
|
$(MAKE) -C $(IPSEC_TOOLS_DIR) DESTDIR=$(TARGET_DIR) install
|
2007-10-01 18:15:31 +02:00
|
|
|
$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(REMOVE_SECTION_COMMENT) \
|
2007-08-21 03:53:57 +02:00
|
|
|
$(REMOVE_SECTION_NOTE) \
|
2006-01-23 22:43:28 +01:00
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_SETKEY) \
|
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOON) \
|
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOONCTL)
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_LIBS), y)
|
2007-09-23 11:56:21 +02:00
|
|
|
install -D $(addprefix $(IPSEC_TOOLS_DIR)/src/, \
|
2007-09-17 14:30:31 +02:00
|
|
|
libipsec/.libs/libipsec.a libipsec/.libs/libipsec.la \
|
|
|
|
racoon/.libs/libracoon.a racoon/.libs/libracoon.la) \
|
|
|
|
$(STAGING_DIR)/lib
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
2008-12-08 09:15:27 +01:00
|
|
|
ifneq ($(BR2_PACKAGE_IPSEC_TOOLS_ADMINPORT), y)
|
2007-09-17 14:30:31 +02:00
|
|
|
rm -f $(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOONCTL)
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
IPSEC_TOOLS_PROGS= $(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_SETKEY) \
|
|
|
|
$(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOON)
|
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_ADMINPORT), y)
|
2006-01-23 22:43:28 +01:00
|
|
|
IPSEC_TOOLS_PROGS+= $(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOONCTL)
|
|
|
|
endif
|
|
|
|
|
2010-02-24 20:14:56 +01:00
|
|
|
ipsec-tools: openssl flex host-flex $(IPSEC_TOOLS_PROGS)
|
2006-01-23 22:43:28 +01:00
|
|
|
|
|
|
|
ipsec-tools-source: $(DL_DIR)/$(IPSEC_TOOLS_SOURCE)
|
|
|
|
|
|
|
|
ipsec-tools-uninstall:
|
|
|
|
|
|
|
|
ipsec-tools-clean:
|
2008-03-27 16:42:42 +01:00
|
|
|
-$(MAKE) -C $(IPSEC_TOOLS_DIR) DESTDIR=$(TARGET_DIR) uninstall
|
|
|
|
-$(MAKE) -C $(IPSEC_TOOLS_DIR) clean
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_LIBS),y)
|
2007-09-17 14:30:31 +02:00
|
|
|
rm -f $(addprefix $(STAGING_DIR)/lib/, \
|
|
|
|
libipsec.a libipsec.la libracoon.a libracoon.la)
|
2006-01-23 22:43:28 +01:00
|
|
|
endif
|
2007-09-17 14:30:31 +02:00
|
|
|
rm -f $(IPSEC_TOOLS_DIR)/.configured
|
2006-01-23 22:43:28 +01:00
|
|
|
|
|
|
|
ipsec-tools-dirclean:
|
2007-09-17 14:30:31 +02:00
|
|
|
rm -rf $(IPSEC_TOOLS_DIR)
|
2006-01-23 22:43:28 +01:00
|
|
|
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_IPSEC_TOOLS), y)
|
2006-01-23 22:43:28 +01:00
|
|
|
TARGETS+=ipsec-tools
|
2007-08-22 14:35:41 +02:00
|
|
|
endif
|