From d6da6aac3f28799098f2f77c96273a00f89bb196 Mon Sep 17 00:00:00 2001 From: Claudio Mignanti Date: Sat, 24 Jul 2010 13:08:35 +0000 Subject: [PATCH] [packages] i2c-tools: Package also the python bindings SVN-Revision: 22376 --- utils/i2c-tools/Makefile | 35 +++++++++++++++++-- .../i2c-tools/patches/100-linux_include.patch | 13 +++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 utils/i2c-tools/patches/100-linux_include.patch diff --git a/utils/i2c-tools/Makefile b/utils/i2c-tools/Makefile index e69d3a0a89..4fa23cceeb 100644 --- a/utils/i2c-tools/Makefile +++ b/utils/i2c-tools/Makefile @@ -1,21 +1,25 @@ # -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=i2c-tools PKG_VERSION:=3.0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases/ PKG_MD5SUM:=b546345ac19db56719dea6b8199f11e0 +PKG_BUILD_DEPENDS:=python + include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) define Package/i2c-tools SECTION:=utils @@ -25,6 +29,15 @@ define Package/i2c-tools URL:=http://www.lm-sensors.org/wiki/I2CTools endef +define Package/python-smbus + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python bindings for the SMBUS + URL:=http://www.lm-sensors.org/wiki/I2CTools + DEPENDS:= +python-mini +i2c-tools +endef + 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. @@ -35,11 +48,23 @@ define Package/i2c-tools/description - i2cset endef +define Package/python-smbus/description + This package contains an heterogeneous set of I2C tools for Linux. + + This package contain the python bindings for Linux SMBus access through i2c-dev. +endef + +TARGET_CPPFLAGS += -I$(LINUX_DIR)/include + define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) \ LINUX="$(LINUX_DIR)" \ CC="$(TARGET_CC)" \ STAGING_DIR="$(STAGING_DIR)" + $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false) + $(call Build/Compile/PyMod,./py-smbus/, \ + install --prefix="$(PKG_INSTALL_DIR)/usr", \ + ) endef define Package/i2c-tools/install @@ -50,4 +75,10 @@ define Package/i2c-tools/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/ endef +define PyPackage/python-smbus/filespec ++|$(PYTHON_PKG_DIR)/smbus.so +endef + $(eval $(call BuildPackage,i2c-tools)) +$(eval $(call PyPackage,python-smbus)) +$(eval $(call BuildPackage,python-smbus)) diff --git a/utils/i2c-tools/patches/100-linux_include.patch b/utils/i2c-tools/patches/100-linux_include.patch new file mode 100644 index 0000000000..4491b262ff --- /dev/null +++ b/utils/i2c-tools/patches/100-linux_include.patch @@ -0,0 +1,13 @@ +Index: i2c-tools-3.0.2/py-smbus/smbusmodule.c +=================================================================== +--- i2c-tools-3.0.2.orig/py-smbus/smbusmodule.c 2010-07-23 23:09:16.000000000 +0200 ++++ i2c-tools-3.0.2/py-smbus/smbusmodule.c 2010-07-23 23:09:29.000000000 +0200 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + /* + -- 2.30.2