pppd.mk 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. ################################################################################
  2. #
  3. # pppd
  4. #
  5. ################################################################################
  6. PPPD_VERSION = 2.4.8
  7. PPPD_SITE = $(call github,paulusmack,ppp,ppp-$(PPPD_VERSION))
  8. PPPD_LICENSE = LGPL-2.0+, LGPL, BSD-4-Clause, BSD-3-Clause, GPL-2.0+
  9. PPPD_LICENSE_FILES = \
  10. pppd/tdb.c pppd/plugins/pppoatm/COPYING \
  11. pppdump/bsd-comp.c pppd/ccp.c pppd/plugins/passprompt.c
  12. # 0001-pppd-Fix-bounds-check.patch
  13. PPPD_IGNORE_CVES += CVE-2020-8597
  14. PPPD_MAKE_OPTS = HAVE_INET6=y
  15. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
  16. PPPD_DEPENDENCIES += openssl
  17. else
  18. PPPD_MAKE_OPTS += USE_CRYPT=y
  19. endif
  20. PPPD_INSTALL_STAGING = YES
  21. PPPD_TARGET_BINS = chat pppd pppdump pppstats
  22. PPPD_RADIUS_CONF = \
  23. dictionary dictionary.ascend dictionary.compat \
  24. dictionary.merit dictionary.microsoft \
  25. issue port-id-map realms servers radiusclient.conf
  26. ifeq ($(BR2_PACKAGE_PPPD_FILTER),y)
  27. PPPD_DEPENDENCIES += libpcap
  28. PPPD_MAKE_OPTS += FILTER=y
  29. endif
  30. # pppd bundles some but not all of the needed kernel headers. The embedded
  31. # if_pppol2tp.h is unfortunately not compatible with kernel headers > 2.6.34,
  32. # and has been part of the kernel headers since 2.6.23, so drop it
  33. define PPPD_DROP_INTERNAL_IF_PPOL2TP_H
  34. $(RM) $(@D)/include/linux/if_pppol2tp.h
  35. endef
  36. PPPD_POST_EXTRACT_HOOKS += PPPD_DROP_INTERNAL_IF_PPOL2TP_H
  37. # pppd defaults to /etc/ppp/resolv.conf, which not be writable and is
  38. # definitely not useful since the C library only uses
  39. # /etc/resolv.conf. Therefore, we change pppd to use /etc/resolv.conf
  40. # instead.
  41. define PPPD_SET_RESOLV_CONF
  42. $(SED) 's,ppp/resolv.conf,resolv.conf,' $(@D)/pppd/pathnames.h
  43. endef
  44. ifeq ($(BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF),y)
  45. PPPD_POST_EXTRACT_HOOKS += PPPD_SET_RESOLV_CONF
  46. endif
  47. define PPPD_CONFIGURE_CMDS
  48. $(SED) 's/FILTER=y/#FILTER=y/' $(PPPD_DIR)/pppd/Makefile.linux
  49. $(SED) 's/ifneq ($$(wildcard \/usr\/include\/pcap-bpf.h),)/ifdef FILTER/' $(PPPD_DIR)/*/Makefile.linux
  50. ( cd $(@D); $(TARGET_MAKE_ENV) ./configure --prefix=/usr )
  51. endef
  52. define PPPD_BUILD_CMDS
  53. $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" COPTS="$(TARGET_CFLAGS)" \
  54. -C $(@D) $(PPPD_MAKE_OPTS)
  55. endef
  56. ifeq ($(BR2_PACKAGE_PPPD_RADIUS),y)
  57. define PPPD_INSTALL_RADIUS
  58. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radattr.so \
  59. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radattr.so
  60. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radius.so \
  61. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radius.so
  62. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radrealms.so \
  63. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radrealms.so
  64. for m in $(PPPD_RADIUS_CONF); do \
  65. $(INSTALL) -m 644 -D $(PPPD_DIR)/pppd/plugins/radius/etc/$$m \
  66. $(TARGET_DIR)/etc/ppp/radius/$$m; \
  67. done
  68. $(SED) 's:/usr/local/etc:/etc:' \
  69. $(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
  70. $(SED) 's:/usr/local/sbin:/usr/sbin:' \
  71. $(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
  72. $(SED) 's:/etc/radiusclient:/etc/ppp/radius:g' \
  73. $(TARGET_DIR)/etc/ppp/radius/*
  74. endef
  75. endif
  76. define PPPD_INSTALL_TARGET_CMDS
  77. for sbin in $(PPPD_TARGET_BINS); do \
  78. $(INSTALL) -D $(PPPD_DIR)/$$sbin/$$sbin \
  79. $(TARGET_DIR)/usr/sbin/$$sbin; \
  80. done
  81. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/minconn.so \
  82. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/minconn.so
  83. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/passprompt.so \
  84. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/passprompt.so
  85. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/passwordfd.so \
  86. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/passwordfd.so
  87. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppoatm/pppoatm.so \
  88. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppoatm.so
  89. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/rp-pppoe/rp-pppoe.so \
  90. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/rp-pppoe.so
  91. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/rp-pppoe/pppoe-discovery \
  92. $(TARGET_DIR)/usr/sbin/pppoe-discovery
  93. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/winbind.so \
  94. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/winbind.so
  95. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/openl2tp.so \
  96. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/openl2tp.so
  97. $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/pppol2tp.so \
  98. $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppol2tp.so
  99. $(INSTALL) -D -m 0755 $(PPPD_DIR)/scripts/pon $(TARGET_DIR)/usr/bin/pon
  100. $(INSTALL) -D -m 0755 $(PPPD_DIR)/scripts/poff $(TARGET_DIR)/usr/bin/poff
  101. $(PPPD_INSTALL_RADIUS)
  102. endef
  103. define PPPD_INSTALL_STAGING_CMDS
  104. $(TARGET_MAKE_ENV) $(MAKE) INSTROOT=$(STAGING_DIR)/ -C $(@D) $(PPPD_MAKE_OPTS) install-devel
  105. endef
  106. $(eval $(generic-package))