2 # Copyright (C) 2007-2015 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
14 PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases/ \
15 http://fossies.org/linux/misc/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18 PKG_MD5SUM:=7104a1043d11a5e2c7b131614eb1b962
21 PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
23 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
25 PKG_LICENSE_FILES:=COPYING
27 include $(INCLUDE_DIR)/package.mk
28 $(call include_mk, python-package.mk)
29 $(call include_mk, python3-package.mk)
31 define Package/i2c/Default
32 URL:=http://lm-sensors.org/wiki/I2CTools
36 define Package/i2c-tools
37 $(call Package/i2c/Default)
40 TITLE+=tools for Linux
43 define Package/python-smbus
44 $(call Package/i2c/Default)
48 TITLE:=Python bindings for the SMBUS
49 DEPENDS:=+python-light
52 define Package/python3-smbus
53 $(call Package/i2c/Default)
57 TITLE:=Python bindings for the SMBUS
58 DEPENDS:=+python3-light
61 define Package/i2c-tools/description
62 This package contains an heterogeneous set of I2C tools for Linux. These tools
63 were originally part of the lm-sensors package.
66 define Package/python-smbus/description
67 This package contain the python bindings for Linux SMBus access through i2c-dev.
70 define Package/python3-smbus/description
71 This package contain the python bindings for Linux SMBus access through i2c-dev.
74 TARGET_CPPFLAGS += -I$(PKG_BUILD_DIR)/include
76 ifdef CONFIG_PACKAGE_python-smbus
77 define Build/Compile/python-smbus
78 $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
79 $(call Build/Compile/PyMod,./py-smbus/, \
80 install --prefix="$(PKG_INSTALL_DIR)/usr", \
85 ifdef CONFIG_PACKAGE_python3-smbus
86 define Build/Compile/python3-smbus
87 $(if $(Build/Compile/Py3Mod),,@echo Python3 packaging code not found.; false)
88 $(call Build/Compile/Py3Mod,./py-smbus/, \
89 install --prefix="$(PKG_INSTALL_DIR)/usr", \
95 $(MAKE) -C $(PKG_BUILD_DIR) \
96 LINUX="$(LINUX_DIR)" \
98 STAGING_DIR="$(STAGING_DIR)" \
99 LDFLAGS="$(TARGET_LDFLAGS)" \
100 CFLAGS="$(TARGET_CFLAGS)"
101 $(Build/Compile/python-smbus)
102 $(Build/Compile/python3-smbus)
105 define Package/i2c-tools/install
106 $(INSTALL_DIR) $(1)/usr/sbin
107 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/
108 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/
109 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/
110 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/
113 define PyPackage/python-smbus/filespec
117 define PyPackage/python3-smbus/filespec
121 $(eval $(call BuildPackage,i2c-tools))
122 $(eval $(call PyPackage,python-smbus))
123 $(eval $(call BuildPackage,python-smbus))
124 $(eval $(call PyPackage,python3-smbus))
125 $(eval $(call BuildPackage,python3-smbus))