File qdevelop.spec of Package qdevelop

#
# spec file for package qdevelop
#
# Copyright (c) 2017 SUSE LINUX 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:           qdevelop
Version:        0.29
Release:        0
Summary:        A Development Environment for Qt4
License:        GPL-2.0+
Group:          Development/Tools/IDE
Url:            https://code.google.com/archive/p/qdevelop/
Source:         %{name}-%{version}.tar.xz
Patch0:         invalid-ptr-misleading-indentation.patch
Patch1:         use-cflags-and-cxxflags.patch
Patch2:         fix-with-qt-4.7.0.patch
Patch3:         variable-directories.patch
Patch4:         fix-desktop-file.patch
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  libqt4-devel
Recommends:     ctags
Recommends:     gdb
Recommends:     libqt4-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
QDevelop is a development environment entirely dedicated to Qt4.
QDevelop is available in English, French, German, Dutch, Polish,
Spanish, Chinese, Russian, Italian, Ukrainian, Czech and Portuguese.

QDevelop is not a Kdevelop like or reduced.
It's an independent IDE dedicated to Qt and is totally independent of KDevelop.
Less complete, but faster, light and especially multi-platforms. QDevelop and KDevelop have different code sources.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="$CFLAGS"
# build now
lrelease QDevelop.pro
qmake PLUGIN_DIR="%{_libdir}/%{name}/plugins/" TRANSLATIONS_DIR="%{_libdir}/%{name}/translations/"
make %{?_smp_mflags}
# build plugins
cd plugins
for plugin in $(ls); do
   pushd "$plugin"
   qmake
   make %{?_smp_mflags}
   popd
done

%install
make INSTALL_ROOT=%{buildroot} install
# install plugins
mkdir -p %{buildroot}%{_libdir}/%{name}/plugins/
install -m 644 bin/plugins/*.so %{buildroot}%{_libdir}/%{name}/plugins/
# install translations
mkdir -p %{buildroot}%{_datadir}/%{name}/translations/
install -m 644 resources/translations/*.qm %{buildroot}%{_datadir}/%{name}/translations/
# install icon
mkdir -p %{buildroot}%{_datadir}/pixmaps/
install -m 644 resources/images/logo.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
# install desktop file
install -Dm644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop

%post
%desktop_database_post

%postun
%desktop_database_postun

%files
%defattr(-,root,root)
%doc ChangeLog.txt copying
%{_bindir}/%{name}
%{_libdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by