File iozone.spec of Package iozone

%define realname iozone
%define realver  3_489
%define srcext   tar

# Common info
Name:          %{realname}
Version:       %(tr _ . <<< %realver)
Release:       wiz%{?extraver:0.}1%{?dist}
License:       Freeware
Group:         Productivity/File utilities
URL:           http://www.iozone.org/
Summary:       Filesystem benchmark tool

# Build-time parameters
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://www.iozone.org/src/current/iozone%{realver}.%{srcext}

%description
IOzone is a filesystem benchmark tool. The benchmark generates and measures
a variety of file operations. Iozone has been ported to many machines and runs
under many operating systems.

Iozone is useful for performing a broad filesystem analysis of a vendor’s
computer platform. The benchmark tests file I/O performance for the
following operations:

    Read, write, re-read, re-write, read backwards, read strided, fread, fwrite,
    random read, pread ,mmap, aio_read, aio_write

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}%{realver}%{?extraver}

%build
%ifarch x86_64
%define target -AMD64
%endif
%{__sed} -ri '/^linux-AMD64:/,/^$/ s/-O3/$(CFLAGS)/' src/current/makefile
%{__make} %{?_smp_mflags} -C src/current \
 %{_os}%{target} \
 CFLAGS="%{optflags} %{?gcc_lto}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,now -Wl,-z,relro %{?gcc_lto}"

%install
%{__install} -d -m0755 %{buildroot}%{_bindir}
%{__install} -d -m0755 %{buildroot}%{_mandir}/man1
%{__install} -d -m0755 %{buildroot}%{_datadir}/%{name}
for BIN in iozone fileop pit_server; do
    %{__install} -m0755 src/current/$BIN %{buildroot}%{_bindir}/$BIN
done
%{__install} -m0644 docs/iozone.1 %{buildroot}%{_mandir}/man1
for SCRIPT in Generate_Graphs gengnuplot.sh iozone_visualizer.pl report.pl; do
    %{__install} -m0755 src/current/$SCRIPT %{buildroot}%{_datadir}/%{name}/$SCRIPT
done
for DATA in Gnuplot.txt client_list gnu3d.dem gnuplot.dem gnuplotps.dem read_telemetry write_telemetry; do
    %{__install} -m0644 src/current/$DATA %{buildroot}%{_datadir}/%{name}/$DATA
done

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%{_bindir}/*
%{_datadir}/%{name}/
%doc %{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by