1
0

Makefile 8.2 KB

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