Blob Blame History Raw
%ifarch %{ix86}
    %global arch i686
%else
    %global arch %{_arch}
%endif

%global qt4_epoch 1
%global qt4_ver 4.8
%if %{?fedora:0} >= 23
%global qt4_ver_minor 7
%global qt4_beta rc2
%else
%global qt4_ver_minor 6
%endif
%global qt4_version %{qt4_ver}.%{qt4_ver_minor}
%global qt4_target qt%{qt4_ver}-%{arch}

%global qt5_ver 5.4
%global qt5_ver_minor 0
%global qt5_version %{qt5_ver}.%{qt5_ver_minor}
%global qt5_target qt%{qt5_ver}-%{arch}

%global gammaray_ver 2.2
%global gammaray_ver_minor 1
%global gammaray_version %{gammaray_ver}.%{gammaray_ver_minor}

Name:           gammaray
Version:        %{gammaray_version}
Release:        8%{?dist}
Summary:        A tool for examining internals of Qt applications
License:        GPLv2+
URL:            http://www.kdab.com/kdab-products/gammaray/
Source0:        https://github.com/KDAB/GammaRay/releases/download/v%{version}/%{name}-%{version}.tar.gz

# We need Qt 4 sources in order to get access to some
# uninstalled private headers for deep painter introspection
%if 0%{?qt4_beta:1}
Source1:        http://download.qt.io/development_releases/qt/%{qt4_ver}/%{qt4_version}-%{qt4_beta}/qt-everywhere-opensource-src-%{qt4_version}-%{qt4_beta}.tar.gz
%else
Source1:        http://download.qt.io/official_releases/qt/%{qt4_ver}/%{qt4_version}/qt-everywhere-opensource-src-%{qt4_version}.tar.gz
%endif

# Qt 5 (GUI, probe)
BuildRequires:  qt5-qtbase-devel >= %{qt5_ver}.0 qt5-qtbase-devel <= %{qt5_ver}.100
BuildRequires:  qt5-qtdeclarative-devel
BuildRequires:  qt5-qtsvg-devel
BuildRequires:  qt5-qtscript-devel
BuildRequires:  qt5-qtwebkit-devel
BuildRequires:  qt5-qttools-devel
BuildRequires:  kf5-kcoreaddons-devel


# Qt4/KDE 4 support (only for Qt 4 probe)
BuildRequires:  qt-devel = %{?qt4_epoch:%{qt4_epoch}:}%qt4_version
BuildRequires:  qt-devel-private = %{?qt4_epoch:%{qt4_epoch}:}%qt4_version
BuildRequires:  qtwebkit-devel
BuildRequires:  kdelibs4-devel
BuildRequires:  phonon-devel


# General deps
BuildRequires:  graphviz-devel
BuildRequires:  vtk-devel
BuildRequires:  glibc-devel

# Documentation
BuildRequires:  docbook-dtds
BuildRequires:  doxygen
BuildRequires:  graphviz
BuildRequires:  perl-podlators

# Post-install
BuildRequires:  desktop-file-utils

BuildRequires:  python-devel
BuildRequires:  hdf5-devel
BuildRequires:  libxml2-devel
BuildRequires:  blas-devel
BuildRequires:  lapack-devel
BuildRequires:  netcdf-devel
BuildRequires:  jsoncpp-devel
BuildRequires:  netcdf-cxx-devel


Requires:       %{name}-qt5 = %{version}-%{release}

# When -doc subpkg was removed
Obsoletes:      %{name}-doc <= 2.2.1


%description
A tool to poke around in a Qt-application and also to manipulate
the application to some extent. It uses various DLL injection
techniques to hook into an application at run-time and provide
access to a lot of interesting information.

By default GammaRay can only introspect Qt 5 applications. To
introspect Qt 4 applications, install %{name}-qt4.

%package        qt5
Summary:        Qt 5 probe for GammaRay
Requires:       qt5-qtbase%{?_isa} = %{_qt5_version}
Requires:       %{name} = %{version}-%{release}

%description    qt5
Provides a Qt 5 probe for GammaRay that allows introspecting Qt 5
applications. This probe is installed by default. It is possible
to install probes for different architectures as well, GammaRay
will then be able to inspect those applications too.


%package        qt4
Summary:        Qt 4 probe for GammaRay
Requires:       qt%{?_isa} = %{qt4_epoch}:%qt4_version
Requires:       %{name} = %{version}-%{release}
%description    qt4
Provides a Qt 4 probe for GammaRay that allows introspecting Qt 4
applications. By default GammaRay only provides Qt 5 probe.


%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       %{name}-qt4%{?_isa} = %{version}-%{release}
%description    devel
The %{name}-devel package contains libraries and header files for
developing plugins for %{name}.

%package        doc
Summary:        Developer documentation for %{name}
BuildArch:      noarch
%description    doc
This package includes developer documentation in HTML format.

%prep
%setup -q -b 1 -n %{name}-%{version}

%build
%define _target_platform_qt5 %{_target_platform}_qt5
%define _target_platform_qt4 %{_target_platform}_qt4


mkdir -p %{_target_platform_qt5}
pushd %{_target_platform_qt5}
%cmake .. \
        -DLIBEXEC_INSTALL_DIR=libexec \
        -DVTK_DIR=%{_libdir}/cmake/vtk
popd
make %{?_smp_mflags} -C %{_target_platform_qt5}
make docs -C %{_target_platform_qt5}


