enable netifd by default and add its config variable to PKG_CONFIG_DEPENDS in a few...
[openwrt/svn-archive/archive.git] / package / ppp / Makefile
1 #
2 # Copyright (C) 2006-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:=ppp
12 PKG_VERSION:=2.4.5
13 PKG_RELEASE:=5
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
17 PKG_MD5SUM:=4621bc56167b6953ec4071043fe0ec57
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20
21 PKG_BUILD_DEPENDS:=libpcap
22 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_netifd
23
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/ppp/Default
29 SECTION:=net
30 CATEGORY:=Network
31 MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
32 URL:=http://ppp.samba.org/
33 endef
34
35 define Package/ppp
36 $(call Package/ppp/Default)
37 DEPENDS:=+kmod-ppp
38 TITLE:=PPP daemon
39 VARIANT:=default
40 endef
41
42 define Package/ppp-multilink
43 $(call Package/ppp/Default)
44 DEPENDS:=+kmod-ppp
45 TITLE:=PPP daemon (with multilink support)
46 VARIANT:=multilink
47 endef
48
49 define Package/ppp/description
50 This package contains the PPP (Point-to-Point Protocol) daemon.
51 endef
52
53 define Package/ppp/conffiles
54 /etc/ppp/chap-secrets
55 /etc/ppp/filter
56 /etc/ppp/ip-down
57 /etc/ppp/ip-up
58 /etc/ppp/ipv6-down
59 /etc/ppp/ipv6-up
60 /etc/ppp/options
61 endef
62
63 define Package/ppp-mod-pppoa
64 $(call Package/ppp/Default)
65 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +linux-atm +kmod-pppoa
66 TITLE:=PPPoA plugin
67 endef
68
69 define Package/ppp-mod-pppoa/description
70 This package contains a PPPoA (PPP over ATM) plugin for ppp.
71 endef
72
73 define Package/ppp-mod-pppoe
74 $(call Package/ppp/Default)
75 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppoe
76 TITLE:=PPPoE plugin
77 endef
78
79 define Package/ppp-mod-pppoe/description
80 This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
81 endef
82
83 define Package/ppp-mod-radius
84 $(call Package/ppp/Default)
85 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
86 TITLE:=RADIUS plugin
87 endef
88
89 define Package/ppp-mod-radius/description
90 This package contains a RADIUS (Remote Authentication Dial-In User Service)
91 plugin for ppp.
92 endef
93
94 define Package/ppp-mod-radius/conffiles
95 /etc/ppp/radius.conf
96 /etc/ppp/radius/
97 endef
98
99 define Package/ppp-mod-pppol2tp
100 $(call Package/ppp/Default)
101 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppol2tp
102 TITLE:=PPPoL2TP plugin
103 endef
104
105 define Package/ppp-mod-pppol2tp/description
106 This package contains a PPPoL2TP (PPP over L2TP) plugin for ppp.
107 endef
108
109 define Package/chat
110 $(call Package/ppp/Default)
111 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
112 TITLE:=Establish conversation with a modem
113 endef
114
115 define Package/chat/description
116 This package contains an utility to establish conversation with other PPP servers
117 (via a modem).
118 endef
119
120 define Package/pppdump
121 $(call Package/ppp/Default)
122 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
123 TITLE:=Read PPP record file
124 endef
125
126 define Package/pppdump/description
127 This package contains an utility to read PPP record file.
128 endef
129
130 define Package/pppstats
131 $(call Package/ppp/Default)
132 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
133 TITLE:=Report PPP statistics
134 endef
135
136 define Package/pppstats/description
137 This package contains an utility to report PPP statistics.
138 endef
139
140
141 define Build/Configure
142 $(call Build/Configure/Default,, \
143 UNAME_S="Linux" \
144 UNAME_R="$(LINUX_VERSION)" \
145 UNAME_M="$(ARCH)" \
146 )
147 mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
148 cp \
149 $(LINUX_DIR)/include/linux/compiler.h \
150 $(LINUX_DIR)/include/linux/atm*.h \
151 $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
152 endef
153
154 MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
155 PRECOMPILED_FILTER=1 \
156 STAGING_DIR="$(STAGING_DIR)"
157
158 ifeq ($(BUILD_VARIANT),multilink)
159 MAKE_FLAGS += HAVE_MULTILINK=y
160 else
161 MAKE_FLAGS += HAVE_MULTILINK=
162 endif
163
164
165 define Build/InstallDev
166 $(INSTALL_DIR) $(1)/usr/include
167 $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
168 endef
169
170 ifneq ($(CONFIG_PACKAGE_netifd),)
171 define Package/ppp/script_install
172 $(INSTALL_DIR) $(1)/lib/netifd/proto
173 $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/netifd/proto/
174 $(INSTALL_BIN) ./files/lib/netifd/ppp-up $(1)/lib/netifd/
175 $(INSTALL_BIN) ./files/lib/netifd/ppp-down $(1)/lib/netifd/
176 endef
177 else
178 define Package/ppp/script_install
179 $(INSTALL_DIR) $(1)/lib/network
180 $(INSTALL_BIN) ./files.old/ppp.sh $(1)/lib/network/
181 $(INSTALL_BIN) ./files.old/etc/ppp/ip-up $(1)/etc/ppp/
182 $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d
183 $(INSTALL_BIN) ./files.old/etc/ppp/ip-down $(1)/etc/ppp/
184 $(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
185 $(INSTALL_BIN) ./files.old/etc/ppp/ipv6-up $(1)/etc/ppp/
186 $(INSTALL_BIN) ./files.old/etc/ppp/ipv6-down $(1)/etc/ppp/
187 $(INSTALL_DIR) $(1)/lib/network
188 $(INSTALL_BIN) ./files.old/pppoe.sh $(1)/lib/network/
189 $(INSTALL_DIR) $(1)/lib/network
190 $(INSTALL_BIN) ./files.old/pppoa.sh $(1)/lib/network/
191 $(INSTALL_DIR) $(1)/etc/hotplug.d/atm
192 $(INSTALL_DATA) ./files.old/etc/hotplug.d/atm/20-atm-modem $(1)/etc/hotplug.d/atm/
193 endef
194 endif
195
196 define Package/ppp/install
197 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
198 $(INSTALL_DIR) $(1)/usr/sbin
199 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
200 $(INSTALL_DIR) $(1)/etc/ppp
201 $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
202 $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
203 $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
204 ln -sf /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
205 $(Package/ppp/script_install)
206 endef
207 Package/ppp-multilink/install=$(Package/ppp/install)
208
209 define Package/ppp-mod-pppoa/install
210 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
211 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
212 $(1)/usr/lib/pppd/$(PKG_VERSION)/
213 endef
214
215 define Package/ppp-mod-pppoe/install
216 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
217 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
218 $(1)/usr/lib/pppd/$(PKG_VERSION)/
219 endef
220
221 define Package/ppp-mod-radius/install
222 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
223 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
224 $(1)/usr/lib/pppd/$(PKG_VERSION)/
225 $(INSTALL_DIR) $(1)/etc/ppp
226 $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
227 $(INSTALL_DIR) $(1)/etc/ppp/radius
228 $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
229 $(1)/etc/ppp/radius/
230 $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
231 $(1)/etc/ppp/radius/
232 endef
233
234 define Package/ppp-mod-pppol2tp/install
235 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
236 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
237 $(1)/usr/lib/pppd/$(PKG_VERSION)/
238 endef
239
240 define Package/chat/install
241 $(INSTALL_DIR) $(1)/usr/sbin
242 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
243 endef
244
245 define Package/pppdump/install
246 $(INSTALL_DIR) $(1)/usr/sbin
247 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
248 endef
249
250 define Package/pppstats/install
251 $(INSTALL_DIR) $(1)/usr/sbin
252 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
253 endef
254
255 $(eval $(call BuildPackage,ppp))
256 $(eval $(call BuildPackage,ppp-multilink))
257 $(eval $(call BuildPackage,ppp-mod-pppoa))
258 $(eval $(call BuildPackage,ppp-mod-pppoe))
259 $(eval $(call BuildPackage,ppp-mod-radius))
260 $(eval $(call BuildPackage,ppp-mod-pppol2tp))
261 $(eval $(call BuildPackage,chat))
262 $(eval $(call BuildPackage,pppdump))
263 $(eval $(call BuildPackage,pppstats))