fix rp-l2tp build
[packages.git] / net / rp-l2tp / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=rp-l2tp
12 PKG_VERSION:=0.4
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/rp-l2tp
17 PKG_MD5SUM:=0e45d11cb4fa6c56cce6b1d119733ed9
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/rp-l2tpd/Default
26   SECTION:=net
27   CATEGORY:=Network
28   TITLE:=Roaring Penguin L2TP
29   DESCRIPTION:=\
30         Roaring Penguin L2TP (Layer 2 Tunneling Protocol) implementation.
31   URL:=http://sourceforge.net/projects/rp-l2tp/
32 endef
33
34 define Package/rp-l2tpd
35   $(call Package/rp-l2tpd/Default)
36   TITLE+= daemon
37   MENU:=1
38 endef
39
40 define Package/rp-l2tpd-mod-cmd
41   $(call Package/rp-l2tpd/Default)
42   DEPENDS:=rp-l2tpd
43   TITLE:=Simple command handler for the RR L2TP daemon
44 endef
45
46 define Package/rp-l2tpd-mod-ppp
47   $(call Package/rp-l2tpd/Default)
48   DEPENDS:=rp-l2tpd
49   TITLE:=PPP handler for the RR L2TP daeomon
50 endef
51
52 # uses GNU configure
53 MAKE_FLAGS += \
54         DESTDIR="$(PKG_INSTALL_DIR)" \
55         all install
56
57 TARGET_CFLAGS := -I$(PKG_BUILD_DIR)/libevent $(TARGET_CFLAGS)
58
59 define Package/rp-l2tpd/install 
60         $(INSTALL_DIR) $(1)/etc
61         $(CP) $(PKG_INSTALL_DIR)/etc/l2tp.conf.example $(1)/etc/l2tp.conf
62         $(INSTALL_DIR) $(1)/usr/lib/l2tp
63         $(INSTALL_DIR) $(1)/usr/sbin
64         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/l2tpd $(1)/usr/sbin/
65         $(INSTALL_DIR) $(1)/etc/init.d
66         $(INSTALL_BIN) ./files/rp-l2tpd.init $(1)/etc/init.d/rp-l2tpd
67 endef
68
69 define Package/rp-l2tpd-mod-cmd/install 
70         $(INSTALL_DIR) $(1)/usr/lib/l2tp
71         $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/cmd.so $(1)/usr/lib/l2tp/
72         $(INSTALL_DIR) $(1)/usr/sbin
73         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/l2tp-control $(1)/usr/sbin/
74 endef
75
76 define Package/rp-l2tpd-mod-ppp/install
77         $(INSTALL_DIR) $(1)/usr/lib/l2tp
78         $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/sync-pppd.so $(1)/usr/lib/l2tp/
79 endef
80
81 $(eval $(call BuildPackage,rp-l2tpd))
82 $(eval $(call BuildPackage,rp-l2tpd-mod-cmd))
83 $(eval $(call BuildPackage,rp-l2tpd-mod-ppp))