File CodeAnalyst.spec of Package CodeAnalyst

#
# spec file for package CodeAnalyst (Version 2.8.54)
#
# Copyright (c) 2010 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/
#


Summary:        CodeAnalyst is a Performance Analysis Suite for AMD-based System

Name:           CodeAnalyst
Version:        2.8.54
Release:        2
License:        GPLv2
Group:          Development/Tools/Other
Url:            http://developer.amd.com/cpu/CodeAnalyst/codeanalystlinux
Source0:        http://ftp-developer.amd.com/user/ssuthiku/CALinuxSnapshots/%{name}-gui-%{version}.tar.bz2
Source1:        CodeAnalyst.desktop
Source2:        DiffAnalyst.desktop
# Use oprofile default cpu/watershed/event-buffer size
# since using stock oprofile daemon/driver
Patch0:         ca-use-oprofile-default-buffersize.patch
# Use on-line help
Patch1:         ca-da-online-help.patch
# Fix basename issue when building
Patch2:         ca-fix-basename.patch
# Fix basename issue when building
Patch3:         ca-fix-oprofile-ibs-check.patch
# Use dynamic feature check
Patch4:         ca-use-dynamic-feature-check.patch
# Fix permission issue
Patch5:         ca-fix-su.patch
# Enable OProfile-0.9.6
Patch6:         ca-enable-oprofile-0.9.6.patch
Requires:       binutils
Requires:       oprofile >= 0.9.4
PreReq:         pwdutils
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  popt-devel
BuildRequires:  binutils-devel
BuildRequires:  libelf-devel
BuildRequires:  qt3-devel >= 3.3
BuildRequires:  qt3-designer >= 3.3
BuildRequires:  oprofile >= 0.9.4
BuildRequires:  libdwarf-devel
BuildRequires:  update-desktop-files
BuildRequires:  unzip
BuildRequires:  pwdutils
BuildRequires:  fdupes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# Unsupported architecture list due to non-AMD based system.
ExcludeArch:    ppc ppc64 s390 s390x alpha alphaev6 sparcv9 sparc64

%description
CodeAnalyst is a performance analysis suite. It provids graphical
utilitys for running Oprofile, and analyzing result on AMD-based systems.
CodeAnalyst includes several features to aid profile analysis such as
inline-function analysis, code-block analysis, and a utility for
profile comparison, DiffAnalayst.


%prep
%setup -q -n %{name}-gui-%{version}
%patch0 -p1 -b .ca-use-oprofile-default-buffersize
%patch1 -p1 -b .ca-da-online-help
%patch2 -p1 -b .ca-fix-basename
%patch3 -p0 -b .ca-fix-oprofile-ibs-check
%patch4 -p1 -b .ca-use-dynamic-feature-check
%patch5 -p1 -b .ca-fix-su
%patch6 -p1 -b .ca-enable-oprofile-0.9.6

%build
./autogen.sh
%configure \
  --with-oprofile=%{_prefix} \
  --disable-oprofile-lib \
  --disable-static \
  --with-libdwarf-includes=%{_includedir}/libdwarf \
  --with-libdwarf-libraries=%{_libdir}
make %{?jobs:-j%jobs}

%install
make -C src/ca/libs    install DESTDIR=${RPM_BUILD_ROOT}
make -C src/ca/gui     install DESTDIR=${RPM_BUILD_ROOT}
make -C src/ca/diffgui install DESTDIR=${RPM_BUILD_ROOT}
make -C src/ca/utils   install DESTDIR=${RPM_BUILD_ROOT}
make -C src/ca/scripts install DESTDIR=${RPM_BUILD_ROOT}
# These are help documents and images which
# the GUIs is using for the "Help" on toolbar.
# GUI will not run correctly if these are not available
# make -C doc install DESTDIR=${RPM_BUILD_ROOT}
install -D -m 755 careport.sh ${RPM_BUILD_ROOT}%{_bindir}
# Remove these unnecessary files from the installation
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/lib*.{la,so}
# install icons
install -D -m 644 src/ca/gui/CodeAnalyst-gui.xpm ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/CodeAnalyst.xpm
install -D -m 644 src/ca/diffgui/DiffAnalyst-gui.xpm ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/DiffAnalyst.xpm
# create hardlinks for duplicate files
%fdupes ${RPM_BUILD_ROOT}%{_datadir}/
# Install CodeAnalyst.desktop file
%suse_update_desktop_file -i CodeAnalyst -u
# Install DiffAnalyst.desktop file
%suse_update_desktop_file -i DiffAnalyst -u

%clean
rm -rf ${RPM_BUILD_ROOT}

%pre
# Adding "amdca" user group
getent group amdca >/dev/null || /usr/sbin/groupadd -r amdca
exit 0

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README COPYING INSTALLATION
%{_bindir}/CodeAnalyst
%{_bindir}/DiffAnalyst
%{_bindir}/careport.sh
%{_bindir}/capackage.sh
%{_sbindir}/ca_user_manager
%{_sbindir}/ca_oprofile_controller
%{_libdir}/lib*.so.*
%dir %{_datadir}/codeanalyst
%{_datadir}/codeanalyst/*
%{_datadir}/applications/CodeAnalyst.desktop
%{_datadir}/applications/DiffAnalyst.desktop
%{_datadir}/pixmaps/*

%changelog
openSUSE Build Service is sponsored by