Ignore:
Timestamp:
2011-11-05T00:28:07+01:00 (4 years ago)
Author:
nico
Message:

packages/openl2tp: enable config file support (thanks to Bogdan Roman), provide -full & -mini variants (closes: #10164)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/openl2tp/Makefile

    r28429 r28758  
    11# 
    2 # Copyright (C) 2009-2010 OpenWrt.org 
     2# Copyright (C) 2009-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1111PKG_NAME:=openl2tp 
    1212PKG_VERSION:=1.8 
    13 PKG_RELEASE:=1 
     13PKG_RELEASE:=2 
    1414 
    1515PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     
    1717PKG_MD5SUM:=e3d08dedfb9e6a9a1e24f6766f6dadd0 
    1818 
    19 PKG_BUILD_DEPENDS:=libreadline libncurses 
     19PKG_BUILD_DEPENDS:=libreadline libncurses USE_UCLIBC:librpc 
     20PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) 
    2021PKG_BUILD_PARALLEL:=1 
    2122PPPD_VERSION:=2.4.5 
     
    2324include $(INCLUDE_DIR)/package.mk 
    2425 
    25 define Build/Prepare 
    26         $(call Build/Prepare/Default) 
    27         $(CP) ./src/*.[ch] $(PKG_BUILD_DIR)/ 
     26define Package/openl2tp/Default 
     27  SUBMENU:=VPN 
     28  SECTION:=net 
     29  CATEGORY:=Network 
     30  TITLE:=An L2TP (Layer 2 Tunneling Protocol) daemon 
     31  URL:=http://www.openl2tp.org/ 
     32  PROVIDES:=openl2tp 
     33  DEPENDS:=+ppp +kmod-pppol2tp 
    2834endef 
    2935 
    30 define Package/openl2tp 
    31   SECTION:=net 
    32   CATEGORY:=Network 
    33   DEPENDS:=+ppp +kmod-pppol2tp +portmap +libreadline +libncurses \ 
    34         @!LINUX_2_4 $(LIBRPC_DEPENDS) 
    35   TITLE:=An L2TP (Layer 2 Tunneling Protocol) daemon 
    36   URL:=http://www.openl2tp.org/ 
    37   SUBMENU:=VPN 
    38 endef 
    39  
    40 define Package/openl2tp/description 
     36define Package/openl2tp/description/Default 
    4137 OpenL2TP is an open source L2TP client/server, written by Katalix Systems 
    4238 specifically for Linux. It has been designed for use as an enterprise  
     
    4541 configuration. 
    4642endef 
     43 
     44 
     45define Package/openl2tp-full 
     46$(call Package/openl2tp/Default) 
     47  TITLE+=(full) 
     48  VARIANT:=full 
     49  DEPENDS+=+portmap +libreadline +libncurses $(LIBRPC_DEPENDS) 
     50endef 
     51 
     52define Package/openl2tp-full/description 
     53$(call Package/openl2tp/description/Default) 
     54 . 
     55 This package a full-featured, RPC-enabled OpenL2TP. 
     56endef 
     57 
     58 
     59define Package/openl2tp-mini 
     60$(call Package/openl2tp/Default) 
     61  TITLE+=(mini) 
     62  VARIANT:=mini 
     63endef 
     64 
     65define Package/openl2tp-mini/description 
     66$(call Package/openl2tp/description/Default) 
     67 . 
     68 This package a minimal-featured, RPC-disabled OpenL2TP. 
     69endef 
     70 
    4771 
    4872MAKE_FLAGS+= \ 
     
    5377        PPPD_SRCDIR="$(STAGING_DIR)/usr/include" \ 
    5478        PPPD_LIBDIR="$(STAGING_DIR)/usr/lib" \ 
    55         CPPFLAGS="-I$(STAGING_DIR)/usr/include" \ 
    56         LIBS.dmalloc="-L$(STAGING_DIR)/usr/lib $(LIBRPC)" 
     79        CFLAGS.optimize="$(TARGET_CFLAGS)" \ 
     80        CPPFLAGS-y="-I$(STAGING_DIR)/usr/include" \ 
     81        L2TP_FEATURE_LOCAL_CONF_FILE=y \ 
    5782 
    58 define Package/openl2tp/install 
     83ifeq ($(BUILD_VARIANT),full) 
     84 
     85  MAKE_FLAGS += \ 
     86        L2TP_FEATURE_RPC_MANAGEMENT=y \ 
     87        L2TP_FEATURE_LOCAL_STAT_FILE=y \ 
     88        LIBS.dmalloc="-L$(STAGING_DIR)/usr/lib $(LIBRPC)" \ 
     89 
     90endif 
     91ifeq ($(BUILD_VARIANT),mini) 
     92 
     93  MAKE_FLAGS += \ 
     94        L2TP_FEATURE_RPC_MANAGEMENT= \ 
     95        L2TP_FEATURE_LOCAL_STAT_FILE= \ 
     96 
     97endif 
     98 
     99define Build/Prepare 
     100        $(call Build/Prepare/Default) 
     101        $(CP) ./src/*.[ch] $(PKG_BUILD_DIR)/ 
     102endef 
     103 
     104define Package/openl2tp-full/install 
    59105        $(INSTALL_DIR) $(1)/usr/bin 
    60106        $(INSTALL_BIN) $(PKG_BUILD_DIR)/l2tpconfig  $(1)/usr/bin/ 
     
    71117endef 
    72118 
    73 $(eval $(call BuildPackage,openl2tp)) 
     119define Package/openl2tp-mini/install 
     120        $(INSTALL_DIR) $(1)/usr/sbin 
     121        $(INSTALL_BIN) $(PKG_BUILD_DIR)/openl2tpd $(1)/usr/sbin/ 
     122        $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PPPD_VERSION) 
     123        $(INSTALL_BIN) $(PKG_BUILD_DIR)/pppd/pppol2tp.so $(1)/usr/lib/pppd/$(PPPD_VERSION)/ 
     124        $(INSTALL_DIR) $(1)/usr/lib/openl2tp 
     125        $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ipsec.so $(1)/usr/lib/openl2tp/ 
     126        $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_unix.so $(1)/usr/lib/openl2tp/ 
     127endef 
     128 
     129$(eval $(call BuildPackage,openl2tp-full)) 
     130$(eval $(call BuildPackage,openl2tp-mini)) 
Note: See TracChangeset for help on using the changeset viewer.