You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.9 KiB

  1. #
  2. # Copyright (C) 2006-2016 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. PKG_NAME:=rp-pppoe
  9. PKG_VERSION:=3.12
  10. PKG_RELEASE:=7
  11. PKG_LICENSE:=LGPL-2.0-or-later
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://roaringpenguin.com/files/download
  14. PKG_HASH:=00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2
  15. PKG_BUILD_DEPENDS:=ppp
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/rp-pppoe/Default
  18. SECTION:=net
  19. CATEGORY:=Network
  20. TITLE:=PPPoE (PPP over Ethernet)
  21. URL:=http://roaringpenguin.com/products/pppoe
  22. SUBMENU:=Dial-in/up
  23. endef
  24. define Package/rp-pppoe/Default/description
  25. Dubbed RP-PPPoE, this open-source product is ideal for Linux users with
  26. a DSL "modem" whose Internet service provider uses PPPoE.
  27. endef
  28. define Package/rp-pppoe-common
  29. $(call Package/rp-pppoe/Default)
  30. TITLE+= common
  31. DEPENDS:=ppp
  32. endef
  33. define Package/rp-pppoe-common/description
  34. $(call Package/rp-pppoe/Default/description)
  35. This package contains files common to server and relay.
  36. endef
  37. define Package/rp-pppoe-common/conffiles
  38. /etc/config/pppoe
  39. endef
  40. define Package/rp-pppoe-relay
  41. $(call Package/rp-pppoe/Default)
  42. DEPENDS:=+rp-pppoe-common
  43. TITLE+= relay
  44. DEFAULT:=n
  45. endef
  46. define Package/rp-pppoe-relay/description
  47. $(call Package/rp-pppoe/Default/description)
  48. This package contains pppoe-relay.
  49. endef
  50. define Package/rp-pppoe-relay/conffiles
  51. /etc/default/pppoe-relay
  52. endef
  53. define Package/rp-pppoe-server
  54. $(call Package/rp-pppoe/Default)
  55. DEPENDS:=+rp-pppoe-common +ppp-mod-pppoe
  56. TITLE+= server
  57. endef
  58. define Package/rp-pppoe-server/conffiles
  59. /etc/ppp/pppoe-server-options
  60. /etc/ppp/options
  61. /etc/ppp/pap-secrets
  62. /etc/ppp/chap-secrets
  63. /etc/default/pppoe-server
  64. endef
  65. define Package/rp-pppoe-server/description
  66. $(call Package/rp-pppoe/Default/description)
  67. This package contains pppoe-server.
  68. endef
  69. define Package/rp-pppoe-sniff
  70. $(call Package/rp-pppoe/Default)
  71. DEPENDS:=+ppp @BROKEN
  72. TITLE+= sniffer
  73. endef
  74. define Package/rp-pppoe-sniff/description
  75. $(call Package/rp-pppoe/Default/description)
  76. This package contains pppoe-sniff.
  77. endef
  78. TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/src/libevent -isystem $(PKG_BUILD_DIR)/missing-headers
  79. CONFIGURE_PATH := ./src
  80. CONFIGURE_ARGS += ac_cv_path_PPPD=/usr/sbin/pppd --enable-plugin=$(STAGING_DIR)/usr/include/
  81. MAKE_FLAGS := DESTDIR="$(PKG_INSTALL_DIR)" PLUGIN_PATH=rp-pppoe.so install
  82. MAKE_PATH := ./src
  83. define Build/Prepare
  84. mkdir -p $(PKG_BUILD_DIR)/missing-headers/net
  85. $(CP) ./files/ppp_defs.h $(PKG_BUILD_DIR)/missing-headers/net/
  86. $(call Build/Prepare/Default,$(1),$(2),$(3))
  87. endef
  88. define Package/rp-pppoe-common/install
  89. $(INSTALL_DIR) $(1)/etc/config
  90. $(INSTALL_CONF) ./files/pppoe.config $(1)/etc/config/pppoe
  91. endef
  92. define Package/rp-pppoe-relay/install
  93. $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/uci-defaults
  94. $(INSTALL_BIN) ./files/pppoe-relay.init $(1)/etc/init.d/pppoe-relay
  95. $(INSTALL_DIR) $(1)/usr/sbin
  96. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-relay $(1)/usr/sbin/
  97. $(INSTALL_DATA) ./files/pppoe-relay.default $(1)/etc/uci-defaults/
  98. endef
  99. define Package/rp-pppoe-server/install
  100. $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/uci-defaults
  101. $(INSTALL_BIN) ./files/pppoe-server.init $(1)/etc/init.d/pppoe-server
  102. $(INSTALL_DIR) $(1)/etc/ppp
  103. $(INSTALL_CONF) ./files/ppp/{options,pap-secrets,pppoe-server-options} $(1)/etc/ppp/
  104. $(INSTALL_DIR) $(1)/etc/ppp/plugins
  105. $(INSTALL_DIR) $(1)/usr/sbin
  106. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-server $(1)/usr/sbin/
  107. $(INSTALL_DATA) ./files/pppoe-server.default $(1)/etc/uci-defaults/
  108. endef
  109. define Package/rp-pppoe-sniff/install
  110. $(INSTALL_DIR) $(1)/usr/sbin
  111. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-sniff $(1)/usr/sbin/
  112. endef
  113. $(eval $(call BuildPackage,rp-pppoe-common))
  114. $(eval $(call BuildPackage,rp-pppoe-relay))
  115. $(eval $(call BuildPackage,rp-pppoe-server))
  116. $(eval $(call BuildPackage,rp-pppoe-sniff))