packages/openl2tp: enable config file support (thanks to Bogdan Roman), provide ...
[openwrt/svn-archive/archive.git] / net / openl2tp / Makefile
1 #
2 # Copyright (C) 2009-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=openl2tp
12 PKG_VERSION:=1.8
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/openl2tp
17 PKG_MD5SUM:=e3d08dedfb9e6a9a1e24f6766f6dadd0
18
19 PKG_BUILD_DEPENDS:=libreadline libncurses USE_UCLIBC:librpc
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_BUILD_PARALLEL:=1
22 PPPD_VERSION:=2.4.5
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define 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
34 endef
35
36 define Package/openl2tp/description/Default
37 OpenL2TP is an open source L2TP client/server, written by Katalix Systems
38 specifically for Linux. It has been designed for use as an enterprise
39 L2TP VPN server or in commercial, Linux-based, embedded networking
40 products and is able to support hundreds of sessions, each with different
41 configuration.
42 endef
43
44
45 define Package/openl2tp-full
46 $(call Package/openl2tp/Default)
47 TITLE+=(full)
48 VARIANT:=full
49 DEPENDS+=+portmap +libreadline +libncurses $(LIBRPC_DEPENDS)
50 endef
51
52 define Package/openl2tp-full/description
53 $(call Package/openl2tp/description/Default)
54 .
55 This package a full-featured, RPC-enabled OpenL2TP.
56 endef
57
58
59 define Package/openl2tp-mini
60 $(call Package/openl2tp/Default)
61 TITLE+=(mini)
62 VARIANT:=mini
63 endef
64
65 define Package/openl2tp-mini/description
66 $(call Package/openl2tp/description/Default)
67 .
68 This package a minimal-featured, RPC-disabled OpenL2TP.
69 endef
70
71
72 MAKE_FLAGS+= \
73 KERNEL_SRCDIR="$(LINUX_DIR)" \
74 KERNEL_BLDDIR="$(LINUX_DIR)" \
75 PPPD_VERSION="$(PKG_PPPD_VERSION)" \
76 READLINE_DIR="$(STAGING_DIR)/usr" \
77 PPPD_SRCDIR="$(STAGING_DIR)/usr/include" \
78 PPPD_LIBDIR="$(STAGING_DIR)/usr/lib" \
79 CFLAGS.optimize="$(TARGET_CFLAGS)" \
80 CPPFLAGS-y="-I$(STAGING_DIR)/usr/include" \
81 L2TP_FEATURE_LOCAL_CONF_FILE=y \
82
83 ifeq ($(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
90 endif
91 ifeq ($(BUILD_VARIANT),mini)
92
93 MAKE_FLAGS += \
94 L2TP_FEATURE_RPC_MANAGEMENT= \
95 L2TP_FEATURE_LOCAL_STAT_FILE= \
96
97 endif
98
99 define Build/Prepare
100 $(call Build/Prepare/Default)
101 $(CP) ./src/*.[ch] $(PKG_BUILD_DIR)/
102 endef
103
104 define Package/openl2tp-full/install
105 $(INSTALL_DIR) $(1)/usr/bin
106 $(INSTALL_BIN) $(PKG_BUILD_DIR)/l2tpconfig $(1)/usr/bin/
107 $(INSTALL_DIR) $(1)/usr/sbin
108 $(INSTALL_BIN) $(PKG_BUILD_DIR)/openl2tpd $(1)/usr/sbin/
109 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PPPD_VERSION)
110 $(INSTALL_BIN) $(PKG_BUILD_DIR)/pppd/openl2tp.so $(1)/usr/lib/pppd/$(PPPD_VERSION)/
111 $(INSTALL_BIN) $(PKG_BUILD_DIR)/pppd/pppol2tp.so $(1)/usr/lib/pppd/$(PPPD_VERSION)/
112 $(INSTALL_DIR) $(1)/usr/lib/openl2tp
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/event_sock.so $(1)/usr/lib/openl2tp/
114 $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ipsec.so $(1)/usr/lib/openl2tp/
115 $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_null.so $(1)/usr/lib/openl2tp/
116 $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/ppp_unix.so $(1)/usr/lib/openl2tp/
117 endef
118
119 define 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/
127 endef
128
129 $(eval $(call BuildPackage,openl2tp-full))
130 $(eval $(call BuildPackage,openl2tp-mini))