e3492ac55f73222bc8dd18440f3ec23a683418ce
[openwrt/openwrt.git] / package / network / services / ppp / Makefile
1 #
2 # Copyright (C) 2006-2015 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.7
13 PKG_RELEASE:=9
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/
17 PKG_MD5SUM:=78818f40e6d33a1d1de68a1551f6595a
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=BSD-4-Clause
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_BUILD_DEPENDS:=libpcap
24
25 PKG_BUILD_PARALLEL:=1
26 PKG_INSTALL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/ppp/Default
31 SECTION:=net
32 CATEGORY:=Network
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/ppp-mod-passwordfd
121 $(call Package/ppp/Default)
122 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
123 TITLE:=pap/chap secret from filedescriptor
124 endef
125
126 define Package/ppp-mod-passwordfd/description
127 This package allows to pass the PAP/CHAP secret from a filedescriptor.
128 Eliminates the need for a secrets file.
129 endef
130
131 define Package/chat
132 $(call Package/ppp/Default)
133 TITLE:=Establish conversation with a modem
134 endef
135
136 define Package/chat/description
137 This package contains an utility to establish conversation with other PPP servers
138 (via a modem).
139 endef
140
141 define Package/pppdump
142 $(call Package/ppp/Default)
143 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
144 TITLE:=Read PPP record file
145 endef
146
147 define Package/pppdump/description
148 This package contains an utility to read PPP record file.
149 endef
150
151 define Package/pppstats
152 $(call Package/ppp/Default)
153 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
154 TITLE:=Report PPP statistics
155 endef
156
157 define Package/pppstats/description
158 This package contains an utility to report PPP statistics.
159 endef
160
161
162 define Build/Configure
163 $(call Build/Configure/Default,, \
164 UNAME_S="Linux" \
165 UNAME_R="$(LINUX_VERSION)" \
166 UNAME_M="$(ARCH)" \
167 )
168 mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
169 cp \
170 $(LINUX_DIR)/include/linux/compiler.h \
171 $(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \
172 $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
173 endef
174
175 MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
176 PRECOMPILED_FILTER=1 \
177 STAGING_DIR="$(STAGING_DIR)"
178
179 ifeq ($(BUILD_VARIANT),multilink)
180 MAKE_FLAGS += HAVE_MULTILINK=y
181 else
182 MAKE_FLAGS += HAVE_MULTILINK=
183 endif
184
185 ifdef CONFIG_USE_MUSL
186 MAKE_FLAGS += USE_LIBUTIL=
187 endif
188
189 define Build/InstallDev
190 $(INSTALL_DIR) $(1)/usr/include
191 $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
192 endef
193
194 define Package/ppp/script_install
195 endef
196
197 define Package/ppp/install
198 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
199 $(INSTALL_DIR) $(1)/usr/sbin
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
201 $(INSTALL_DIR) $(1)/etc/ppp
202 $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
203 $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
204 $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
205 $(LN) /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
206 $(INSTALL_DIR) $(1)/lib/netifd/proto
207 $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/netifd/proto/
208 $(INSTALL_BIN) ./files/lib/netifd/ppp-up $(1)/lib/netifd/
209 $(INSTALL_BIN) ./files/lib/netifd/ppp-down $(1)/lib/netifd/
210 endef
211 Package/ppp-multilink/install=$(Package/ppp/install)
212
213 define Package/ppp-mod-pppoa/install
214 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
216 $(1)/usr/lib/pppd/$(PKG_VERSION)/
217 endef
218
219 define Package/ppp-mod-pppoe/install
220 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
221 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
222 $(1)/usr/lib/pppd/$(PKG_VERSION)/
223 endef
224
225 define Package/ppp-mod-radius/install
226 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
227 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
228 $(1)/usr/lib/pppd/$(PKG_VERSION)/
229 $(INSTALL_DIR) $(1)/etc/ppp
230 $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
231 $(INSTALL_DIR) $(1)/etc/ppp/radius
232 $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
233 $(1)/etc/ppp/radius/
234 $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
235 $(1)/etc/ppp/radius/
236 endef
237
238 define Package/ppp-mod-pppol2tp/install
239 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
240 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
241 $(1)/usr/lib/pppd/$(PKG_VERSION)/
242 endef
243
244 define Package/ppp-mod-pptp/install
245 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pptp.so \
247 $(1)/usr/lib/pppd/$(PKG_VERSION)/
248 $(INSTALL_DIR) $(1)/etc/ppp
249 $(INSTALL_DATA) ./files/etc/ppp/options.pptp $(1)/etc/ppp/
250 endef
251
252 define Package/ppp-mod-passwordfd/install
253 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
254 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/passwordfd.so \
255 $(1)/usr/lib/pppd/$(PKG_VERSION)/
256 endef
257
258 define Package/chat/install
259 $(INSTALL_DIR) $(1)/usr/sbin
260 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
261 endef
262
263 define Package/pppdump/install
264 $(INSTALL_DIR) $(1)/usr/sbin
265 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
266 endef
267
268 define Package/pppstats/install
269 $(INSTALL_DIR) $(1)/usr/sbin
270 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
271 endef
272
273 $(eval $(call BuildPackage,ppp))
274 $(eval $(call BuildPackage,ppp-multilink))
275 $(eval $(call BuildPackage,ppp-mod-pppoa))
276 $(eval $(call BuildPackage,ppp-mod-pppoe))
277 $(eval $(call BuildPackage,ppp-mod-radius))
278 $(eval $(call BuildPackage,ppp-mod-pppol2tp))
279 $(eval $(call BuildPackage,ppp-mod-pptp))
280 $(eval $(call BuildPackage,ppp-mod-passwordfd))
281 $(eval $(call BuildPackage,chat))
282 $(eval $(call BuildPackage,pppdump))
283 $(eval $(call BuildPackage,pppstats))