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