File blogbench.spec of Package blogbench

# spec file for package blogbench
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           blogbench
Version:        1.1
Release:        0
Summary:        Filesystem Benchmark
License:        ISC
Group:          System/Benchmark
Source2:	%{name}.keyring
Source3:	%{name}.changes
Patch1:         fix-rewriters-argcount.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Blogbench is a portable filesystem benchmark that tries to reproduce the load
of a real-world busy file server. It stresses the filesystem with multiple
threads performing random reads, writes, and rewrites in order to get a
realistic idea of the scalability and the concurrency a system can handle.

%setup -q
%patch1 -p1
# remove _DATE_ and _TIME_ macros
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE3}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
find .  -name '*.[ch]' |\
    xargs sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g"

%configure --with-largefile
make %{?_smp_mflags}

make DESTDIR=%{buildroot} install %{?_smp_mflags}

%doc %{_mandir}/man8/blogbench.8%{ext_man}