[packages] new package: libugpio - library for accessing gpios via sysfs interface
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 21 Jan 2013 15:27:36 +0000 (15:27 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 21 Jan 2013 15:27:36 +0000 (15:27 +0000)
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@35269 3c298f89-4303-0410-b956-a3cf2f4a3e73

libs/libugpio/Makefile [new file with mode: 0644]

diff --git a/libs/libugpio/Makefile b/libs/libugpio/Makefile
new file mode 100644 (file)
index 0000000..3aed0d1
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libugpio
+PKG_VERSION:=0.0.1
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/mhei/libugpio.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=8235d04096bfa9db594d5df75c5cd634a3bbc39a
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libugpio
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=https://github.com/mhei/libugpio
+  TITLE:=Library for using sysfs gpio interface from C programs
+  DEPENDS:=@GPIO_SUPPORT
+endef
+
+define Package/libugpio/description
+  libugpio is a library to ease the use of linux kernel's sysfs
+  gpio interface from C programs and/or other libraries.
+endef
+
+define Package/gpioctl-sysfs
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Tool for controlling gpio pins
+  DEPENDS:=+libugpio
+endef
+
+define Package/gpioctl-sysfs/description
+  Tool for controlling gpio pins using the sysfs api provided by the kernel.
+endef
+
+define Build/Configure
+       ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
+       $(call Build/Configure/Default)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ugpio $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libugpio.{so*,a} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libugpio.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libugpio/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libugpio.so* $(1)/usr/lib/
+endef
+
+define Package/gpioctl-sysfs/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpioctl $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libugpio))
+$(eval $(call BuildPackage,gpioctl-sysfs))