SHA256
8
0
forked from pool/papi
Files
papi/papi.spec

230 lines
5.6 KiB
RPMSpec

#
# spec file for package papi
#
# Copyright (c) 2012 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 http://bugs.opensuse.org/
#
Name: papi
BuildRequires: chrpath
BuildRequires: gcc-fortran
%if 0%{suse_version} > 1201
BuildRequires: libquadmath0
%else
%if 0%{suse_version} == 1201
BuildRequires: libquadmath46
%endif
%endif
BuildRequires: linux-kernel-headers
BuildRequires: ncurses-devel
%if 0%suse_version < 1102
%ifarch ia64
BuildRequires: libpfm-devel
%endif
%endif
%ifarch ppc64
BuildRequires: gcc-32bit
BuildRequires: gcc-fortran-32bit
BuildRequires: glibc-devel-32bit
BuildRequires: libgfortran45-32bit
%endif
Version: 4.4.0
Release: 0
Summary: Performance Application Programming Interface
License: BSD-3-Clause
Group: Development/Libraries/C and C++
Url: http://icl.cs.utk.edu/papi/index.html
Source: %{name}-%{version}.tar.gz
Source1: %{name}-rpmlintrc
#PAPI doesn't support the s390 architecture
ExcludeArch: s390, s390x
Patch1: papi-codecleanup.patch
Patch4: papi-no_test_for_pfm_msg_t_type.patch
Patch6: papi-lmsensors_check.patch
Patch7: papi-use_as_help_string.patch
Patch8: papi-list_components.patch
Patch9: papi-use_major_in_soname.patch
Patch10: papi-glibc-siginfo.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf >= 2.61
BuildRequires: automake
BuildRequires: libsensors4-devel
#BuildRequires: libibmad-devel
%ifarch ia64
%if 0%{suse_version} < 1102
%define libpfm_package 0
%define pfm_opt --with-pfm-prefix=%_prefix
%else
%define libpfm_package 1
%define pfm_opt ""
%endif
%else
%define libpfm_package 1
%define pfm_opt ""
%endif
%ifnarch ia64
%if 0%{suse_version} >= 1102
%define libpfm_package 1
%define pfm_opt ""
%endif
%endif
%define pfm_so_major 4
%description
PAPI aims to provide the tool designer and application engineer with a
consistent interface and methodology for use of the performance counter
hardware found in most major microprocessors. PAPI enables software
engineers to see, in near real time, the relation between software
performance and processor events.
%package devel
Summary: Software Development Kit for PAPI
Group: Development/Libraries/C and C++
Requires: linux-kernel-headers
Requires: papi = %{version}
%description devel
This package includes the C header files that specify the PAPI userspace
libraries and interfaces. This is required for rebuilding any program
that uses PAPI.
%package devel-static
Summary: Static PAPI libraries
Group: Development/Libraries/C and C++
Requires: linux-kernel-headers
Requires: papi-devel = %{version}
%description devel-static
This package includes the static PAPI libraries.
%package -n libpapi
Summary: PAPI runtime library
Group: System/Libraries
%description -n libpapi
This package contains the PAPI runtime library.
%if %{libpfm_package}
%package -n libpfm%{pfm_so_major}
Summary: Libpfm runtime library
Group: System/Libraries
%description -n libpfm%{pfm_so_major}
This package contains the libpfm runtime library.
%endif
%prep
%setup -q
%patch1
%patch4
%patch6
%patch7
%patch8
%patch9
%if 0%{?suse_version} > 1220
%patch10 -p1
%endif
%build
#export SUSE_ASNEEDED=0
cd src
autoreconf -fi
for c in lmsensors; do
cd components/$c
autoconf
./configure
cd -
done
export CFLAGS="%{optflags} -Wno-unused-parameter"
%configure --with-components="lmsensors coretemp example net" \
%{pfm_opt}
#DBG workaround to make sure libpfm just uses the normal CFLAGS
DBG="" make DOCDIR=%{_defaultdocdir}/%{name} %{?_smp_mflags}
%install
cd src
%makeinstall DOCDIR=%{_defaultdocdir}/%{name}
chrpath --delete %{buildroot}%{_libdir}/*.so*
%post -n libpapi -p /sbin/ldconfig
%postun -n libpapi -p /sbin/ldconfig
%post -n libpfm%{pfm_so_major} -p /sbin/ldconfig
%postun -n libpfm%{pfm_so_major} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/papi_clockres
%{_bindir}/papi_command_line
%{_bindir}/papi_cost
%{_bindir}/papi_decode
%{_bindir}/papi_event_chooser
%{_bindir}/papi_mem_info
%{_bindir}/papi_native_avail
%{_bindir}/papi_version
%{_bindir}/papi_xml_event_info
%{_bindir}/papi_component_avail
%{_bindir}/papi_error_codes
%{_bindir}/papi_multiplex_cost
%{_datadir}/%{name}
%{_bindir}/papi_avail
%doc ChangeLog*.txt LICENSE.txt README RELEASENOTES.txt
%files devel
%defattr(-,root,root)
%{_includedir}/f77papi.h
%{_includedir}/f90papi.h
%{_includedir}/fpapi.h
%{_includedir}/papi.h
%{_includedir}/papiStdEventDefs.h
%if 0%{suse_version} >= 1102
%{_includedir}/perfmon
%{_libdir}/libpfm.so
%else
%ifnarch ia64
%{_includedir}/perfmon
%{_libdir}/libpfm.so
%endif
%endif
%doc %{_mandir}/man3/*.gz
%doc %{_mandir}/man1/*
%{_libdir}/libpapi.so
%files devel-static
%defattr(-,root,root)
%{_libdir}/lib*.a
%files -n libpapi
%defattr(-,root,root)
%{_libdir}/libpapi.so.*
%if %{libpfm_package}
%files -n libpfm%{pfm_so_major}
%defattr(-,root,root)
%{_libdir}/libpfm.so.*
%endif
%changelog