Makefile 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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:=9
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/
  14. PKG_MD5SUM:=78818f40e6d33a1d1de68a1551f6595a
  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 Build/Configure
  130. $(call Build/Configure/Default,, \
  131. UNAME_S="Linux" \
  132. UNAME_R="$(LINUX_VERSION)" \
  133. UNAME_M="$(ARCH)" \
  134. )
  135. mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
  136. cp \
  137. $(LINUX_DIR)/include/linux/compiler.h \
  138. $(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \
  139. $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
  140. endef
  141. MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
  142. PRECOMPILED_FILTER=1 \
  143. STAGING_DIR="$(STAGING_DIR)"
  144. ifeq ($(BUILD_VARIANT),multilink)
  145. MAKE_FLAGS += HAVE_MULTILINK=y
  146. else
  147. MAKE_FLAGS += HAVE_MULTILINK=
  148. endif
  149. ifdef CONFIG_USE_MUSL
  150. MAKE_FLAGS += USE_LIBUTIL=
  151. endif
  152. define Build/InstallDev
  153. $(INSTALL_DIR) $(1)/usr/include
  154. $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
  155. endef
  156. define Package/ppp/script_install
  157. endef
  158. define Package/ppp/install
  159. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  160. $(INSTALL_DIR) $(1)/usr/sbin
  161. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
  162. $(INSTALL_DIR) $(1)/etc/ppp
  163. $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
  164. $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
  165. $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
  166. $(LN) /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
  167. $(INSTALL_DIR) $(1)/lib/netifd/proto
  168. $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/netifd/proto/
  169. $(INSTALL_BIN) ./files/lib/netifd/ppp-up $(1)/lib/netifd/
  170. $(INSTALL_BIN) ./files/lib/netifd/ppp-down $(1)/lib/netifd/
  171. endef
  172. Package/ppp-multilink/install=$(Package/ppp/install)
  173. define Package/ppp-mod-pppoa/install
  174. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
  176. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  177. endef
  178. define Package/ppp-mod-pppoe/install
  179. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
  181. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  182. endef
  183. define Package/ppp-mod-radius/install
  184. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
  186. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  187. $(INSTALL_DIR) $(1)/etc/ppp
  188. $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
  189. $(INSTALL_DIR) $(1)/etc/ppp/radius
  190. $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
  191. $(1)/etc/ppp/radius/
  192. $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
  193. $(1)/etc/ppp/radius/
  194. endef
  195. define Package/ppp-mod-pppol2tp/install
  196. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  197. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
  198. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  199. endef
  200. define Package/ppp-mod-pptp/install
  201. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  202. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pptp.so \
  203. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  204. $(INSTALL_DIR) $(1)/etc/ppp
  205. $(INSTALL_DATA) ./files/etc/ppp/options.pptp $(1)/etc/ppp/
  206. endef
  207. define Package/ppp-mod-passwordfd/install
  208. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  209. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/passwordfd.so \
  210. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  211. endef
  212. define Package/chat/install
  213. $(INSTALL_DIR) $(1)/usr/sbin
  214. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
  215. endef
  216. define Package/pppdump/install
  217. $(INSTALL_DIR) $(1)/usr/sbin
  218. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
  219. endef
  220. define Package/pppstats/install
  221. $(INSTALL_DIR) $(1)/usr/sbin
  222. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
  223. endef
  224. $(eval $(call BuildPackage,ppp))
  225. $(eval $(call BuildPackage,ppp-multilink))
  226. $(eval $(call BuildPackage,ppp-mod-pppoa))
  227. $(eval $(call BuildPackage,ppp-mod-pppoe))
  228. $(eval $(call BuildPackage,ppp-mod-radius))
  229. $(eval $(call BuildPackage,ppp-mod-pppol2tp))
  230. $(eval $(call BuildPackage,ppp-mod-pptp))
  231. $(eval $(call BuildPackage,ppp-mod-passwordfd))
  232. $(eval $(call BuildPackage,chat))
  233. $(eval $(call BuildPackage,pppdump))
  234. $(eval $(call BuildPackage,pppstats))