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.

72 lines
1.9 KiB

  1. #
  2. # Copyright (C) 2012 Jo-Philipp Wich <jo@mein.io>
  3. #
  4. # This is free software, licensed under the Apache 2 license.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=owipcalc
  8. PKG_RELEASE:=7
  9. PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
  10. PKG_LICENSE:=Apache-2.0
  11. include $(INCLUDE_DIR)/package.mk
  12. define Package/owipcalc
  13. SECTION:=utils
  14. CATEGORY:=Utilities
  15. TITLE:=Simple IPv4/IPv6 address calculator
  16. DEPENDS:=+libowipcalc
  17. endef
  18. define Package/owipcalc/description
  19. The owipcalc utility supports a number of calculations and tests to work
  20. with ip-address ranges, this is useful for scripts that e.g. need to
  21. partition ipv6-prefixes into small subnets or to calculate address ranges
  22. for dhcp pools.
  23. endef
  24. define Package/libowipcalc
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=Owipcalc Library
  28. endef
  29. define Package/libowipcalc/description
  30. The owipcalc library supports a number of calculations and tests to work
  31. with ip-address ranges, this is useful for programms that e.g. need to
  32. partition ipv6-prefixes into small subnets or to calculate address ranges
  33. for dhcp pools.
  34. endef
  35. define Build/Configure
  36. endef
  37. define Build/Compile
  38. $(TARGET_CC) $(TARGET_CFLAGS) \
  39. -shared -fPIC -o $(PKG_BUILD_DIR)/libowipcalc.so $(PKG_BUILD_DIR)/owipcalc.c
  40. $(TARGET_CC) $(TARGET_CFLAGS) \
  41. -o $(PKG_BUILD_DIR)/owipcalc $(PKG_BUILD_DIR)/main.c -L$(PKG_BUILD_DIR)/ -lowipcalc
  42. endef
  43. define Build/InstallDev
  44. $(INSTALL_DIR) $(1)/usr/include/
  45. $(CP) $(PKG_BUILD_DIR)/owipcalc.h $(1)/usr/include/
  46. $(INSTALL_DIR) $(1)/usr/lib
  47. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libowipcalc.so $(1)/usr/lib/libowipcalc.so
  48. endef
  49. define Package/owipcalc/install
  50. $(INSTALL_DIR) $(1)/usr/bin
  51. $(INSTALL_BIN) $(PKG_BUILD_DIR)/owipcalc $(1)/usr/bin/owipcalc
  52. endef
  53. define Package/libowipcalc/install
  54. $(INSTALL_DIR) $(1)/usr/lib
  55. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libowipcalc.so $(1)/usr/lib/libowipcalc.so
  56. endef
  57. $(eval $(call BuildPackage,libowipcalc))
  58. $(eval $(call BuildPackage,owipcalc))