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.

95 lines
2.4 KiB

  1. #
  2. # Copyright (C) 2007-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:=i2c-tools
  9. PKG_VERSION:=3.1.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases/ \
  12. http://fossies.org/linux/misc/
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_MD5SUM:=7104a1043d11a5e2c7b131614eb1b962
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
  17. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  18. PKG_LICENSE:=GPLv2
  19. PKG_LICENSE_FILES:=COPYING
  20. include $(INCLUDE_DIR)/package.mk
  21. $(call include_mk, python-package.mk)
  22. define Package/i2c/Default
  23. URL:=http://lm-sensors.org/wiki/I2CTools
  24. TITLE:=I2C
  25. endef
  26. define Package/i2c-tools
  27. $(call Package/i2c/Default)
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. TITLE+=tools for Linux
  31. endef
  32. define Package/python-smbus
  33. $(call Package/i2c/Default)
  34. SUBMENU:=Python
  35. SECTION:=lang
  36. CATEGORY:=Languages
  37. TITLE:=Python bindings for the SMBUS
  38. DEPENDS:=+python-light
  39. endef
  40. define Package/i2c-tools/description
  41. This package contains an heterogeneous set of I2C tools for Linux. These tools
  42. were originally part of the lm-sensors package.
  43. endef
  44. define Package/python-smbus/description
  45. This package contain the python bindings for Linux SMBus access through i2c-dev.
  46. endef
  47. TARGET_CPPFLAGS += -I$(PKG_BUILD_DIR)/include
  48. ifdef CONFIG_PACKAGE_python-smbus
  49. define Build/Compile/python-smbus
  50. $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
  51. $(call Build/Compile/PyMod,./py-smbus/, \
  52. install --prefix="$(PKG_INSTALL_DIR)/usr", \
  53. )
  54. endef
  55. endif
  56. define Build/Compile
  57. $(MAKE) -C $(PKG_BUILD_DIR) \
  58. LINUX="$(LINUX_DIR)" \
  59. CC="$(TARGET_CC)" \
  60. STAGING_DIR="$(STAGING_DIR)" \
  61. LDFLAGS="$(TARGET_LDFLAGS)" \
  62. CFLAGS="$(TARGET_CFLAGS)"
  63. $(Build/Compile/python-smbus)
  64. endef
  65. define Package/i2c-tools/install
  66. $(INSTALL_DIR) $(1)/usr/sbin
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/
  68. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/
  69. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/
  70. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/
  71. endef
  72. define PyPackage/python-smbus/filespec
  73. +|$(PYTHON_PKG_DIR)/smbus.so
  74. endef
  75. $(eval $(call BuildPackage,i2c-tools))
  76. $(eval $(call PyPackage,python-smbus))
  77. $(eval $(call BuildPackage,python-smbus))