mkdir -p %{_target_platform_qt4}
pushd %{_target_platform_qt4}
%cmake .. \
        -DGAMMARAY_BUILD_UI=FALSE \
        -DGAMMARAY_PROBE_ONLY_BUILD=TRUE \
        -DGAMMARAY_ENFORCE_QT4_BUILD:BOOL=ON \
        -DQT_PRIVATE_INCLUDE_DIR=%{_builddir}/qt-everywhere-opensource-src-%{qt_version}/include/QtCore \
        -DVTK_DIR=%{_libdir}/cmake/vtk \
        -DLIBEXEC_INSTALL_DIR=libexec
popd
make %{?_smp_mflags} -C %{_target_platform_qt4}


%install
make install/fast DESTDIR=%{buildroot} -C %{_target_platform_qt5}
make install/fast DESTDIR=%{buildroot} -C %{_target_platform_qt4}

%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/GammaRay.desktop

%post -p /sbin/ldconfig
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun -p /sbin/ldconfig
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files
%doc License.txt ReadMe.txt
%{_bindir}/gammaray
%{_qt5_libdir}/gammaray/libexec/gammaray-launcher
%{_qt5_libdir}/gammaray/libexec/gammaray-client
%{_datadir}/appdata/GammaRay.appdata.xml
%{_datadir}/applications/GammaRay.desktop
%{_datadir}/icons/hicolor/*/apps/GammaRay.png
%{_mandir}/man1/gammaray.1.gz

%files qt5
%{_qt5_libdir}/libgammaray_ui-%{qt5_target}.so.*
%{_qt5_libdir}/libgammaray_common-%{qt5_target}.so.*
%{_qt5_libdir}/libgammaray_core-%{qt5_target}.so.*
%{_qt5_libdir}/gammaray/%{gammaray_ver}/%{qt5_target}/

%files qt4
%{_qt4_libdir}/libgammaray_ui-%{qt4_target}.so.*
%{_qt4_libdir}/libgammaray_common-%{qt4_target}.so.*
%{_qt4_libdir}/libgammaray_core-%{qt4_target}.so.*
%{_qt4_libdir}/gammaray/%{gammaray_ver}/%{qt4_target}/

%files devel
%{_includedir}/gammaray
%{_qt5_libdir}/libgammaray_ui-%{qt5_target}.so
%{_qt5_libdir}/libgammaray_common-%{qt5_target}.so
%{_qt5_libdir}/libgammaray_core-%{qt5_target}.so
%{_qt4_libdir}/libgammaray_ui-%{qt4_target}.so
%{_qt4_libdir}/libgammaray_common-%{qt4_target}.so
%{_qt4_libdir}/libgammaray_core-%{qt4_target}.so
%{_libdir}/cmake/GammaRay/


%changelog
* Mon May 18 2015 Daniel Vrátil <dvratil@redhat.com> - 2.2.1-8
- probes require the main UI (otherwise they are not very useful)
- update to Qt 4.8.7 in rawhide

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 2.2.1-7
- Rebuilt for GCC 5 C++11 ABI change

* Fri Mar 27 2015 Daniel Vrátil <dvratil@redhat.com> - 2.2.1-6
- rebuild (qt-5.4.1)

* Sun Mar 01 2015 Rex Dieter <rdieter@fedoraproject.org> - 2.2.1-5
- use %%_qt5_version macro instead for runtime deps, ie depend on the
  version of qt5 used during the build, not some hard-coded value.

* Thu Feb 26 2015 Rex Dieter <rdieter@fedoraproject.org> 2.2.1-4
- rebuild (qt-5.4.1)

* Tue Feb 03 2015 Daniel Vrátil <dvratil@redhat.com> - 2.2.1-3
- fix typo

* Tue Feb 03 2015 Daniel Vrátil <dvratil@redhat.com> - 2.2.1-2
- drop ambiguous BuildArch

* Tue Feb 03 2015 Daniel Vrátil <dvratil@redhat.com> - 2.2.1-1
- Update to 2.2.1
- Default to Qt 5 build now
- Provide probes for Qt 5 and Qt 4 in -qt5 and -qt4 subpackages

* Wed Jan 07 2015 Orion Poplawski <orion@cora.nwra.com> - 2.1.1-2
- Rebuild for hdf5 1.8.4

* Tue Sep 23 2014 Richard Hughes <richard@hughsie.com> - 2.1.1-1
- Update to new upstream release.

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu May  8 2014 Tom Callaway <spot@fedoraproject.org> - 2.0.2-1
- update to 2.0.2

* Mon Jan 27 2014 Daniel Vrátil <dvratil@redhat.com> - 2.0.0-2
- rebuilt against VTK

* Thu Jan 23 2014 Daniel Vrátil <dvratil@redhat.com> - 2.0.0-1
- GammaRay 2.0.0
- require specific version of Qt
- point CMake to VTK dir
- enforce Qt 4 build (GammaRay automatically switches to Qt 5 build when it finds it installed)
- remove rpath workaround
- fix installation destination of libexec binaries

* Thu Jan 02 2014 Daniel Vrátil <dvratil@redhat.com> - 1.3.2-2
- Rebuilt against new VTK
- BR blas-devel
- BR lapack-devel
- BR netcdf-devel

* Thu Dec 05 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.2-1
- GammaRay 1.3.2

* Tue Aug 27 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.1-3
- fix duplicate documentation files (#1001275)

* Tue Aug 27 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.1-2
- update Qt sources
- fix build against VTK 6.0

* Mon Aug 05 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.1-1
- GammaRay 1.3.1

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Feb 15 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.0-4
- add perl-podlators to BR as they've been split from perl pkg in rawhide

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Feb 05 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.0-2
- rename docs subpackage to doc
- use %%global instead of %%define

* Tue Jan 29 2013 Daniel Vrátil <dvratil@redhat.com> - 1.3.0-1
- first attempt