File qupzilla.spec of Package qupzilla

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

# define distro specfic items
%if 0%{?suse_version} ||  0%{?mdkversion}
%define qmake qmake
%if 0%{?fedora}
%define qmake qmake-qt4

Name:           qupzilla
Version:        1.2.0
Release:        0
License:        GPL-3.0+
Summary:        A very fast open source browser based on WebKit core
Group:          Productivity/Networking/Web/Browsers
# Sources are available on github
# git clone qupzilla && cd qupzilla
# git archive v1.2.0 --prefix=qupzilla-1.2.0/ | bzip2 > ../qupzilla-1.2.0.tar.bz2
Source:         %{name}-%{version}.tar.bz2
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRequires:  fdupes
%if 0%{?fedora}
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(QtCore) >= 4.7
BuildRequires:  pkgconfig(QtGui) >= 4.7
BuildRequires:  pkgconfig(QtNetwork) >= 4.7
BuildRequires:  pkgconfig(QtWebKit)
BuildRequires:  dos2unix
# FIXME: those 32bit pacakges are required in 64bit build
#%if 0%{?mdkversion}
#BuildRequires:	libpulseaudio0
#BuildRequires:	libalsa-plugins-pulseaudio
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

QupZilla is a new and very fast World Wide Web Browser
which uses Qt Framework and its QtWebKit rendering core.
It is a lightweight browser with some advanced functions
like integrated AdBlock, Search Engines Manager, Theming
support, Speed Dial and SSL Certificate manager.

%setup -q
# 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/qupzillaschemehandler.cpp

%if 0%{?suse_version} >= 1210
  export USE_WEBGL="true"
# It enables better oxygen icons in Preferences.
  export KDE="true"
# It sets proper LIBPATH.
  export USE_LIBPATH="%{_libdir}"
# Debug config is needed for -debuginfo and -debugsource packages.
%{qmake} CONFIG+=debug
make %{?_smp_mflags}

make INSTALL_ROOT=%{buildroot} install
%if 0%{?suse_version}
# openSUSE
%suse_update_desktop_file %{name}
%fdupes %{buildroot}%{_datadir}
# FIXME: split library into separate package and build also -devel with ???
rm -vf %{buildroot}%{_libdir}/
# We don't need a test plugin which does nothin.
rm -vf %{buildroot}%{_libdir}/qupzilla/
# End
dos2unix COPYRIGHT

%{?buildroot:rm -rf "%{buildroot}"}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%dir %{_libdir}/qupzilla
%dir %{_datadir}/%{name}