File libqt5-creator.spec of Package libqt5-creator

# spec file for package libqt5-creator
# 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

Name:           libqt5-creator
Version:        3.0.81~git
Release:        0
Summary:        Lightweight IDE
License:        SUSE-LGPL-2.1-with-digia-exception-1.1
Group:          Development/Tools/IDE
%define rversion %{version}
%define rname qt-creator
%define qt5_version 5.4.0
Source1:        %{name}-rpmlintrc
Source2:        qtcreator.desktop
BuildRequires:  fdupes
BuildRequires:  gdb
BuildRequires:  libQt5Sql5-sqlite >= %{qt5_version}
BuildRequires:  libbotan-devel
BuildRequires:  libqt5-qtbase-devel >= %{qt5_version}
BuildRequires:  libqt5-qtdeclarative-private-headers-devel >= %{qt5_version}
BuildRequires:  libqt5-qtquick1-private-headers-devel >= %{qt5_version}
BuildRequires:  libqt5-qtscript-devel >= %{qt5_version}
BuildRequires:  libqt5-qttools-private-headers-devel >= %{qt5_version}
BuildRequires:  libqt5-qtx11extras-devel >= %{qt5_version}
BuildRequires:  llvm-clang-devel
BuildRequires:  update-desktop-files
BuildRequires:  xz
Conflicts:      qt-creator
Recommends:     libqt5-debuginfo
Recommends:     libqt5-qtdoc
# Make sure to rebuild against latest Qt5 (using the last package in chain - libQt5Designer5)
%requires_ge    libQt5Designer5
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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.

%setup -q -n %{rname}-%{rversion}

# Remove build time references so build-compare can do its work. Not yet activated - breaks build
#modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
#DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
#TIME="\"$(date -d "${modified}" "+%%R")\""
#find . -name '*.cpp' -print0 |\
#xargs -0 sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g"

export PATH=%_libqt5_bindir:$PATH
%if "%{_lib}"=="lib64"
%{_libqt5_bindir}/qmake LLVM_INSTALL_DIR=%{_prefix} IDE_LIBRARY_BASENAME=lib64 USE_SYSTEM_BOTAN=1
%{_libqt5_bindir}/qmake LLVM_INSTALL_DIR=%{_prefix} USE_SYSTEM_BOTAN=1
#rm src/shared/qbs/
make %{?_smp_mflags}
make qch_docs
make html_docs_online

# its qmake. of course it is broken
make INSTALL_ROOT=%{buildroot}/%{_prefix} install

mkdir -p %{buildroot}%{_datadir}/doc/packages/libqt5
cp share/doc/qtcreator/qtcreator.qch %{buildroot}%{_datadir}/doc/packages/libqt5/

mkdir -p %{buildroot}%{_datadir}/doc/packages/libqt5/qtcreator
cp -a doc/html/* %{buildroot}%{_datadir}/doc/packages/libqt5/qtcreator/

%suse_update_desktop_file -i qtcreator Development Qt IDE

%fdupes -s %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc *GPL*
%dir %{_datadir}/doc/packages/libqt5