File intel-cmt-cat.spec of Package intel-cmt-cat.4747

# Copyright (c) 2016, Intel Corporation
# Copyright (c) 2016, SUSE
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#     * Redistributions of source code must retain the above copyright notice,
#       this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of Intel Corporation nor the names of its contributors
#       may be used to endorse or promote products derived from this software
#       without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           intel-cmt-cat
Version:        0.1.4
Release:        1
License:        BSD-3-Clause
Summary:        Provides command line interface to CMT, MBM, CAT and CDP technologies
Url:            https://github.com/01org/%{name}
Group:          Development/Tools
Source0:        https://github.com/01org/%{name}/archive/v%{version}.tar.gz
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0:         intel-cmt-cat-DESTDIR.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1:         intel-cmt-cat-Makefile.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch2:         intel-cmt-cat-dynlib.patch
BuildRequires:  doxygen
ExclusiveArch:  x86_64 i686 i586

%global so_ver      1
%global githubver   0.1.4
%global githubfull  %{name}-%{version}
%global pkgname     intel-cmt-cat

%global make_flags EXTRA_CFLAGS="%{optflags}" SHARED=y PREFIX=%{_prefix} MAN_DIR=%{_mandir}/man8 LIB_DIR=%{_libdir}

%global runtime_pkg libpqos%{so_ver}

%description
This software package provides basic support for
Cache Monitoring Technology (CMT), Memory Bandwidth Monitoring (MBM),
Cache Allocation Technology (CAT) and Code Data Prioratization (CDP).

CMT, MBM and CAT are configured using Model Specific Registers (MSRs)
to measure last level cache occupancy, set up the class of service masks and
manage the association of the cores/logical threads to a class of service.
The software executes in user space, and access to the MSRs is
obtained through a standard Linux* interface. The virtual file system
provides an interface to read and write the MSR registers but
it requires root privileges.

%package     -n %{runtime_pkg}
Summary:        Runtime qpos library
Group:          System/Libraries

%description -n %{runtime_pkg}
PQoS library provides API to detect and configure Intel(R) RDT including:
Cache Monitoring Technology (CMT), Memory Bandwidth Monitoring (MBM),
Cache Allocation Technology (CAT), Code and Data Prioritization (CDP) Technology.

%package        devel
Summary:        Development package for intel-cmt-cat
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description    devel
PQoS library provides API to detect and configure Intel(R) RDT including:
Cache Monitoring Technology (CMT), Memory Bandwidth Monitoring (MBM),
Cache Allocation Technology (CAT), Code and Data Prioritization (CDP) Technology.

This package contains all that is needed to develop/compile
applications that use PQoS.

%prep
%setup -n %{githubfull}
%patch0
%patch1
%patch2

%build
make %{?_smp_mflags} %{make_flags}

%install
make DESTDIR=%{buildroot} %{make_flags} install
#We don't need to package the symlink to the soname as ldconfig will
#create it

rm -f %{buildroot}%{_libdir}/*.so.%{so_ver}

%post -n %{runtime_pkg} -p /sbin/ldconfig

%postun -n %{runtime_pkg} -p /sbin/ldconfig

%files
%defattr(-, root, root, -)
%doc LICENSE ChangeLog
%{_bindir}/pqos
%{_mandir}/man8/pqos.8.gz

%files devel
%defattr(-, root, root, -)
%{_includedir}/pqos.h
%{_libdir}/*.so

%files     -n %{runtime_pkg}
%defattr(-, root, root, -)
%{_libdir}/*.so.%{so_ver}.*

%changelog
openSUSE Build Service is sponsored by