Makefile 8.6 KB

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