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