Makefile 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. #
  2. # Copyright (C) 2006-2011 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.5
  11. PKG_RELEASE:=5
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
  14. PKG_MD5SUM:=4621bc56167b6953ec4071043fe0ec57
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_BUILD_DEPENDS:=libpcap
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/ppp/Default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. MAINTAINER:=Jo-Philipp Wich <[email protected]>
  23. URL:=http://ppp.samba.org/
  24. endef
  25. define Package/ppp
  26. $(call Package/ppp/Default)
  27. DEPENDS:=+kmod-ppp
  28. TITLE:=PPP daemon
  29. VARIANT:=default
  30. endef
  31. define Package/ppp-multilink
  32. $(call Package/ppp/Default)
  33. DEPENDS:=+kmod-ppp
  34. TITLE:=PPP daemon (with multilink support)
  35. VARIANT:=multilink
  36. endef
  37. define Package/ppp/description
  38. This package contains the PPP (Point-to-Point Protocol) daemon.
  39. endef
  40. define Package/ppp/conffiles
  41. /etc/ppp/chap-secrets
  42. /etc/ppp/filter
  43. /etc/ppp/ip-down
  44. /etc/ppp/ip-up
  45. /etc/ppp/ipv6-down
  46. /etc/ppp/ipv6-up
  47. /etc/ppp/options
  48. endef
  49. define Package/ppp-mod-pppoa
  50. $(call Package/ppp/Default)
  51. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +linux-atm +kmod-pppoa
  52. TITLE:=PPPoA plugin
  53. endef
  54. define Package/ppp-mod-pppoa/description
  55. This package contains a PPPoA (PPP over ATM) plugin for ppp.
  56. endef
  57. define Package/ppp-mod-pppoe
  58. $(call Package/ppp/Default)
  59. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppoe
  60. TITLE:=PPPoE plugin
  61. endef
  62. define Package/ppp-mod-pppoe/description
  63. This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
  64. endef
  65. define Package/ppp-mod-radius
  66. $(call Package/ppp/Default)
  67. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  68. TITLE:=RADIUS plugin
  69. endef
  70. define Package/ppp-mod-radius/description
  71. This package contains a RADIUS (Remote Authentication Dial-In User Service)
  72. plugin for ppp.
  73. endef
  74. define Package/ppp-mod-radius/conffiles
  75. /etc/ppp/radius.conf
  76. /etc/ppp/radius/
  77. endef
  78. define Package/ppp-mod-pppol2tp
  79. $(call Package/ppp/Default)
  80. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppol2tp
  81. TITLE:=PPPoL2TP plugin
  82. endef
  83. define Package/ppp-mod-pppol2tp/description
  84. This package contains a PPPoL2TP (PPP over L2TP) plugin for ppp.
  85. endef
  86. define Package/chat
  87. $(call Package/ppp/Default)
  88. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  89. TITLE:=Establish conversation with a modem
  90. endef
  91. define Package/chat/description
  92. This package contains an utility to establish conversation with other PPP servers
  93. (via a modem).
  94. endef
  95. define Package/pppdump
  96. $(call Package/ppp/Default)
  97. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  98. TITLE:=Read PPP record file
  99. endef
  100. define Package/pppdump/description
  101. This package contains an utility to read PPP record file.
  102. endef
  103. define Package/pppstats
  104. $(call Package/ppp/Default)
  105. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  106. TITLE:=Report PPP statistics
  107. endef
  108. define Package/pppstats/description
  109. This package contains an utility to report PPP statistics.
  110. endef
  111. define Build/Configure
  112. $(call Build/Configure/Default,, \
  113. UNAME_S="Linux" \
  114. UNAME_R="$(LINUX_VERSION)" \
  115. UNAME_M="$(ARCH)" \
  116. )
  117. mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
  118. cp \
  119. $(LINUX_DIR)/include/linux/compiler.h \
  120. $(LINUX_DIR)/include/linux/atm*.h \
  121. $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
  122. endef
  123. MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
  124. PRECOMPILED_FILTER=1 \
  125. STAGING_DIR="$(STAGING_DIR)"
  126. ifeq ($(BUILD_VARIANT),multilink)
  127. MAKE_FLAGS += HAVE_MULTILINK=y
  128. else
  129. MAKE_FLAGS += HAVE_MULTILINK=
  130. endif
  131. define Build/InstallDev
  132. $(INSTALL_DIR) $(1)/usr/include
  133. $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
  134. endef
  135. define Package/ppp/script_install
  136. endef
  137. define Package/ppp/install
  138. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  139. $(INSTALL_DIR) $(1)/usr/sbin
  140. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
  141. $(INSTALL_DIR) $(1)/etc/ppp
  142. $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
  143. $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
  144. $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
  145. ln -sf /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
  146. $(INSTALL_DIR) $(1)/lib/netifd/proto
  147. $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/netifd/proto/
  148. $(INSTALL_BIN) ./files/lib/netifd/ppp-up $(1)/lib/netifd/
  149. $(INSTALL_BIN) ./files/lib/netifd/ppp-down $(1)/lib/netifd/
  150. endef
  151. Package/ppp-multilink/install=$(Package/ppp/install)
  152. define Package/ppp-mod-pppoa/install
  153. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  154. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
  155. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  156. endef
  157. define Package/ppp-mod-pppoe/install
  158. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
  160. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  161. endef
  162. define Package/ppp-mod-radius/install
  163. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  164. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
  165. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  166. $(INSTALL_DIR) $(1)/etc/ppp
  167. $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
  168. $(INSTALL_DIR) $(1)/etc/ppp/radius
  169. $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
  170. $(1)/etc/ppp/radius/
  171. $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
  172. $(1)/etc/ppp/radius/
  173. endef
  174. define Package/ppp-mod-pppol2tp/install
  175. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
  177. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  178. endef
  179. define Package/chat/install
  180. $(INSTALL_DIR) $(1)/usr/sbin
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
  182. endef
  183. define Package/pppdump/install
  184. $(INSTALL_DIR) $(1)/usr/sbin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
  186. endef
  187. define Package/pppstats/install
  188. $(INSTALL_DIR) $(1)/usr/sbin
  189. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
  190. endef
  191. $(eval $(call BuildPackage,ppp))
  192. $(eval $(call BuildPackage,ppp-multilink))
  193. $(eval $(call BuildPackage,ppp-mod-pppoa))
  194. $(eval $(call BuildPackage,ppp-mod-pppoe))
  195. $(eval $(call BuildPackage,ppp-mod-radius))
  196. $(eval $(call BuildPackage,ppp-mod-pppol2tp))
  197. $(eval $(call BuildPackage,chat))
  198. $(eval $(call BuildPackage,pppdump))
  199. $(eval $(call BuildPackage,pppstats))