File libqt5-qtbase.spec of Package libqt5-qtbase
#
# spec file for package libqt5
#
# 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/
#
%define _prefix /opt/qt-5.0
%define packageprefix opt-
Name: %{packageprefix}libqt5-qtbase
BuildRequires: Mesa-devel
BuildRequires: alsa-devel
BuildRequires: cups-devel
BuildRequires: dbus-1-devel
BuildRequires: fdupes
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: glib2-devel
BuildRequires: gtk2-devel
BuildRequires: libjpeg-devel
BuildRequires: libmng-devel
BuildRequires: libmysqlclient-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: openssl-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: postgresql-devel
BuildRequires: sqlite3-devel
BuildRequires: unixODBC-devel
BuildRequires: update-desktop-files
%if %suse_version > 1140
BuildRequires: at-spi2-core-devel
%endif
%if %suse_version > 1210
BuildRequires: xcb-util-image-devel
BuildRequires: xcb-util-keysyms-devel
BuildRequires: xcb-util-renderutil-devel
BuildRequires: xcb-util-wm-devel
%endif
BuildRequires: clucene-core-devel
BuildRequires: gstreamer-0_10-plugins-base-devel
BuildRequires: libev-devel
BuildRequires: libicu-devel
BuildRequires: libpulse-devel
BuildRequires: libudev-devel
BuildRequires: xorg-x11-devel
BuildRequires: xz
Url: http://qt.digia.com
Summary: C++ Program Library, Core Components
License: GPL-3.0 or SUSE-LGPL-2.1-with-nokia-exception-1.1
Group: System/Libraries
# COMMON-VERSION-BEGIN
Version: 5.0.2
Release: 0
%define base_name %{packageprefix}libqt5
%define real_version 5.0.2
%define tar_version everywhere-opensource-src-%{real_version}
# COMMON-VERSION-END
# COMMON-BEGIN
Source: qt-%{tar_version}.tar.xz
# to get mtime of file:
Source1: libqt5-qtbase.changes
Source10: %{packageprefix}qt5config.desktop
Source11: %{packageprefix}designer5.desktop
Source12: %{packageprefix}linguist5.desktop
Source13: %{packageprefix}assistant5.desktop
Source14: %{packageprefix}assistant.png
Source15: %{packageprefix}designer.png
Source16: %{packageprefix}linguist.png
Source17: qt-5.0-env.sh
Patch2: qt-never-strip.diff
Patch3: plastik-default.diff
Patch6: use-freetype-default.diff
Patch1006: use-freetype-default-legacy.diff
Patch8: link-tools-shared.diff
Patch61: qt5-fake-bold.patch
Patch75: qt-debug-timer.diff
Patch87: qfatal-noreturn.diff
Patch109: libqt5-libtool-nodate.diff
Patch118: rcc-stable-dirlisting.diff
Patch123: use-cups-default-print-settings-bnc552218.diff
Patch128: build-qvfb-tool.diff
Patch129: system-pcre.diff
Patch130: no-Werror-rpath.diff
Patch131: qmake-add-usr-include.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %suse_version > 1140
%define common_options -accessibility --opensource -no-separate-debug-info -shared -xkb -xrender -xcursor -dbus-linked -xfixes -xrandr -xinerama -sm -no-rpath -system-libjpeg -openssl-linked -system-libpng -cups -nis -system-zlib -prefix %_prefix -L %_libdir -libdir %_libdir -docdir %_docdir/%{base_name} -examplesdir %_libdir/qt5/examples -plugindir %plugindir -translationdir %_datadir/qt5/translations -iconv -sysconfdir /etc/settings -datadir %_datadir/qt5/ -no-pch -reduce-relocations -glib -optimized-qmake -system-sqlite -no-sql-mysql -importdir %plugindir/imports -xsync -xinput -gtkstyle --no-largefile -javascript-jit -xcb -no-eglfs -opengl -hostdatadir %_libdir/qt5 -qmldir %_libdir/qt5/qml
%else
%define common_options --opensource -no-separate-debug-info -shared -xkb -xrender -xcursor -dbus-linked -xfixes -xrandr -xinerama -sm -no-rpath -system-libjpeg -openssl-linked -system-libpng -cups -nis -system-zlib -prefix %_prefix -L %_libdir -libdir %_libdir -docdir %_docdir/%{base_name} -examplesdir %_libdir/qt5/examples -plugindir %plugindir -translationdir %_datadir/qt5/translations -iconv -sysconfdir /etc/settings -datadir %_datadir/qt5/ -no-pch -reduce-relocations -glib -optimized-qmake -system-sqlite -no-sql-mysql -importdir %plugindir/imports -xsync -xinput -gtkstyle --no-largefile -javascript-jit -xcb -no-eglfs -opengl -hostdatadir %_libdir/qt5 -qmldir %_libdir/qt5/qml
%endif
# disabled -largefile
%define check_config \
grep '# define' src/corelib/global/qconfig.h | egrep -v 'QT_(ARCH|USE)'; \
if test -f %_libdir/qt5/mkspecs/qconfig.pri ; then \
diff -u %_libdir/qt5/mkspecs/qconfig.pri mkspecs/qconfig.pri || exit 1; \
fi \
%description
Qt is a set of libraries for developing applications.
This package contains base tools, like string, xml, and network
handling.
%prep
%define plugindir %_libdir/qt5/plugins
%setup -q -n qt-everywhere-opensource-src-%{real_version}
%patch2
### 50 rediff
#%patch3
%if %suse_version > 1010
### 50 rediff
#%patch6
%else
### 50 rediff
#%patch1006
%endif
#%patch129
%patch130
# needs rediffing
#%patch8
# bnc#374073 comment #8
# %patch61
### 50 rediff
#%patch75
### 50 rediff
#%patch87
# ### 48 rediff
# %patch107
%patch109
# ### 48 rediff
# %patch113
### 50 rediff
#%patch118 -p1
### 50 rediff
#%patch123
### 50 rediff
#%patch128
# ### 47 rediff
#%patch121 -p1
%patch131
# be sure not to use them
rm -r qtbase/src/3rdparty/{libjpeg,freetype,libpng,zlib}
#rm -r qtimageformats/src/3rdparty/{libtiff,libmng}
# COMMON-END
%package devel
Summary: Qt Development Kit
Group: Development/Libraries/X11
Requires: %name = %version
Requires: %{packageprefix}libQtGui5 = %version
Requires: %{packageprefix}libQtTest5 = %version
Requires: %{packageprefix}libQtWidgets5 = %version
Requires: %{packageprefix}libqt5-sql-sqlite >= %version
Requires: Mesa-devel
Requires: c++_compiler
Requires: dbus-1-devel
Requires: freetype2-devel
Requires: glib2-devel
Requires: libmng-devel
Requires: libpng-devel
Requires: libtiff-devel
Requires: make
Requires: openssl-devel
Requires: pkgconfig
Requires: sqlite3-devel
%if %suse_version > 1140
Requires: at-spi2-core-devel
%endif
%if %suse_version > 1210
Requires: xcb-util-image-devel
Requires: xcb-util-keysyms-devel
Requires: xcb-util-renderutil-devel
Requires: xcb-util-wm-devel
%endif
Requires: libicu-devel
Requires: libudev-devel
Requires: xorg-x11-devel
Requires: zlib-devel
%description devel
You need this package, if you want to compile programs with Qt. It
contains the "Qt Crossplatform Development Kit". It does contain
include files and development applications like GUI designers,
translator tools and code generators.
%package -n %{packageprefix}libQtTest5
Summary: Qt 5 Test Library
Group: Development/Libraries/X11
%description -n %{packageprefix}libQtTest5
Qt 5 library for testing.
%package -n %{packageprefix}libQtWidgets5
Summary: Qt 5 Test Library
Group: Development/Libraries/X11
%description -n %{packageprefix}libQtWidgets5
Qt 5 library to display widgets.
%package -n %{packageprefix}libqt5-sql-sqlite
Summary: Qt 5 sqlite plugin
Group: Development/Libraries/C and C++
Requires: %{packageprefix}libQtSql5 = %version
Provides: %{packageprefix}libqt5_sql_backend = %version
%description -n %{packageprefix}libqt5-sql-sqlite
Qt 5 sqlite plugin to be able to use database functionality with Qt
applications without the need to setup a SQL server.
%package -n %{packageprefix}libqt5-sql-unixODBC
Summary: Qt 5 unixODBC plugin
Group: Development/Libraries/C and C++
Requires: %{packageprefix}libQtSql5 = %version
Provides: %{packageprefix}libqt5_sql_backend = %version
%description -n %{packageprefix}libqt5-sql-unixODBC
Qt unixODBC plugin to support databases via unixODBC within Qt
applications.
%package -n %{packageprefix}libqt5-sql-postgresql
Summary: Qt 5 PostgreSQL plugin
Group: Development/Libraries/C and C++
Requires: %{packageprefix}libQtSql5 = %version
Provides: %{packageprefix}libqt5_sql_backend = %version
%description -n %{packageprefix}libqt5-sql-postgresql
Qt SQL plugin to support PostgreSQL servers in Qt applications.
%package -n %{packageprefix}libqt5-sql-mysql
Summary: Qt 5 MySQL support
Group: Development/Libraries/C and C++
Requires: %{packageprefix}libQtSql5 = %version
Provides: %{packageprefix}libqt5_sql_backend = %version
%description -n %{packageprefix}libqt5-sql-mysql
A plugin to support MySQL server in Qt applications.
%package -n %{packageprefix}libQtGui5
Summary: Qt 5 GUI related libraries
Group: Development/Libraries/C and C++
Recommends: %{packageprefix}libqt5-qtimageformats = %version
%description -n %{packageprefix}libQtGui5
Qt 5 libraries which are depending on X11.
%package -n %{packageprefix}libQtSql5
Summary: Qt 5 SQL related libraries
Group: Development/Libraries/C and C++
Recommends: %{packageprefix}libqt5_sql_backend = %version
Suggests: %{packageprefix}libqt5-sql-sqlite
%description -n %{packageprefix}libQtSql5
Qt 5 libraries which are used for connection with an SQL server. You
will need also a plugin package for a supported SQL server.
%package private-headers-devel
Summary: Non-ABI stable experimental API
Group: Development/Libraries/C and C++
Requires: %{packageprefix}libqt5-qtbase-devel = %version
%description private-headers-devel
This package provides private headers of libqt5-qtbase-devel that are normally
not used by application development and that do not have any ABI or
API guarantees. The packages that build against these have to require
the exact Qt version.
%build
cd qtbase
export QMAKESPEC=$PWD/mkspecs/linux-g++
%ifarch ppc64
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mminimal-toc"
%endif
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DOPENSSL_LOAD_CONF"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DOPENSSL_LOAD_CONF"
export MAKEFLAGS="%{?jobs:-j %jobs}"
%ifarch sparc64
platform="-platform linux-g++-64"
%else
platform=""
%endif
# Record mtime of changes file instead of build time
CHANGES=`stat --format="%y" %SOURCE1|cut --characters=1-10`
sed -i -e "s/qt_instdate=\$TODAY/qt_instdate=$CHANGES/" configure
echo yes | ./configure %common_options $platform \
%ifarch %arm
-no-neon \
%endif
-plugin-sql-sqlite -nomake examples -nomake demos -nomake qtlocation -nomake qtsvg \
-plugin-sql-psql -I/usr/include -I/usr/include/pgsql/ -I/usr/include/pgsql/server \
-plugin-sql-odbc \
-plugin-sql-mysql -I/usr/include/mysql/ -I/usr/include -v
make %{?jobs:-j %jobs}
%install
cd qtbase
make INSTALL_ROOT=$RPM_BUILD_ROOT install
# argggh, qmake is such a piece of <censored>
find $RPM_BUILD_ROOT/%_libdir -type f -name '*prl' -exec perl -pi -e "s, -L$RPM_BUILD_DIR/\S+,,g" {} \;
find $RPM_BUILD_ROOT/%_libdir -type f -name '*prl' -exec sed -i -e "/^QMAKE_PRL_BUILD_DIR/d" {} \;
find $RPM_BUILD_ROOT/%_libdir -type f -name '*la' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \;
# insanity ...
find $RPM_BUILD_ROOT/%_libdir -type f -name '*pc' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \; -exec sed -i -e "s,^moc_location=.*,moc_location=%_bindir/moc," -e "s,uic_location=.*,uic_location=%_bindir/uic," {} \;
find $RPM_BUILD_ROOT/%_libdir/ -name 'lib*.a' -exec chmod -x -- {} \;
mkdir -p $RPM_BUILD_ROOT/%plugindir/sqldrivers
install -m 755 %{SOURCE17} $RPM_BUILD_ROOT/%_bindir/
%ifarch x86_64
sed -i "s/lib/lib64/g" $RPM_BUILD_ROOT/%_bindir/qt-5.0-env.sh
%endif
%fdupes %{buildroot}/%_includedir
%fdupes %{buildroot}/%_libdir/qt5/mkspecs
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%post -n %{packageprefix}libQtGui5 -p /sbin/ldconfig
%post -n %{packageprefix}libQtSql5 -p /sbin/ldconfig
%post -n %{packageprefix}libQtTest5 -p /sbin/ldconfig
%post -n %{packageprefix}libQtWidgets5 -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%postun -n %{packageprefix}libQtGui5 -p /sbin/ldconfig
%postun -n %{packageprefix}libQtSql5 -p /sbin/ldconfig
%postun -n %{packageprefix}libQtTest5 -p /sbin/ldconfig
%postun -n %{packageprefix}libQtWidgets5 -p /sbin/ldconfig
%files
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%dir %_prefix
%dir %_libdir
%dir %_libdir/qt5
%dir %plugindir
%_bindir/qt-5.0-env.sh
%_libdir/libQt5Core.so.*
%_libdir/libQt5Concurrent.so.*
%_libdir/libQt5DBus.so.*
%_libdir/libQt5Network.so.*
%_libdir/libQt5Xml.so.*
%plugindir/bearer
%files -n %{packageprefix}libQtTest5
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%_libdir/libQt5Test.so.*
%files -n %{packageprefix}libQtWidgets5
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%_libdir/libQt5Widgets.so.*
%_libdir/libQt5PrintSupport.so.*
%_libdir/libQt5OpenGL.so.*
%plugindir/accessible
%plugindir/printsupport
%files -n %{packageprefix}libQtGui5
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%_libdir/libQt5Gui.so.*
%plugindir/generic
%plugindir/imageformats
%plugindir/platforminputcontexts
%plugindir/platforms
%files devel
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%dir %_bindir
%dir %_includedir
%dir %_libdir/pkgconfig
%_bindir/moc
%_bindir/qdoc
%_bindir/qmake
%_bindir/rcc
%_bindir/syncqt
%_bindir/uic
%_bindir/qdbuscpp2xml
%_bindir/qdbusxml2cpp
%exclude %_includedir/*/%{version}
%_includedir/QtConcurrent
%_includedir/QtCore
%_includedir/QtDBus
%_includedir/QtGui
%_includedir/QtNetwork
%_includedir/QtOpenGL
%_includedir/QtPlatformSupport
%_includedir/QtPrintSupport
%_includedir/QtSql
%_includedir/QtTest
%_includedir/QtWidgets
%_includedir/QtXml
%_libdir/cmake
%_libdir/libQt5Concurrent.la
%_libdir/libQt5Concurrent.prl
%_libdir/libQt5Concurrent.so
%_libdir/libQt5Core.la
%_libdir/libQt5Core.prl
%_libdir/libQt5Core.so
%_libdir/libQt5DBus.la
%_libdir/libQt5DBus.prl
%_libdir/libQt5DBus.so
%_libdir/libQt5Gui.la
%_libdir/libQt5Gui.prl
%_libdir/libQt5Gui.so
%_libdir/libQt5Network.la
%_libdir/libQt5Network.prl
%_libdir/libQt5Network.so
%_libdir/libQt5OpenGL.la
%_libdir/libQt5OpenGL.prl
%_libdir/libQt5OpenGL.so
%_libdir/libQt5PlatformSupport.a
%_libdir/libQt5PlatformSupport.la
%_libdir/libQt5PlatformSupport.prl
%_libdir/libQt5PrintSupport.la
%_libdir/libQt5PrintSupport.prl
%_libdir/libQt5PrintSupport.so
%_libdir/libQt5Sql.la
%_libdir/libQt5Sql.prl
%_libdir/libQt5Sql.so
%_libdir/libQt5Test.la
%_libdir/libQt5Test.prl
%_libdir/libQt5Test.so
%_libdir/libQt5Widgets.la
%_libdir/libQt5Widgets.prl
%_libdir/libQt5Widgets.so
%_libdir/libQt5Xml.la
%_libdir/libQt5Xml.prl
%_libdir/libQt5Xml.so
%_libdir/libQt5Bootstrap.a
%_libdir/libQt5Bootstrap.la
%_libdir/libQt5Bootstrap.prl
%_libdir/pkgconfig/Qt5Bootstrap.pc
%_libdir/pkgconfig/Qt5Concurrent.pc
%_libdir/pkgconfig/Qt5Core.pc
%_libdir/pkgconfig/Qt5DBus.pc
%_libdir/pkgconfig/Qt5Gui.pc
%_libdir/pkgconfig/Qt5Network.pc
%_libdir/pkgconfig/Qt5OpenGL.pc
%_libdir/pkgconfig/Qt5PlatformSupport.pc
%_libdir/pkgconfig/Qt5PrintSupport.pc
%_libdir/pkgconfig/Qt5Sql.pc
%_libdir/pkgconfig/Qt5Test.pc
%_libdir/pkgconfig/Qt5Widgets.pc
%_libdir/pkgconfig/Qt5Xml.pc
%_libdir/qt5/mkspecs
%_docdir/%{packageprefix}libqt5
%files private-headers-devel
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%_includedir/*/%{version}
%files -n %{packageprefix}libQtSql5
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%_libdir/libQt5Sql.so.*
%dir %plugindir/sqldrivers
%files -n %{packageprefix}libqt5-sql-sqlite
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%plugindir/sqldrivers/libqsqlite*.so
%files -n %{packageprefix}libqt5-sql-unixODBC
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%plugindir/sqldrivers/libqsqlodbc*.so
%files -n %{packageprefix}libqt5-sql-postgresql
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%plugindir/sqldrivers/libqsqlpsql*.so
%files -n %{packageprefix}libqt5-sql-mysql
%defattr(-,root,root,755)
%doc qtbase/*.txt qtbase/LICENSE.LGPL qtbase/LICENSE.FDL
%plugindir/sqldrivers/libqsqlmysql*.so
%changelog