##
## kde-qt.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2003 The OpenPKG Project
## Copyright (c) 2000-2003 Ralf S. Engelschall
## Copyright (c) 2000-2003 Cable & Wireless
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: kde-qt
Summary: K Desktop Environment (Qt Toolkit)
URL: http://www.kde.org/
Vendor: TrollTech AS
Packager: The OpenPKG Project
Distribution: OpenPKG [EVAL]
Group: KDE
License: GPL
Version: 3.1.2
Release: 20030818
# list of sources
Source0: ftp://ftp.trolltech.com/pub/qt/source/qt-x11-free-%{version}.tar.bz2
Source1: kde-qt.pc
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030103, X11, pkgconfig, gcc
PreReq: OpenPKG, openpkg >= 20030103, X11, pkgconfig
AutoReq: no
AutoReqProv: no
%description
KDE is a powerful Open Source graphical desktop environment for Unix
workstations. It combines ease of use, contemporary functionality,
and outstanding graphical design with the technological superiority
of the Unix operating system.
This part is the KDE underlying Qt Toolkit.
(The major differences between this package and the standard OpenPKG
Qt package are: shared library version only, threading enabled,
stripped down installation size, slightly older version to fullfill
exactly the requirements of KDE, no build options, etc. So, this
package just is for KDE internal use only.)
%prep
%setup -q -n qt-x11-free-%{version}
# just checking for the definition of POSIX feature test macros
# is a violation of the standard. The macros are allowed to
# have values -1, 0 and >0 and especially a defined value
# of -1 still means "feature not available". It case of
# _POSIX_THREAD_SAFE_FUNCTIONS, SUSv3 says in particular "if this
# symbol has a value other than -1 or 0, it shall have the value
# 200112L".
%{l_shtool} subst \
-e 's/\(defined(_POSIX_THREAD_SAFE_FUNCTIONS)\)/(\1 \&\& _POSIX_THREAD_SAFE_FUNCTIONS-0>0)/g' \
src/dialogs/qfiledialog.cpp src/kernel/qfont_x11.cpp \
src/tools/qdatetime.cpp src/tools/qdir_unix.cpp
%build
# set $HOME to a writable directory for qsettings
# and set QTDIR to just the source tree directory
export HOME=`pwd`
export QTDIR=`pwd`
# determine target platform for building
case "%{l_target}" in
*-freebsd* ) oscomp="freebsd-g++" ;;
*-linux* ) oscomp="linux-g++" ;;
*-solaris* ) oscomp="solaris-g++" ;;
* ) echo "platform %{l_target} not supported" 2>&1; exit 1 ;;
esac
# configure Qt for target platform
l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
echo "yes" | ./configure \
-platform $oscomp \
-prefix %{l_prefix} \
-bindir %{l_prefix}/libexec/kde \
-libdir %{l_prefix}/lib/kde \
-headerdir %{l_prefix}/include/kde \
-docdir %{l_prefix}/share/kde/qt/doc \
-datadir %{l_prefix}/share/kde/qt/data \
-release -shared -stl -sm \
-qt-zlib -qt-libpng -qt-libjpeg -qt-libmng -qt-gif \
-no-nis -no-cups -no-nas-sound -no-xinerama \
-xrender -no-xft -no-tablet -no-xkb \
-disable-opengl -disable-sql \
-no-exceptions -thread \
-I$QTDIR/include \
%{l_cppflags} %{l_ldflags} \
-I${l_x11_incdir} -L${l_x11_incdir} \
-R%{l_prefix}/lib/kde
# build Qt (but without additional tools, the tutorial and the examples)
%{l_make} %{l_mflags -O} \
MAKE="%{l_make} %{l_mflags -O}" \
symlinks src-qmake src-moc sub-src
( cd tools/designer
%{l_make} %{l_mflags -O} \
MAKE="%{l_make} %{l_mflags -O}" \
sub-uic
) || exit $?
%install
rm -rf $RPM_BUILD_ROOT
# create directory structure
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/libexec/kde \
$RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde \
$RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
# install tools
%{l_shtool} install -c -s -m 755 \
bin/moc bin/uic \
$RPM_BUILD_ROOT%{l_prefix}/libexec/kde/
# install library
%{l_shtool} install -c -m 755 \
lib/libqt-mt.so.%{version} \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/
%{l_shtool} mkln -s \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]$;;'`
%{l_shtool} mkln -s \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]\.[0-9]$;;'`
%{l_shtool} mkln -s \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
$RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so
# install headers
( cd include
# (do not pick up symlinks to non-existing files)
rm -f qxtwidget.h qmotif.h qmotifdialog.h qmotifwidget.h
) || exit $?
%{l_shtool} install -c -m 644 \
include/*.h \
$RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/
%{l_shtool} install -c -m 644 \
include/private/*.h \
$RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private/
# install pkg-config specification
l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
%{l_shtool} install -c -m 644 \
%{l_value -s l_prefix} \
-e "s;@l_version@;%{version};g" \
-e "s;@l_x11_incdir@;${l_x11_incdir};g" \
-e "s;@l_x11_libdir@;${l_x11_libdir};g" \
%{SOURCE kde-qt.pc} \
$RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%not %dir %{l_prefix}/lib/pkgconfig'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT