0614ebc58b370225ba9632dd58e1bbda95fb62d7
[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:=12
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/
17 PKG_HASH:=02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=BSD-4-Clause
20 PKG_CPE_ID:=cpe:/a:samba:ppp
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
23
24 PKG_BUILD_DEPENDS:=libpcap
25
26 PKG_BUILD_PARALLEL:=1
27 PKG_INSTALL:=1
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/ppp/Default
32 SECTION:=net
33 CATEGORY:=Network
34 URL:=https://ppp.samba.org/
35 endef
36
37 define Package/ppp
38 $(call Package/ppp/Default)
39 DEPENDS:=+kmod-ppp
40 TITLE:=PPP daemon
41 VARIANT:=default
42 endef
43
44 define Package/ppp-multilink
45 $(call Package/ppp/Default)
46 DEPENDS:=+kmod-ppp
47 TITLE:=PPP daemon (with multilink support)
48 VARIANT:=multilink
49 endef
50
51 define Package/ppp/description
52 This package contains the PPP (Point-to-Point Protocol) daemon.
53 endef
54
55 define Package/ppp/conffiles
56 /etc/ppp/chap-secrets
57 /etc/ppp/filter
58 /etc/ppp/ip-down
59 /etc/ppp/ip-up
60 /etc/ppp/ipv6-down
61 /etc/ppp/ipv6-up
62 /etc/ppp/options
63 endef
64
65 define Package/ppp-mod-pppoa
66 $(call Package/ppp/Default)
67 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +linux-atm +kmod-pppoa
68 TITLE:=PPPoA plugin
69 endef
70
71 define Package/ppp-mod-pppoa/description
72 This package contains a PPPoA (PPP over ATM) plugin for ppp.
73 endef
74
75 define Package/ppp-mod-pppoe
76 $(call Package/ppp/Default)
77 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppoe
78 TITLE:=PPPoE plugin
79 endef
80
81 define Package/ppp-mod-pppoe/description
82 This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
83 endef
84
85 define Package/ppp-mod-radius
86 $(call Package/ppp/Default)
87 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
88 TITLE:=RADIUS plugin
89 endef
90
91 define Package/ppp-mod-radius/description
92 This package contains a RADIUS (Remote Authentication Dial-In User Service)
93 plugin for ppp.
94 endef
95
96 define Package/ppp-mod-radius/conffiles
97 /etc/ppp/radius.conf
98 /etc/ppp/radius/
99 endef
100
101 define Package/ppp-mod-pppol2tp
102 $(call Package/ppp/Default)
103 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppol2tp
104 TITLE:=PPPoL2TP plugin
105 endef
106
107 define Package/ppp-mod-pppol2tp/description
108 This package contains a PPPoL2TP (PPP over L2TP) plugin for ppp.
109 endef
110
111 define Package/ppp-mod-pptp
112 $(call Package/ppp/Default)
113 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pptp +kmod-mppe +resolveip
114 TITLE:=PPtP plugin
115 endef
116
117 define Package/ppp-mod-pptp/description
118 This package contains a PPtP plugin for ppp.
119 endef
120
121 define Package/ppp-mod-passwordfd
122 $(call Package/ppp/Default)
123 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
124 TITLE:=pap/chap secret from filedescriptor
125 endef
126
127 define Package/ppp-mod-passwordfd/description
128 This package allows to pass the PAP/CHAP secret from a filedescriptor.
129 Eliminates the need for a secrets file.
130 endef
131
132 define Package/chat
133 $(call Package/ppp/Default)
134 TITLE:=Establish conversation with a modem
135 endef
136
137 define Package/chat/description
138 This package contains an utility to establish conversation with other PPP servers
139 (via a modem).
140 endef
141
142 define Package/pppdump
143 $(call Package/ppp/Default)
144 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
145 TITLE:=Read PPP record file
146 endef
147
148 define Package/pppdump/description
149 This package contains an utility to read PPP record file.
150 endef
151
152 define Package/pppstats
153 $(call Package/ppp/Default)
154 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
155 TITLE:=Report PPP statistics
156 endef
157
158 define Package/pppstats/description
159 This package contains an utility to report PPP statistics.
160 endef
161
162 define Package/pppoe-discovery
163 $(call Package/ppp/Default)
164 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +ppp-mod-pppoe
165 TITLE:=Perform a PPPoE-discovery process
166 endef
167
168 define Package/pppoe-discovery/description
169 This tool performs the same discovery process as pppoe, but does
170 not initiate a session. Can be useful to debug pppoe.
171 endef
172
173
174 define Build/Configure
175 $(call Build/Configure/Default,, \
176 UNAME_S="Linux" \
177 UNAME_R="$(LINUX_VERSION)" \
178 UNAME_M="$(ARCH)" \
179 )
180 mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
181 cp \
182 $(LINUX_DIR)/include/linux/compiler.h \
183 $(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \
184 $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
185 endef
186
187 TARGET_CFLAGS += -ffunction-sections -fdata-sections
188 TARGET_LDFLAGS += -Wl,--gc-sections
189
190 MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
191 PRECOMPILED_FILTER=1 \
192 STAGING_DIR="$(STAGING_DIR)"
193
194 ifeq ($(BUILD_VARIANT),multilink)
195 MAKE_FLAGS += HAVE_MULTILINK=y
196 else
197 MAKE_FLAGS += HAVE_MULTILINK=
198 endif
199
200 ifdef CONFIG_USE_MUSL
201 MAKE_FLAGS += USE_LIBUTIL=
202 endif
203
204 define Build/InstallDev
205 $(INSTALL_DIR) $(1)/usr/include
206 $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
207 endef
208
209 define Package/ppp/script_install
210 endef
211
212 define Package/ppp/install
213 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
214 $(INSTALL_DIR) $(1)/usr/sbin
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
216 $(INSTALL_DIR) $(1)/etc/ppp
217 $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
218 $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
219 $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
220 $(LN) /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
221 $(INSTALL_DIR) $(1)/lib/netifd/proto
222 $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/netifd/proto/
223 $(INSTALL_BIN) ./files/lib/netifd/ppp-up $(1)/lib/netifd/
224 $(INSTALL_BIN) ./files/lib/netifd/ppp6-up $(1)/lib/netifd/
225 $(INSTALL_BIN) ./files/lib/netifd/ppp-down $(1)/lib/netifd/
226 endef
227 Package/ppp-multilink/install=$(Package/ppp/install)
228
229 define Package/ppp-mod-pppoa/install
230 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
231 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
232 $(1)/usr/lib/pppd/$(PKG_VERSION)/
233 endef
234
235 define Package/ppp-mod-pppoe/install
236 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
237 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
238 $(1)/usr/lib/pppd/$(PKG_VERSION)/
239 endef
240
241 define Package/ppp-mod-radius/install
242 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
243 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
244 $(1)/usr/lib/pppd/$(PKG_VERSION)/
245 $(INSTALL_DIR) $(1)/etc/ppp
246 $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
247 $(INSTALL_DIR) $(1)/etc/ppp/radius
248 $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
249 $(1)/etc/ppp/radius/
250 $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
251 $(1)/etc/ppp/radius/
252 endef
253
254 define Package/ppp-mod-pppol2tp/install
255 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
256 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
257 $(1)/usr/lib/pppd/$(PKG_VERSION)/
258 endef
259
260 define Package/ppp-mod-pptp/install
261 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
262 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pptp.so \
263 $(1)/usr/lib/pppd/$(PKG_VERSION)/
264 $(INSTALL_DIR) $(1)/etc/ppp
265 $(INSTALL_DATA) ./files/etc/ppp/options.pptp $(1)/etc/ppp/
266 endef
267
268 define Package/ppp-mod-passwordfd/install
269 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
270 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/passwordfd.so \
271 $(1)/usr/lib/pppd/$(PKG_VERSION)/
272 endef
273
274 define Package/chat/install
275 $(INSTALL_DIR) $(1)/usr/sbin
276 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
277 endef
278
279 define Package/pppdump/install
280 $(INSTALL_DIR) $(1)/usr/sbin
281 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
282 endef
283
284 define Package/pppstats/install
285 $(INSTALL_DIR) $(1)/usr/sbin
286 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
287 endef
288
289 define Package/pppoe-discovery/install
290 $(INSTALL_DIR) $(1)/usr/sbin
291 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppoe-discovery $(1)/usr/sbin/
292 endef
293
294 $(eval $(call BuildPackage,ppp))
295 $(eval $(call BuildPackage,ppp-multilink))
296 $(eval $(call BuildPackage,ppp-mod-pppoa))
297 $(eval $(call BuildPackage,ppp-mod-pppoe))
298 $(eval $(call BuildPackage,ppp-mod-radius))
299 $(eval $(call BuildPackage,ppp-mod-pppol2tp))
300 $(eval $(call BuildPackage,ppp-mod-pptp))
301 $(eval $(call BuildPackage,ppp-mod-passwordfd))
302 $(eval $(call BuildPackage,chat))
303 $(eval $(call BuildPackage,pppdump))
304 $(eval $(call BuildPackage,pppstats))
305 $(eval $(call BuildPackage,pppoe-discovery))