File qt-creator.spec of Package qt-creator

#
# spec file for package qt-creator
#
# Copyright (c) 2013 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:           qt-creator
Version:        2.8.1
Release:        0
Summary:        Lightweight IDE
License:        SUSE-LGPL-2.1-with-digia-exception-1.1
Group:          Development/Tools/IDE
Url:            http://www.qtsoftware.com/developer/qt-creator/
%define rversion 2.8.1
Source:         http://download.qt-project.org/official_releases/qtcreator/2.8/%{rversion}/%{name}-%{rversion}-src.tar.gz
Source1:        qtcreator.desktop
Patch1:         system-botan-lib.diff
Patch2:         hardcoded-runpath.diff
Patch3:         qbs-path.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

#########################################################################################
# SuSE, openSUSE
#########################################################################################
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  libQtWebKit-devel
BuildRequires:  libbotan-devel >= 1.10.2
BuildRequires:  libqt4-devel >= 4.8
BuildRequires:  libqt4-private-headers-devel
BuildRequires:  update-desktop-files
Recommends:     libQtWebKit-devel
Recommends:     libqt4-debuginfo
Recommends:     libqt4-devel-doc
%endif

#########################################################################################
# Fedora, RHEL or CentOS
#########################################################################################
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  desktop-file-utils
BuildRequires:  qt4-devel >= 4.8
%endif
Provides:       %{name}-devel = %{version}

%description
Qt Creator is a new, lightweight, cross-platform integrated development
environment (IDE) designed to make development with the Qt application
framework even faster and easier.

%prep
%setup -q -n %{name}-%rversion-src
%if 0%{?suse_version}
%patch1 -p1
%endif
%patch2
%patch3 -p1

%build
%if "%{_lib}"=="lib64"
qmake IDE_LIBRARY_BASENAME=lib64
%else
qmake IDE_LIBRARY_BASENAME=lib
%endif
make %{?_smp_mflags}
make %{?_smp_mflags} docs
%if 0
cd share/qtcreator/gdbmacros
qmake
make
%endif

%install
export QTDIR=/usr/share/qt4
# its qmake. of course it is broken
make INSTALL_ROOT=%{buildroot}/%{_prefix} install
install -m 755 bin/qtcreator %{buildroot}%{_bindir}
install -m 755 bin/qmlpuppet %{buildroot}%{_bindir}
# copy doc to its (correct) destination:
install -d -m 755 %{buildroot}%{_docdir}/libqt4/qch/
cp share/doc/qtcreator/qtcreator.qch %{buildroot}%{_docdir}/libqt4/qch/
rm -rfv %{buildroot}%{_datadir}/doc/qtcreator
%if 0%{?suse_version}
  %suse_update_desktop_file -i qtcreator Development Qt IDE
%else
%if 0%{?fedora_version}
  desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ --add-category Development --add-category Qt --add-category IDE qtcreator.desktop
%endif
%endif
%fdupes %{buildroot}
%if 0
cd share/qtcreator/gdbmacros
make INSTALL_ROOT=%{buildroot}/%{_prefix} install
%endif

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc LICENSE.LGPL LGPL_EXCEPTION.TXT README
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%dir %{_docdir}/libqt4/qch
%doc %{_docdir}/libqt4/qch/qtcreator.qch
%{_bindir}/qmlpuppet
%{_bindir}/qtcreator
%{_bindir}/qtcreator_process_stub
%{_bindir}/qtpromaker
%{_bindir}/sdktool
%{_datadir}/applications/qtcreator.desktop
%{_datadir}/icons/hicolor/*/apps/QtProject-qtcreator.png
%{_datadir}/qtcreator/
%{_libdir}/qtcreator/

%changelog
openSUSE Build Service is sponsored by