Makefile 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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:=3
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
  13. PKG_SOURCE_DATE:=2019-05-25
  14. PKG_SOURCE_VERSION:=8e77984ac5d7acbe68b2b2f590abd17564c9730d
  15. PKG_MIRROR_HASH:=7e7e74f0261db2c45770d79c6114e768382e85bfeb3f5a83179f270d6c15006d
  16. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  17. PKG_LICENSE:=BSD-4-Clause
  18. PKG_CPE_ID:=cpe:/a:samba:ppp
  19. PKG_RELEASE_VERSION:=2.4.7
  20. PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
  21. PKG_BUILD_DEPENDS:=libpcap
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_INSTALL:=1
  24. include $(INCLUDE_DIR)/package.mk
  25. define Package/ppp/Default
  26. SECTION:=net
  27. CATEGORY:=Network
  28. URL:=https://ppp.samba.org/
  29. endef
  30. define Package/ppp
  31. $(call Package/ppp/Default)
  32. DEPENDS:=+kmod-ppp
  33. TITLE:=PPP daemon
  34. VARIANT:=default
  35. endef
  36. define Package/ppp-multilink
  37. $(call Package/ppp/Default)
  38. DEPENDS:=+kmod-ppp
  39. TITLE:=PPP daemon (with multilink support)
  40. VARIANT:=multilink
  41. endef
  42. define Package/ppp/description
  43. This package contains the PPP (Point-to-Point Protocol) daemon.
  44. endef
  45. define Package/ppp/conffiles
  46. /etc/ppp/chap-secrets
  47. /etc/ppp/filter
  48. /etc/ppp/ip-down
  49. /etc/ppp/ip-up
  50. /etc/ppp/ipv6-down
  51. /etc/ppp/ipv6-up
  52. /etc/ppp/options
  53. endef
  54. define Package/ppp-mod-pppoa
  55. $(call Package/ppp/Default)
  56. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +linux-atm +kmod-pppoa
  57. TITLE:=PPPoA plugin
  58. endef
  59. define Package/ppp-mod-pppoa/description
  60. This package contains a PPPoA (PPP over ATM) plugin for ppp.
  61. endef
  62. define Package/ppp-mod-pppoe
  63. $(call Package/ppp/Default)
  64. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppoe
  65. TITLE:=PPPoE plugin
  66. endef
  67. define Package/ppp-mod-pppoe/description
  68. This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
  69. endef
  70. define Package/ppp-mod-radius
  71. $(call Package/ppp/Default)
  72. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  73. TITLE:=RADIUS plugin
  74. endef
  75. define Package/ppp-mod-radius/description
  76. This package contains a RADIUS (Remote Authentication Dial-In User Service)
  77. plugin for ppp.
  78. endef
  79. define Package/ppp-mod-radius/conffiles
  80. /etc/ppp/radius.conf
  81. /etc/ppp/radius/
  82. endef
  83. define Package/ppp-mod-pppol2tp
  84. $(call Package/ppp/Default)
  85. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppol2tp
  86. TITLE:=PPPoL2TP plugin
  87. endef
  88. define Package/ppp-mod-pppol2tp/description
  89. This package contains a PPPoL2TP (PPP over L2TP) plugin for ppp.
  90. endef
  91. define Package/ppp-mod-pptp
  92. $(call Package/ppp/Default)
  93. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pptp +kmod-mppe +resolveip
  94. TITLE:=PPtP plugin
  95. endef
  96. define Package/ppp-mod-pptp/description
  97. This package contains a PPtP plugin for ppp.
  98. endef
  99. define Package/ppp-mod-passwordfd
  100. $(call Package/ppp/Default)
  101. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  102. TITLE:=pap/chap secret from filedescriptor
  103. endef
  104. define Package/ppp-mod-passwordfd/description
  105. This package allows to pass the PAP/CHAP secret from a filedescriptor.
  106. Eliminates the need for a secrets file.
  107. endef
  108. define Package/chat
  109. $(call Package/ppp/Default)
  110. TITLE:=Establish conversation with a modem
  111. endef
  112. define Package/chat/description
  113. This package contains an utility to establish conversation with other PPP servers
  114. (via a modem).
  115. endef
  116. define Package/pppdump
  117. $(call Package/ppp/Default)
  118. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  119. TITLE:=Read PPP record file
  120. endef
  121. define Package/pppdump/description
  122. This package contains an utility to read PPP record file.
  123. endef
  124. define Package/pppstats
  125. $(call Package/ppp/Default)
  126. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  127. TITLE:=Report PPP statistics
  128. endef
  129. define Package/pppstats/description
  130. This package contains an utility to report PPP statistics.
  131. endef
  132. define Package/pppoe-discovery
  133. $(call Package/ppp/Default)
  134. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +ppp-mod-pppoe
  135. TITLE:=Perform a PPPoE-discovery process
  136. endef
  137. define Package/pppoe-discovery/description
  138. This tool performs the same discovery process as pppoe, but does
  139. not initiate a session. Can be useful to debug pppoe.
  140. endef
  141. define Build/Configure
  142. $(call Build/Configure/Default,, \
  143. UNAME_S="Linux" \
  144. UNAME_R="$(LINUX_VERSION)" \
  145. UNAME_M="$(ARCH)" \
  146. )
  147. mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
  148. $(CP) \
  149. $(LINUX_DIR)/include/linux/compiler.h \
  150. $(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \
  151. $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
  152. # Kernel 4.14.9+ only, ignore the exit status of cp in case the file
  153. # doesn't exits
  154. -$(CP) $(LINUX_DIR)/include/linux/compiler_types.h \
  155. $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
  156. endef
  157. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  158. TARGET_LDFLAGS += -Wl,--gc-sections -flto -fuse-linker-plugin
  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)/rp-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))