packages: add bonnie++
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 8 Feb 2012 16:39:24 +0000 (16:39 +0000)
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 8 Feb 2012 16:39:24 +0000 (16:39 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@30384 3c298f89-4303-0410-b956-a3cf2f4a3e73

utils/bonnie++/Makefile [new file with mode: 0644]
utils/bonnie++/patches/001-cross_compile_fix.patch [new file with mode: 0644]
utils/bonnie++/patches/002-add-verbose-error-messages.patch [new file with mode: 0644]

diff --git a/utils/bonnie++/Makefile b/utils/bonnie++/Makefile
new file mode 100644 (file)
index 0000000..bb77113
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2009 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:=bonnie++
+PKG_VERSION:=1.96
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/experimental/
+PKG_MD5SUM:=7b8594559f00887d2865de1838328b35
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bonniexx
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libstdcpp +libpthread
+  TITLE:=Bonnie++ - hard drive bottleneck testing program.
+  URL:=http://www.coker.com.au/bonnie++/
+endef
+
+define Package/bonniexx/description
+  Bonnie++ is a benchmark suite that is aimed at performing a number of simple
+  tests of hard drive and file system performance.
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               TARGET_CXX="$(TARGET_CXX)" \
+               TARGET_LINK="$(TARGET_CXX)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all
+endef
+
+define Package/bonniexx/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/bonnie++ $(1)/usr/bin/
+       $(CP) $(PKG_BUILD_DIR)/bon_csv2html $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,bonniexx))
diff --git a/utils/bonnie++/patches/001-cross_compile_fix.patch b/utils/bonnie++/patches/001-cross_compile_fix.patch
new file mode 100644 (file)
index 0000000..98a933a
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/configure
++++ b/configure
+@@ -4372,7 +4372,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+-   { (exit 1); exit 1; }; }
++   { (exit 0); exit 0; }; }
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,7 @@
+ EXES=bonnie++ zcav getc_putc getc_putc_helper
+ EXE=bon_csv2html generate_randfile
++TARGET_CXX=g++
++TARGET_LINK=g++
+ all: $(EXE) $(EXES)
+@@ -10,8 +12,8 @@ eprefix=${prefix}
+ #MORE_WARNINGS=-Weffc++
+ WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS)
+ CFLAGS=-O2  -DNDEBUG $(WFLAGS) $(MORECFLAGS)
+-CXX=g++ $(CFLAGS)
+-LINK=g++
++CXX=$(TARGET_CXX) $(CFLAGS)
++LINK=$(TARGET_LINK)
+ THREAD_LFLAGS=-lpthread
+ INSTALL=/usr/bin/install -c
diff --git a/utils/bonnie++/patches/002-add-verbose-error-messages.patch b/utils/bonnie++/patches/002-add-verbose-error-messages.patch
new file mode 100644 (file)
index 0000000..ccec8e8
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/bon_file.cpp
++++ b/bon_file.cpp
+@@ -464,25 +464,37 @@ int COpenTest::delete_sequential(BonTime
+     }
+     if(m_number_directories != 1)
+     {
+-      if(chdir("..") || rmdir(buf))
++      if(chdir(".."))
+       {
++        io_error("chdir");
++        return -1;
++      }
++      if(rmdir(buf))
++      {
++        fprintf(stderr, "Unable to delete directory '%s'\n", buf);
+         io_error("rmdir");
+         return -1;
+       }
+     }
+   }
+-  if(chdir("..") || rmdir(m_dirname))
++  if(count != m_number)
+   {
+-    io_error("rmdir");
++    fprintf(stderr, "Expected %d files but only got %d\n", m_number, count);
+     return -1;
+   }
+-  delete m_dirname;
+-  m_dirname = NULL;
+-  if(count != m_number)
++  if(chdir(".."))
+   {
+-    fprintf(stderr, "Expected %d files but only got %d\n", m_number, count);
++    io_error("chdir");
++    return -1;
++  }
++  if(rmdir(m_dirname))
++  {
++    fprintf(stderr, "Unable to delete directory '%s'\n", m_dirname);
++    io_error("rmdir");
+     return -1;
+   }
++  delete m_dirname;
++  m_dirname = NULL;
+   sync();
+   timer.stop_and_record(DelSeq);
+   timer.add_latency(DelSeq, dur.getMax());