[PATCH] [packages] New package libcunit
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 29 Apr 2011 15:33:07 +0000 (15:33 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 29 Apr 2011 15:33:07 +0000 (15:33 +0000)
Add to CUnit to /libs/

CUnit is a lightweight system for writing, administering, and running unit
tests in C.  It provides C programmers a basic testing functionality with a
flexible variety of user interfaces.

Signed-off-by: Florian Sesser <sesser@in.tum.de>
SVN-Revision: 26790

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

diff --git a/libs/libcunit/Makefile b/libs/libcunit/Makefile
new file mode 100644 (file)
index 0000000..7cec339
--- /dev/null
@@ -0,0 +1,71 @@
+# 
+# Copyright (C) 2011 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:=libcunit
+PKG_VERSION:=2.1-0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=CUnit-$(PKG_VERSION)-src.tar.gz
+PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/cunit/CUnit/$(PKG_VERSION)
+PKG_MD5SUM:=f4f53d2c41e9315a91b4f14a1706fe4f
+PKG_BUILD_DIR:=$(BUILD_DIR)/CUnit-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcunit
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Unit testing framework for C
+  URL:=http://cunit.sourceforge.net/
+endef
+
+define Package/libcunit/description
+  CUnit, lightweight unit testing for C
+  CUnit is a lightweight system for writing, administering, and running unit
+  tests in C.  It provides C programmers a basic testing functionality with a
+  flexible variety of user interfaces.
+endef
+
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               , \
+               BUILD_CC="$(TARGET_CC)" \
+               HOSTCC="$(HOSTCC)" \
+       )
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CCOPT="$(TARGET_CFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+endef
+
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include/CUnit
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/CUnit/* \
+               $(1)/usr/include/CUnit
+
+       mkdir -p $(1)/usr/lib
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libcunit.* \
+               $(1)/usr/lib
+endef
+
+
+define Package/libcunit/install
+       $(INSTALL_DIR)  $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcunit.* $(1)/usr/lib
+endef
+
+
+$(eval $(call BuildPackage,libcunit))