File qupzilla-qt5.spec of Package qupzilla

#
# spec file for package qupzilla
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012-2014 Mariusz Fik <fisiu@opensuse.org>
#
# 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/
#


%define qt5_build 1

%if !0%{?qt5_build}
Name:           qupzilla
%else
Name:           qupzilla-qt5
%endif
Version:        1.6.6
Release:        0
Summary:        A very fast open source browser based on WebKit core
License:        GPL-3.0+
Group:          Productivity/Networking/Web/Browsers
Url:            http://qupzilla.com/
Source:         https://github.com/QupZilla/qupzilla/releases/download/v%{version}/QupZilla-%{version}.tar.xz
# WORKAROUND FOR QTBUG-34950
Patch0:         qupzilla-gdb-workaround.patch
BuildRequires:  fdupes
%if !0%{?qt5_build}
BuildRequires:  libkde4-devel
BuildRequires:  pkgconfig(gnome-keyring-1)
%endif
BuildRequires:  pkgconfig(hunspell)
%if 0%{?qt5_build}
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Script)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Widgets)
%if 0%{?suse_version} > 1310
BuildRequires:  libQt5Gui-private-headers-devel
%else
BuildRequires:  libqt5-qtbase-private-headers-devel
%endif
BuildRequires:  libqt5-qttools-devel
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5WebKitWidgets)
%else
BuildRequires:  pkgconfig(QtCore) >= 4.7
BuildRequires:  pkgconfig(QtGui) >= 4.7
BuildRequires:  pkgconfig(QtNetwork) >= 4.7
BuildRequires:  pkgconfig(QtWebKit)
%endif
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(openssl)
%if 0%{?qt5_build}
Conflicts:      qupzilla
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
QupZilla is modern web browser based on WebKit core and Qt Framework.
WebKit guarante fast browsing and Qt availability on all major platforms.

%if !0%{?qt5_build}
%package kwallet
Summary:        Kwallet plugin for qupzilla
Group:          Productivity/Networking/Web/Browsers
Requires:       %{name} = %{version}

%description kwallet
Kwallet plugin for QupZilla browser which allows to store passwords in kwallet.

%package gnome-keyring
Summary:        Gnome keyring plugin for qupzilla
Group:          Productivity/Networking/Web/Browsers
Requires:       %{name} = %{version}

%description gnome-keyring
Gnome keyring plugin for QupZilla browser which allows to store passwords in 
gnome keyring.
%endif

%prep
%setup -q -n QupZilla-%{version}
# WORKAROUND for QTBUG-34950.
%patch0 -p1
# remove BUILDTIME usage from build
sed '/static const QString BUILDTIME/d' -i src/lib/app/qupzilla.h
sed '/QupZilla::BUILDTIME/d' -i src/lib/other/aboutdialog.cpp
sed '/QupZilla::BUILDTIME/d' -i src/lib/app/commandlineoptions.cpp
sed '/QupZilla::BUILDTIME/d' -i src/lib/app/qupzilla.cpp
sed '/QupZilla::BUILDTIME/d' -i src/lib/network/schemehandlers/qupzillaschemehandler.cpp

%build
export USE_WEBGL=true
%if !0%{?qt5_build}
# It enables better kde integration, it's also needed for kwallet plugin.
export KDE_INTEGRATION=true
# It enables gnome keyring support
export GNOME_INTEGRATION=true
%endif
# It sets proper LIBPATH.
export USE_LIBPATH=%{_libdir}
%if !0%{?qt5_build}
# Debug config is needed for -debuginfo and -debugsource packages.
qmake CONFIG+=debug
%else
%qmake5
%endif
make %{?_smp_mflags}

%install
make INSTALL_ROOT=%{buildroot} install
# FIXME: split library into separate package and build also -devel with libqupzilla.so ???
rm -vf %{buildroot}%{_libdir}/libQupZilla.so
# We don't need a test plugin which does nothing.
rm -vf %{buildroot}%{_libdir}/qupzilla/libTestPlugin.so
# End
%suse_update_desktop_file qupzilla
%fdupes -s %{buildroot}%{_datadir}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS COPYRIGHT FAQ GPLv3
%{_bindir}/qupzilla
%{_libdir}/libQupZilla.so.*
%dir %{_libdir}/qupzilla
%{_libdir}/qupzilla/libAccessKeysNavigation.so
%{_libdir}/qupzilla/libAutoScroll.so
%{_libdir}/qupzilla/libMouseGestures.so
%{_libdir}/qupzilla/libGreaseMonkey.so
%{_libdir}/qupzilla/libPIM.so
%{_libdir}/qupzilla/libStatusBarIcons.so
%{_datadir}/applications/qupzilla.desktop
%{_datadir}/pixmaps/qupzilla.png
%{_datadir}/icons/hicolor
%dir %{_datadir}/qupzilla
%{_datadir}/qupzilla/locale
%{_datadir}/qupzilla/themes
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/qupzilla

%if !0%{?qt5_build}
%files kwallet
%defattr(-,root,root)
%{_libdir}/qupzilla/libKWalletPasswords.so

%files gnome-keyring
%defattr(-,root,root)
%{_libdir}/qupzilla/libGnomeKeyringPasswords.so
%endif

%changelog
openSUSE Build Service is sponsored by