2 # Copyright (C) 2007-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases
17 PKG_MD5SUM:=511376eed04455cdb277ef19c5f73bb4
19 PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
21 include $(INCLUDE_DIR)/package.mk
22 $(call include_mk, python-package.mk)
24 define Package/i2c-tools
27 TITLE:=I2C tools for Linux
28 URL:=http://www.lm-sensors.org/wiki/I2CTools
31 define Package/python-smbus
35 TITLE:=Python bindings for the SMBUS
36 URL:=http://www.lm-sensors.org/wiki/I2CTools
37 DEPENDS:= +PACKAGE_python-smbus:python-mini +i2c-tools
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.
50 define Package/python-smbus/description
51 This package contains an heterogeneous set of I2C tools for Linux.
53 This package contain the python bindings for Linux SMBus access through i2c-dev.
56 TARGET_CPPFLAGS += -I$(LINUX_DIR)/include
58 ifdef CONFIG_PACKAGE_python-smbus
59 define Build/Compile/python-smbus
60 $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
61 $(call Build/Compile/PyMod,./py-smbus/, \
62 install --prefix="$(PKG_INSTALL_DIR)/usr", \
68 $(MAKE) -C $(PKG_BUILD_DIR) \
69 LINUX="$(LINUX_DIR)" \
71 STAGING_DIR="$(STAGING_DIR)"
72 $(Build/Compile/python-smbus)
75 define Package/i2c-tools/install
76 $(INSTALL_DIR) $(1)/usr/sbin
77 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/
78 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/
80 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/
83 define PyPackage/python-smbus/filespec
84 +|$(PYTHON_PKG_DIR)/smbus.so
87 $(eval $(call BuildPackage,i2c-tools))
88 $(eval $(call PyPackage,python-smbus))
89 $(eval $(call BuildPackage,python-smbus))