#
-# Copyright (C) 2009-2010 OpenWrt.org
+# Copyright (C) 2009-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=openl2tp
PKG_VERSION:=1.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/openl2tp
PKG_MD5SUM:=e3d08dedfb9e6a9a1e24f6766f6dadd0
-PKG_BUILD_DEPENDS:=libreadline libncurses
+PKG_BUILD_DEPENDS:=libreadline libncurses USE_UCLIBC:librpc
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PPPD_VERSION:=2.4.4
include $(INCLUDE_DIR)/package.mk
-define Build/Prepare
- $(call Build/Prepare/Default)
- $(CP) ./src/*.[ch] $(PKG_BUILD_DIR)/
-endef
-
-define Package/openl2tp
+define Package/openl2tp/Default
+ SUBMENU:=VPN
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+ppp +kmod-pppol2tp +portmap +libreadline +libncurses \
- @!LINUX_2_4 $(LIBRPC_DEPENDS)
TITLE:=An L2TP (Layer 2 Tunneling Protocol) daemon
URL:=http://www.openl2tp.org/
- SUBMENU:=VPN
+ PROVIDES:=openl2tp
+ DEPENDS:=+ppp +kmod-pppol2tp
endef
-define Package/openl2tp/description
+define Package/openl2tp/description/Default
OpenL2TP is an open source L2TP client/server, written by Katalix Systems
specifically for Linux. It has been designed for use as an enterprise
L2TP VPN server or in commercial, Linux-based, embedded networking
configuration.
endef
+
+define Package/openl2tp-full
+$(call Package/openl2tp/Default)
+ TITLE+=(full)
+ VARIANT:=full
+ DEPENDS+=+portmap +libreadline +libncurses $(LIBRPC_DEPENDS)
+endef
+
+define Package/openl2tp-full/description
+$(call Package/openl2tp/description/Default)
+ .
+ This package a full-featured, RPC-enabled OpenL2TP.
+endef
+
+
+define Package/openl2tp-mini
+$(call Package/openl2tp/Default)
+ TITLE+=(mini)
+ VARIANT:=mini
+endef
+
+define Package/openl2tp-mini/description
+$(call Package/openl2tp/description/Default)
+ .
+ This package a minimal-featured, RPC-disabled OpenL2TP.
+endef
+
+
MAKE_FLAGS+= \
KERNEL_SRCDIR="$(LINUX_DIR)" \
KERNEL_BLDDIR="$(LINUX_DIR)" \
READLINE_DIR="$(STAGING_DIR)/usr" \
PPPD_SRCDIR="$(STAGING_DIR)/usr/include" \
PPPD_LIBDIR="$(STAGING_DIR)/usr/lib" \
- CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
- LIBS.dmalloc="-L$(STAGING_DIR)/usr/lib $(LIBRPC)"
+ CFLAGS.optimize="$(TARGET_CFLAGS)" \
+ CPPFLAGS-y="-I$(STAGING_DIR)/usr/include" \
+ L2TP_FEATURE_LOCAL_CONF_FILE=y \
+
+ifeq ($(BUILD_VARIANT),full)
-define Package/openl2tp/install
+ MAKE_FLAGS += \
+ L2TP_FEATURE_RPC_MANAGEMENT=y \
+ L2TP_FEATURE_LOCAL_STAT_FILE=y \
+ LIBS.dmalloc="-L$(STAGING_DIR)/usr/lib $(LIBRPC)" \
+
+endif
+ifeq ($(BUILD_VARIANT),mini)
+
+ MAKE_FLAGS += \
+ L2TP_FEATURE_RPC_MANAGEMENT= \
+ L2TP_FEATURE_LOCAL_STAT_FILE= \
+
+endif
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(CP) ./src/*.[ch] $(PKG_BUILD_DIR)/
+endef
+
+define Package/openl2tp-full/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/l2tpconfig $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_unix.so $(1)/usr/lib/openl2tp/
endef
-$(eval $(call BuildPackage,openl2tp))
+define Package/openl2tp-mini/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/openl2tpd $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PPPD_VERSION)
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/pppd/pppol2tp.so $(1)/usr/lib/pppd/$(PPPD_VERSION)/
+ $(INSTALL_DIR) $(1)/usr/lib/openl2tp
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ipsec.so $(1)/usr/lib/openl2tp/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_unix.so $(1)/usr/lib/openl2tp/
+endef
+
+$(eval $(call BuildPackage,openl2tp-full))
+$(eval $(call BuildPackage,openl2tp-mini))
--- a/Makefile
+++ b/Makefile
-@@ -8,7 +8,7 @@ L2TP_FEATURE_LAIC_SUPPORT= y
- L2TP_FEATURE_LAOC_SUPPORT= y
- L2TP_FEATURE_LNIC_SUPPORT= y
- L2TP_FEATURE_LNOC_SUPPORT= y
--L2TP_FEATURE_LOCAL_CONF_FILE= y
-+#L2TP_FEATURE_LOCAL_CONF_FILE= y
- #L2TP_FEATURE_LOCAL_STAT_FILE= y
-
- # Define USE_DMALLOC to enable dmalloc memory debugging
-@@ -55,17 +55,17 @@ endif
- # in the pppd subdirectory of the compiler's default search path
- # (e.g. /usr/include/pppd). but can be pointed to another directory if
- # desired.
--PPPD_VERSION= 2.4.5
-+#PPPD_VERSION= 2.4.5
- # PPPD_INCDIR= /usr/include/pppd
- # PPPD_LIBDIR= $(SYS_LIBDIR)/pppd/$(PPPD_VERSION)
-
- # Points to readline install root. READLINE_DIR should have lib/ &
- # include/ subdirs If not defined, readline is assumed to be installed
- # in the standard places that the compiler looks.
--READLINE_DIR=
-+#READLINE_DIR=
-
- # For cross-compiling
--CROSS_COMPILE=
-+#CROSS_COMPILE=
-
- # END CONFIGURABLE SETTINGS
-
@@ -158,7 +158,7 @@ CFLAGS= -I. -Iusl -Icli -isystem inclu
$(CPPFLAGS) $(CPPFLAGS.dmalloc) \
-DSYS_LIBDIR=$(SYS_LIBDIR)
$(MAKE) -C $(@:subdir-%=%) $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)"
ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y)
+@@ -212,10 +212,10 @@ LDFLAGS.l2tpd+= -lfl
+ $(YACC) -d -o l2tp_config_parse.c $<
+
+ l2tp_config_token.o: l2tp_config_token.c
+- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $<
++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) -DYY_NO_UNPUT $<
+
+ l2tp_config_parse.o: l2tp_config_parse.c l2tp_config_parse.h
+- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $<
++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) -DYY_NO_UNPUT $<
+ endif
+
+ # Compile without -Wall because rpcgen-generated code is full of warnings.
@@ -265,9 +265,13 @@ TAGS:
@for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done
etags $(wildcard *.c) $(wildcard *.h)