finally move buildroot-ng to trunk
[openwrt.git] / package / ppp / 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:=ppp
12 PKG_VERSION:=2.4.3
13 PKG_RELEASE:=7
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
17 PKG_MD5SUM:=848f6c3cafeb6074ffeb293c3af79b7c
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 PKG_BUILDDEP:=libpcap linux-atm
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/kernel.mk
27
28 define Package/ppp/Default
29   SECTION:=net
30   CATEGORY:=Network
31   URL:=http://ppp.samba.org/
32 endef
33
34 define Package/ppp
35   $(call Package/ppp/Default)
36   DEFAULT:=y
37   DEPENDS:=+kmod-ppp
38   TITLE:=PPP daemon
39   DESCRIPTION:=\
40         This package contains the PPP (Point-to-Point Protocol) daemon.
41   MENU:=1
42 endef
43
44 define Package/ppp-mod-pppoa
45   $(call Package/ppp/Default)
46   DEPENDS:=ppp +linux-atm +kmod-pppoa
47   TITLE:=PPPoA plugin
48   DESCRIPTION:=\
49         This package contains a PPPoA (PPP over ATM) plugin for ppp.
50 endef
51
52 define Package/ppp-mod-pppoe
53   $(call Package/ppp/Default)
54   DEFAULT:=y
55   DEPENDS:=ppp +kmod-pppoe
56   TITLE:=PPPoE plugin
57   DESCRIPTION:=\
58         This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
59 endef
60
61 define Package/ppp-mod-radius
62   $(call Package/ppp/Default)
63   DEPENDS:=ppp
64   TITLE:=RADIUS plugin
65   DESCRIPTION:=\
66         This package contains a RADIUS (Remote Authentication Dial-In User \\\
67         Service) plugin for ppp.
68 endef
69
70 define Package/chat
71   $(call Package/ppp/Default)
72   DEPENDS:=ppp
73   TITLE:=Establish conversation with a modem
74   DESCRIPTION:=\
75         This package contains an utility to establish conversation with other \\\
76         PPP servers (via a modem).
77 endef
78
79 define Package/pppdump
80   $(call Package/ppp/Default)
81   DEPENDS:=ppp
82   TITLE:=Read PPP record file
83   DESCRIPTION:=\
84         This package contains an utility to read PPP record file.
85 endef
86
87 define Package/pppstats
88   $(call Package/ppp/Default)
89   DEPENDS:=ppp
90   TITLE:=Report PPP statistics
91   DESCRIPTION:=\
92         This package contains an utility to report PPP statistics.
93 endef
94
95 define Build/Configure
96 $(call Build/Configure/Default,, \
97         UNAME_S="Linux" \
98         UNAME_R="$(LINUX_VERSION)" \
99         UNAME_M="$(ARCH)" \
100 )
101 endef
102
103 define Build/Compile
104         rm -rf $(PKG_INSTALL_DIR)
105         mkdir -p $(PKG_INSTALL_DIR)/usr
106         $(MAKE) -C $(PKG_BUILD_DIR) \
107                 $(TARGET_CONFIGURE_OPTS) \
108                 COPTS="$(TARGET_CFLAGS)" \
109                 PRECOMPILED_FILTER=1 \
110                 STAGING_DIR="$(STAGING_DIR)" \
111                 DESTDIR="$(PKG_INSTALL_DIR)/usr" \
112                 all install
113 endef
114
115 define Package/ppp/install
116         install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
117         install -d -m0755 $(1)/usr/sbin
118         install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/pppd $(1)/usr/sbin/
119         install -d -m0755 $(1)/lib/network
120         install -m0755 ./files/ppp.sh $(1)/lib/network/
121         install -d -m0755 $(1)/etc/ppp
122         install -m0600 ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
123         install -m0644 ./files/etc/ppp/filter $(1)/etc/ppp/
124         install -m0755 ./files/etc/ppp/ip-up $(1)/etc/ppp/
125         install -d -m0755 $(1)/etc/ppp/ip-up.d
126         install -m0755 ./files/etc/ppp/ip-down $(1)/etc/ppp/
127         install -d -m0755 $(1)/etc/ppp/ip-down.d
128         install -m0644 ./files/etc/ppp/options $(1)/etc/ppp/
129         ln -sf /tmp/resolv.conf $(1)/etc/ppp/resolv.conf
130 endef
131         
132 define Package/ppp-mod-pppoa/install
133         install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
134         install -m0755 $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \
135                 $(1)/usr/lib/pppd/$(PKG_VERSION)/
136         install -d -m0755 $(1)/lib/network
137         install -m0755 ./files/pppoa.sh $(1)/lib/network/
138 endef
139
140 define Package/ppp-mod-pppoe/install
141         install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
142         install -m0755 $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
143                 $(1)/usr/lib/pppd/$(PKG_VERSION)/
144         install -d -m0755 $(1)/lib/network
145         install -m0755 ./files/pppoe.sh $(1)/lib/network/
146 endef
147
148 define Package/ppp-mod-radius/install
149         install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
150         install -m0755 $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/radius.so \
151                 $(1)/usr/lib/pppd/$(PKG_VERSION)/
152         install -d -m0755 $(1)/etc/ppp
153         install -m0644 ./files/etc/ppp/radius.conf $(1)/etc/ppp/
154         install -d -m0755 $(1)/etc/ppp/radius
155         install -m0644 ./files/etc/ppp/radius/dictionary* \
156                 $(1)/etc/ppp/radius/
157         install -m0600 ./files/etc/ppp/radius/servers \
158                 $(1)/etc/ppp/radius/
159 endef
160
161 define Package/chat/install
162         install -d -m0755 $(1)/usr/sbin
163         install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/chat $(1)/usr/sbin/
164 endef
165
166 define Package/pppdump/install
167         install -d -m0755 $(1)/usr/sbin
168         install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/pppdump $(1)/usr/sbin/
169 endef
170
171 define Package/pppstats/install
172         install -d -m0755 $(1)/usr/sbin
173         install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/pppstats $(1)/usr/sbin/
174 endef
175
176 $(eval $(call BuildPackage,ppp))
177 $(eval $(call BuildPackage,ppp-mod-pppoa))
178 $(eval $(call BuildPackage,ppp-mod-pppoe))
179 $(eval $(call BuildPackage,ppp-mod-radius))
180 $(eval $(call BuildPackage,chat))
181 $(eval $(call BuildPackage,pppdump))
182 $(eval $(call BuildPackage,pppstats))