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