Makefile 8.5 KB

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