2007-11-04 17:42:16 +00:00
|
|
|
#
|
2011-01-05 21:27:53 +00:00
|
|
|
# Copyright (C) 2007-2011 OpenWrt.org
|
2007-11-04 17:42:16 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
2010-07-24 13:08:35 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2007-11-04 17:42:16 +00:00
|
|
|
|
|
|
|
PKG_NAME:=i2c-tools
|
2011-01-05 21:27:53 +00:00
|
|
|
PKG_VERSION:=3.0.3
|
|
|
|
PKG_RELEASE:=1
|
2007-11-04 17:42:16 +00:00
|
|
|
|
2008-07-05 12:29:33 +00:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
2011-01-05 21:27:53 +00:00
|
|
|
PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases
|
|
|
|
PKG_MD5SUM:=511376eed04455cdb277ef19c5f73bb4
|
2007-11-04 17:42:16 +00:00
|
|
|
|
2011-06-25 00:28:46 +00:00
|
|
|
PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
|
2010-07-24 13:08:35 +00:00
|
|
|
|
2007-11-04 17:42:16 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2010-07-24 13:08:35 +00:00
|
|
|
$(call include_mk, python-package.mk)
|
2007-11-04 17:42:16 +00:00
|
|
|
|
|
|
|
define Package/i2c-tools
|
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
|
|
|
TITLE:=I2C tools for Linux
|
2009-06-13 17:01:55 +00:00
|
|
|
URL:=http://www.lm-sensors.org/wiki/I2CTools
|
2007-11-04 17:42:16 +00:00
|
|
|
endef
|
|
|
|
|
2010-07-24 13:08:35 +00:00
|
|
|
define Package/python-smbus
|
|
|
|
SUBMENU:=Python
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
TITLE:=Python bindings for the SMBUS
|
|
|
|
URL:=http://www.lm-sensors.org/wiki/I2CTools
|
2011-06-25 00:28:46 +00:00
|
|
|
DEPENDS:= +PACKAGE_python-smbus:python-mini +i2c-tools
|
2010-07-24 13:08:35 +00:00
|
|
|
endef
|
|
|
|
|
2007-11-04 17:42:16 +00:00
|
|
|
define Package/i2c-tools/description
|
|
|
|
This package contains an heterogeneous set of I2C tools for Linux. These tools
|
|
|
|
were originally part of the lm-sensors package.
|
|
|
|
Includes:
|
|
|
|
- i2cdetect
|
|
|
|
- i2cdump
|
|
|
|
- i2cget
|
|
|
|
- i2cset
|
|
|
|
endef
|
|
|
|
|
2010-07-24 13:08:35 +00:00
|
|
|
define Package/python-smbus/description
|
2011-01-05 21:27:53 +00:00
|
|
|
This package contains an heterogeneous set of I2C tools for Linux.
|
|
|
|
|
2010-07-24 13:08:35 +00:00
|
|
|
This package contain the python bindings for Linux SMBus access through i2c-dev.
|
|
|
|
endef
|
|
|
|
|
|
|
|
TARGET_CPPFLAGS += -I$(LINUX_DIR)/include
|
|
|
|
|
2011-06-25 00:28:46 +00:00
|
|
|
ifdef CONFIG_PACKAGE_python-smbus
|
|
|
|
define Build/Compile/python-smbus
|
|
|
|
$(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
|
|
|
|
$(call Build/Compile/PyMod,./py-smbus/, \
|
|
|
|
install --prefix="$(PKG_INSTALL_DIR)/usr", \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2007-11-04 17:42:16 +00:00
|
|
|
define Build/Compile
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
LINUX="$(LINUX_DIR)" \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
STAGING_DIR="$(STAGING_DIR)"
|
2011-06-25 00:28:46 +00:00
|
|
|
$(Build/Compile/python-smbus)
|
2007-11-04 17:42:16 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/i2c-tools/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/
|
|
|
|
endef
|
|
|
|
|
2010-07-24 13:08:35 +00:00
|
|
|
define PyPackage/python-smbus/filespec
|
|
|
|
+|$(PYTHON_PKG_DIR)/smbus.so
|
|
|
|
endef
|
|
|
|
|
2007-11-04 17:42:16 +00:00
|
|
|
$(eval $(call BuildPackage,i2c-tools))
|
2010-07-24 13:08:35 +00:00
|
|
|
$(eval $(call PyPackage,python-smbus))
|
|
|
|
$(eval $(call BuildPackage,python-smbus))
|