File paflib.spec of Package paflib

#
# spec file for package paflib
#
# Copyright (c) 2014 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:           paflib
%define lname	libpaflib0
Version:        0.1
Release:        0
Summary:        Exposes Power Architecture Facilities to userspace via an API
License:        MIT
Group:          Development/Libraries/C and C++

Url:            https://github.com/paflib
Source:         paflib-%{version}.tar.bz2
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  ppc64 ppc64le
Patch0:         paflib.callback_toc_elfv2.patch 
Patch1:         paflib.no_return_nonvoid_conftest.patch 
Patch2:         paflib.paf_ebb_branches.patch 
Patch3:         paflib.reset_MMCR0_independently_of_PAF_EBB_FLAGS_RESET_PMU.patch 
Patch4:         paflib.elf_EBB_fixes.patch
Patch5:         paflib.fix_broken_EBB_sample_period.patch
Patch6:         paflib.test_ebb_pmu_clobber_testcase.patch 

%description
PAFLib is a IBM written library which exposes Power Architecture Facilities
to userspace via an API. This includes the Data Stream Control Register Facility
(DSCR) and the Event-Based Branching facility (EBB). Linux kernel 3.9 has
exposed problem-state DSCR usage for ISA 2.06 (POWER7 – emulated) and ISA 2.07
(POWER8 – in hardware). Linux 3.10 has exposed the EBB facility.

%package -n %lname
Summary:        Exposes Power Architecture Facilities to userspace via an API
Group:          System/Libraries

%description -n %lname
PAFLib is a IBM written library which exposes Power Architecture Facilities
to userspace via an API. This includes the Data Stream Control Register Facility
(DSCR) and the Event-Based Branching facility (EBB). Linux kernel 3.9 has
exposed problem-state DSCR usage for ISA 2.06 (POWER7 – emulated) and ISA 2.07
(POWER8 – in hardware). Linux 3.10 has exposed the EBB facility.

%package        devel
Summary:        Development files for PAFLib
Group:          Development/Libraries/C and C++
Requires:       %lname = %version

%description    devel
Contains header files for building with PAFLib.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

%build
./autogen.sh
# wants to configure in a separate build directory
mkdir paflib-build
cd paflib-build
%define _configure ../configure
%configure
make %{?_smp_mflags}

%install
cd paflib-build
make install DESTDIR="%buildroot"
rm -f "%buildroot/%_libdir"/*.la

%post   -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%defattr(-,root,root)
%{_libdir}/libpaf*.so.0*

%files devel
%defattr(-,root,root,-)
%doc COPYING
%{_includedir}/paf
%{_includedir}/paf/*.h
%{_libdir}/libpaf*.a
%{_libdir}/libpaf*.so
%{_mandir}/man3/*

%changelog
openSUSE Build Service is sponsored by