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.

116 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2015 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:=canutils
  9. PKG_RELEASE=1
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL:=https://github.com/linux-can/can-utils
  12. PKG_SOURCE_VERSION:=0e3ff3b3157e456d4b6343f5d4b42ef692bce538
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  15. PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
  16. PKG_LICENSE:=GPL-2.0+
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  18. PKG_FIXUP:=autoreconf
  19. include $(INCLUDE_DIR)/package.mk
  20. FILES:=canbusload can-calc-bit-timing candump \
  21. cangen cangw canplayer cansniffer cansend
  22. define Package/canutils/Default
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. URL:=https://github.com/linux-can/can-utils
  26. TITLE:=CAN userspace utilities and tools
  27. endef
  28. define Package/canutils
  29. $(call Package/canutils/Default)
  30. MENU:=1
  31. endef
  32. define Package/canutils-log-conversion
  33. $(call Package/canutils/Default)
  34. TITLE:=canutils log conversion
  35. DEPENDS:=canutils
  36. endef
  37. define PartGen
  38. define Package/canutils-$(1)
  39. $(call Package/canutils/Default)
  40. TITLE:=$(1) tool from canutils
  41. DEPENDS:=canutils
  42. endef
  43. endef
  44. $(foreach file,$(FILES),$(eval $(call PartGen,$(file))))
  45. define Package/canutils/install
  46. endef
  47. define Package/canutils-log-conversion/install
  48. $(INSTALL_DIR) $(1)/usr/bin
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/asc2log $(1)/usr/bin/
  50. $(INSTALL_BIN) $(PKG_BUILD_DIR)/log2asc $(1)/usr/bin/
  51. $(INSTALL_BIN) $(PKG_BUILD_DIR)/log2long $(1)/usr/bin/
  52. endef
  53. define PartInstall
  54. define Package/canutils-$(1)/install
  55. $(INSTALL_DIR) $$(1)/usr/bin
  56. $(INSTALL_BIN) \
  57. $(PKG_BUILD_DIR)/$(1) \
  58. $$(1)/usr/bin/
  59. endef
  60. endef
  61. define Package/canutils-log-conversion/description
  62. asc2log - convert ASC logfile to compact CAN frame logfile.
  63. log2asc - convert compact CAN frame logfile to ASC logfile.
  64. log2long - convert compact CAN frame representation into user readable.
  65. endef
  66. define Package/canutils-canbusload/description
  67. canbusload - display the load percentage of can buses.
  68. endef
  69. define Package/canutils-can-calc-bit-timing/description
  70. can-calc-bit-timing - calculate hw bittiming for supported can chips.
  71. endef
  72. define Package/canutils-candump/description
  73. candump - dumps can frames to terminal, logfile or another can device,
  74. with optional filtering.
  75. endef
  76. define Package/canutils-cangen/description
  77. cangen - CAN frames generator for testing purposes.
  78. endef
  79. define Package/canutils-cangw/description
  80. cangw - manage PF_CAN netlink gateway.
  81. endef
  82. define Package/canutils-canplayer/description
  83. canplayer - replay a compact CAN frame logfile to CAN devices.
  84. endef
  85. define Package/canutils-cansend/description
  86. cansend - simple command line tool to send CAN-frames via CAN_RAW sockets.
  87. endef
  88. $(foreach file,$(FILES),$(eval $(call PartInstall,$(file))))
  89. $(eval $(call BuildPackage,canutils))
  90. $(eval $(call BuildPackage,canutils-log-conversion))
  91. $(foreach file,$(FILES),$(eval $(call BuildPackage,canutils-$(file))))