1
0

Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #
  2. # Copyright (C) 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:=dhcp-forwarder
  9. PKG_VERSION:=0.11
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=@SAVANNAH/dhcp-fwd/
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_MD5SUM:=9d1ea7939fef93ae7d7caef43397a908
  14. PKG_LICENSE:=GPL-2.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Scott K Logan <logans@cottsay.net>
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/dhcp-forwarder
  21. SECTION:=net
  22. CATEGORY:=Network
  23. SUBMENU:=IP Addresses and Names
  24. TITLE:=DHCP relay agent
  25. URL:=http://www.nongnu.org/dhcp-fwd/
  26. USERID:=dhcp-fwd=375:dhcp-fwd=375
  27. endef
  28. define Package/dhcp-forwarder/description
  29. This program forwards DHCP messages between subnets with different sublayer
  30. broadcast domains. It is similarly to the DHCP relay agent dhcrelay of ISC's
  31. DHCP, but has the following features which are important for me:
  32. - Runs as non-root in a chroot-jail
  33. - Uses "normal" AF_INET sockets; this allows to uses packetfilters to filter
  34. incoming messages.
  35. - The DHCP agent IDs can be defined freely
  36. - Has a small memory footprint when using dietlibc
  37. It tries to be RFC 2131/2132 and 3046 compliant. Probably it works with BOOTP
  38. (RFC 951) also, but since the handling of the giaddr field is described
  39. misleading (see RFC 1542), there may occur problems.
  40. endef
  41. define Package/dhcp-forwarder/conffiles
  42. /etc/dhcp-fwd.conf
  43. endef
  44. CONFIGURE_ARGS += \
  45. --disable-dietlibc \
  46. define Build/Compile
  47. $(MAKE) -C $(PKG_BUILD_DIR) \
  48. DESTDIR="$(PKG_INSTALL_DIR)" \
  49. cfg_filename="/etc/dhcp-fwd.conf" \
  50. all install
  51. endef
  52. define Package/dhcp-forwarder/install
  53. $(INSTALL_DIR) $(1)/usr/bin $(1)/etc $(1)/etc/init.d
  54. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcp-fwd $(1)/usr/bin/
  55. $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/dhcp-fwd.conf $(1)/etc/
  56. $(INSTALL_BIN) ./files/dhcp-fwd.init $(1)/etc/init.d/dhcp-fwd
  57. endef
  58. $(eval $(call BuildPackage,dhcp-forwarder))