Makefile 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #
  2. # Copyright (C) 2006-2010 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.4
  11. PKG_RELEASE:=16
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
  14. PKG_MD5SUM:=183800762e266132218b204dfb428d29
  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/chat
  79. $(call Package/ppp/Default)
  80. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  81. TITLE:=Establish conversation with a modem
  82. endef
  83. define Package/chat/description
  84. This package contains an utility to establish conversation with other PPP servers
  85. (via a modem).
  86. endef
  87. define Package/pppdump
  88. $(call Package/ppp/Default)
  89. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  90. TITLE:=Read PPP record file
  91. endef
  92. define Package/pppdump/description
  93. This package contains an utility to read PPP record file.
  94. endef
  95. define Package/pppstats
  96. $(call Package/ppp/Default)
  97. DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
  98. TITLE:=Report PPP statistics
  99. endef
  100. define Package/pppstats/description
  101. This package contains an utility to report PPP statistics.
  102. endef
  103. define Build/Configure
  104. $(call Build/Configure/Default,, \
  105. UNAME_S="Linux" \
  106. UNAME_R="$(LINUX_VERSION)" \
  107. UNAME_M="$(ARCH)" \
  108. )
  109. mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
  110. cp \
  111. $(LINUX_DIR)/include/linux/compiler.h \
  112. $(LINUX_DIR)/include/linux/atm*.h \
  113. $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
  114. endef
  115. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  116. MAKE_VARS += LDFLAGS="-Wl,--gc-sections"
  117. MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
  118. PRECOMPILED_FILTER=1 \
  119. STAGING_DIR="$(STAGING_DIR)"
  120. ifeq ($(BUILD_VARIANT),multilink)
  121. MAKE_FLAGS += HAVE_MULTILINK=y
  122. else
  123. MAKE_FLAGS += HAVE_MULTILINK=
  124. endif
  125. define Build/InstallDev
  126. $(INSTALL_DIR) $(1)/usr/include
  127. $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
  128. endef
  129. define Package/ppp/install
  130. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  131. $(INSTALL_DIR) $(1)/usr/sbin
  132. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
  133. $(INSTALL_DIR) $(1)/lib/network
  134. $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/network/
  135. $(INSTALL_DIR) $(1)/etc/ppp
  136. $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
  137. $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
  138. $(INSTALL_BIN) ./files/etc/ppp/ip-up $(1)/etc/ppp/
  139. $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d
  140. $(INSTALL_BIN) ./files/etc/ppp/ip-down $(1)/etc/ppp/
  141. $(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
  142. $(INSTALL_BIN) ./files/etc/ppp/ipv6-up $(1)/etc/ppp/
  143. $(INSTALL_BIN) ./files/etc/ppp/ipv6-down $(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. endef
  147. Package/ppp-multilink/install=$(Package/ppp/install)
  148. define Package/ppp-mod-pppoa/install
  149. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
  151. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  152. $(INSTALL_DIR) $(1)/lib/network
  153. $(INSTALL_BIN) ./files/pppoa.sh $(1)/lib/network/
  154. $(INSTALL_DIR) $(1)/etc/hotplug.d/atm
  155. $(INSTALL_DATA) ./files/etc/hotplug.d/atm/20-atm-modem $(1)/etc/hotplug.d/atm/
  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. $(INSTALL_DIR) $(1)/lib/network
  162. $(INSTALL_BIN) ./files/pppoe.sh $(1)/lib/network/
  163. endef
  164. define Package/ppp-mod-radius/install
  165. $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
  166. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
  167. $(1)/usr/lib/pppd/$(PKG_VERSION)/
  168. $(INSTALL_DIR) $(1)/etc/ppp
  169. $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
  170. $(INSTALL_DIR) $(1)/etc/ppp/radius
  171. $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
  172. $(1)/etc/ppp/radius/
  173. $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
  174. $(1)/etc/ppp/radius/
  175. endef
  176. define Package/chat/install
  177. $(INSTALL_DIR) $(1)/usr/sbin
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
  179. endef
  180. define Package/pppdump/install
  181. $(INSTALL_DIR) $(1)/usr/sbin
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
  183. endef
  184. define Package/pppstats/install
  185. $(INSTALL_DIR) $(1)/usr/sbin
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
  187. endef
  188. $(eval $(call BuildPackage,ppp))
  189. $(eval $(call BuildPackage,ppp-multilink))
  190. $(eval $(call BuildPackage,ppp-mod-pppoa))
  191. $(eval $(call BuildPackage,ppp-mod-pppoe))
  192. $(eval $(call BuildPackage,ppp-mod-radius))
  193. $(eval $(call BuildPackage,chat))
  194. $(eval $(call BuildPackage,pppdump))
  195. $(eval $(call BuildPackage,pppstats))