Name: pbench-agent Version: 0.44 %define gdist g59b9a60 Release: 33%{?gdist}%{!?gdist:} Summary: The pbench harness License: GPLv3+ URL: http://perf1.perf.lab.eng.bos.redhat.com/atheurer/pbench Source0: pbench-agent-%{version}.tar.gz Buildarch: noarch %if 0%{?rhel} == 6 %define turbostatpkg cpupowerutils %else %define turbostatpkg kernel-tools %endif Requires: bzip2, tar, xz, screen, perl, perl-JSON, perl-Switch, net-tools, numactl, perf, psmisc, bc, configtools >= 0.3, configtools < 0.4, sos Obsoletes: pbench <= 0.34 Conflicts: pbench <= 0.34 # Patch0: 0001-Avoid-reinstalling-pbench-sysstat-package-if-not-nec.patch %description The pbench harness %prep %setup # %patch0 -p2 %build %install rm -rf %{buildroot} mkdir -p %{buildroot}/opt/pbench-agent install -m 755 -d %{buildroot}/opt/pbench-agent/ansible install -m 755 -d %{buildroot}/opt/pbench-agent/ansible/ara install -m 755 -d %{buildroot}/opt/pbench-agent/bench-scripts install -m 755 -d %{buildroot}/opt/pbench-agent/bench-scripts/sample-tools install -m 755 -d %{buildroot}/opt/pbench-agent/bench-scripts/contrib install -m 755 -d %{buildroot}/opt/pbench-agent/bench-scripts/sample-tools/tools-default install -m 755 -d %{buildroot}/opt/pbench-agent/bench-scripts/postprocess install -m 755 -d %{buildroot}/opt/pbench-agent/bench-scripts/templates install -m 755 -d %{buildroot}/opt/pbench-agent/config install -m 755 -d %{buildroot}/opt/pbench-agent/config/production install -m 755 -d %{buildroot}/opt/pbench-agent/config/testing install -m 755 -d %{buildroot}/opt/pbench-agent/doc install -m 755 -d %{buildroot}/opt/pbench-agent/run-scripts install -m 755 -d %{buildroot}/opt/pbench-agent/tool-scripts install -m 755 -d %{buildroot}/opt/pbench-agent/tool-scripts/datalog install -m 755 -d %{buildroot}/opt/pbench-agent/tool-scripts/postprocess install -m 755 -d %{buildroot}/opt/pbench-agent/util-scripts install -m 755 -d %{buildroot}/opt/pbench-agent/util-scripts/contrib # being lazy here - some things should not be 755 for x in `cat MANIFEST` do install -m 755 $x %{buildroot}/opt/pbench-agent/`dirname $x` done %pre if adduser -M pbench 2>/dev/null ;then : ;else : ;fi %post # link the pbench profile, so it'll automatically be sourced on login ln -sf /opt/pbench-agent/profile /etc/profile.d/pbench-agent.sh %preun # if uninstalling, rather than updating, delete the link if [ $1 -eq 0 ] ;then rm -f /etc/profile.d/pbench-agent.sh fi %postun # if uninstalling, rather than updating, remove /opt/pbench-agent if [ $1 -eq 0 ] ;then rm -rf /opt/pbench-agent fi %posttrans cd /opt/pbench-agent/tool-scripts # kvm-spinlock symlinks kvmslinks="blktrace cpuacct dm-cache docker docker-info\ kvmstat kvmtrace numastat openvswitch proc-interrupts proc-sched_debug proc-vmstat\ qemu-migrate rabbit sysfs tcpdump turbostat virsh-migrate vmstat" for x in $kvmslinks ;do ln -sf kvm-spinlock $x done ln -sf sar iostat ln -sf sar mpstat ln -sf sar pidstat # updating 0.34 to 0.35 does not run the %post script, so # we add a %posttrans script that will add the new links. cd /opt/pbench-agent/util-scripts ln -sf pbench-postprocess-tools pbench-kill-tools ln -sf pbench-postprocess-tools pbench-start-tools ln -sf pbench-postprocess-tools pbench-stop-tools ln -sf pbench-move-results pbench-copy-results cd /opt/pbench-agent/bench-scripts ln -sf postprocess/compare-bench-results compare-bench-results %files %defattr(664,pbench,pbench,755) /opt/pbench-agent/base /opt/pbench-agent/config /opt/pbench-agent/doc %ghost %attr(0400,pbench,pbench) /opt/pbench-agent/id_rsa /opt/pbench-agent/MANIFEST /opt/pbench-agent/VERSION /opt/pbench-agent/profile %ghost %attr(0664,pbench,pbench) /opt/pbench-agent/config/pbench-agent.cfg %attr(775,pbench,pbench) /opt/pbench-agent/bench-scripts %attr(775,pbench,pbench) /opt/pbench-agent/run-scripts %attr(775,pbench,pbench) /opt/pbench-agent/tool-scripts %attr(775,pbench,pbench) /opt/pbench-agent/util-scripts %attr(775,pbench,pbench) /opt/pbench-agent/ansible %attr(775,pbench,pbench) /opt/pbench-agent/ansible/ara %doc