Makefile 8.4 KB

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