Sophie

Sophie

distrib > Mandriva > cs4.0 > i586 > by-pkgid > 6db27311da393084cc6f2b414a3b666f > files > 37

qt3-3.3.6-1.1.20060mlcs4.src.rpm

# QTDIR is always /usr/lib/qt3, whether that's a lib64 architecture or
# not (sublibdirs are correctly qualified in the latter case however).
%define qtdir	%{_prefix}/lib/qt3
%define libqt3name	%mklibname qt 3

%define libqassistantname %mklibname qassistantclient 1
%define libdesignercore %mklibname designercore 1
%define libeditor %mklibname editor 1

%define useqtcopy 0

%if %useqtcopy
%define nameqt	qt-x11-free-qt-copy-20060131
%else
%define nameqt	qt-x11-free
%endif


%define buildSQL 1
%{?_without_SQL: %{expand: %%global buildSQL 0}}

%define buildDebug 0
%{?_with_debug: %{expand: %%global buildDebug 1}}

%define buildStatic 1
%{?_without_static: %{expand: %%global buildStatic 0}}

%define buildImmodule 1
%{?_without_immodule: %{expand: %%global buildImmodule 0}}

%define plugindir  %{qtdir}/plugins/%{_lib}

Name: qt3
Version:	3.3.6
Release: %mkrel 2
License:	GPL and QPL
Summary: Qt3 - Sources
Group: System/Libraries
URL: http://www.trolltech.com
Packager: Mandriva Linux KDE Team <kde@mandriva.com>

Source: 	%nameqt-%version.tar.bz2
Source1:	qt3-set-QTDIR-environment-csh
Source2:	qt3-set-QTDIR-environment-sh
Source3:	qt3-designer.desktop
Source4:	qt3-linguist.desktop
# David - 3.0.0-0.11mdk - Properly set designer environment
Source5:	qt3-designer-sh
# David - 3.0.0-0.11mdk - Properly set assistant environment
Source6:	qt3-assistant-sh
# David - 3.0.0-0.11mdk - Properly set uic environment
Source7:	qt3-uic-sh
# David - 3.0.0-0.11mdk - Explain some things to users
Source8:	qt3-README-Mandriva-Linux
# David - 3.0.0-0.11mdk - Set QT_XFT
Source9:	qt3-set-QT_XFT-environment-csh
Source10:	qt3-set-QT_XFT-environment-sh

Patch1:  qt-3.1.1-fix-xft2-compile.patch
Patch2:  qt-3.2.3-fix-cupslib.patch
Patch3:  qt-3.3.2-active-aa-by-default.patch
Patch4:  qt-x11-free-3.3.5-no-rpath.patch
Patch5:  qt-3.3.2-fix-configure.patch
Patch6:  qt3-fix-unicode-font-cache.patch
Patch7:  qt-x11-free-3.3.5-fix-load-gl.patch
Patch8:  qt-3.3.5-lib64-plugins.patch
Patch9:  qt-x11-free-3.3.5-xpm-handling-fixes.patch
Patch10: qt-3.3.3-fix-accessible.patch
Patch11: qt-x11-free-3.3.6-qt-x11-immodule-unified-qt3.3.5-20060318-pre.patch
Patch12: qt3-3.3.6-fix-xim-space-touch.patch
Patch13: qt-x11-free-3.3.5-lib64-path.patch
Patch14: qt-x11-free-3.3.4-linux32.patch
Patch15: qt-visibility.patch
Patch16: qt-x11-free-3.3.5-makelibshared.patch
Patch17: qt3-opentype-aliasing.patch
Patch19: qt-3.3.5-external-sqlite.patch
Patch23: qt-x11-free-3.3.5-rubberband.patch
Patch22: qt-x11-free-3.3.5-qmakeconf-lib64.patch
Patch24: qt-x11-free-3.3.5-qtranslator-crash.patch
Patch25: qt-x11-free-3.3.5-enable-designer-plugins.patch
Patch31: qt-x11-immodule-unified-qt3.3.5-20060318.diff.bz2
Patch32: qt-x11-free-3.3.6-qt-x11-immodule-unified-qt3.3.5-20060318-post.patch
Patch33: qt-x11-immodule-unified-qt3.3.5-20051012-quiet.patch

Buildroot: 	%_tmppath/%name-%version-%release-root

%if %buildSQL
BuildRequires: MySQL-devel 
BuildRequires: unixODBC-devel 
BuildRequires: postgresql-devel
BuildRequires: sqlite-devel
%endif
BuildRequires: freetype2-devel
BuildRequires: libMesaGLU-devel 
BuildRequires: bzip2-devel
BuildRequires: libjpeg-devel
BuildRequires: libmng-devel
BuildRequires: libpng-devel
BuildRequires: XFree86-devel
BuildRequires: zlib1-devel 
BuildRequires: Xft-devel 
BuildRequires: nas-devel
%ifarch x86_64
BuildRequires:  linux32
%endif

%description
Qt is a complete and well-designed multi-platform object-oriented framework for
developing graphical user interface (GUI) applications using C++. Qt has
seamless integration with OpenGL/Mesa 3D libraries.

Qt is free for development of free software on the X Window System. It includes
the complete source code for the X version and makefiles for Linux, Solaris,
SunOS, FreeBSD, OSF/1, Irix, BSD/OS, NetBSD, SCO, HP-UX and AIX. This edition
of Qt may be modified and distributed under the terms found in the LICENSE.QPL
file.

Qt also supports Windows 95 and NT, with native look and feel. Code developed
for the X version of Qt can be recompiled and run using the Windows 95/NT
version of Qt, and vice versa.

Qt is currently used in hundreds of software development projects world wide,
including the K Desktop Environment (see http://www.kde.org). For more
examples, see http://www.trolltech.com/qtprogs.html.

Qt has excellent documentation: around 750 pages of postscript and fully
cross-referenced online html documentation. It is available on the web:
http://doc.trolltech.com/

Qt is easy to learn, with consistent naming across all the classes and a
14-chapter on-line tutorial with links into the rest of the documentation.
A number of 3rd-party books are also available.

Qt dramatically cuts down on development time and complexity in writing
user interface software for the X Window System. It allows the programmer
to focus directly on the programming task, and not mess around with
low-level Motif/X11 code.

Qt is fully object-oriented. All widgets and dialogs are C++ objects,
and, using inheritance, creation of new widgets is easy and natural.

Qt's revolutionary signal/slot mechanism provides true component
programming. Reusable components can work together without any knowledge
of each other, and in a type-safe way.

Qt has a very fast paint engine, in some cases ten times faster than other
toolkits. The X version is based directly on Xlib and uses neither
Motif nor X Intrinsics.

Qt is available under two different licenses:
  - The Qt Professional Edition License, for developing fully commercial
    software: see http://www.trolltech.com/pricing.html
  - The Q Public License (QPL), for developing free software (X Window System
    only).

#--------------------------------------------------------------------

%package -n %libqt3name
Summary: Qt3 - Shared libraries
Group: System/Libraries
Requires: %{name}-common = %version-%release

%description -n %libqt3name
Qt is a complete and well-designed multi-platform object-oriented framework for
developing graphical user interface (GUI) applications using C++. Qt has
seamless integration with OpenGL/Mesa 3D libraries.

Qt is free for development of free software on the X Window System. It includes
the complete source code for the X version and makefiles for Linux, Solaris,
SunOS, FreeBSD, OSF/1, Irix, BSD/OS, NetBSD, SCO, HP-UX and AIX. This edition
of Qt may be modified and distributed under the terms found in the LICENSE.QPL
file.

Qt also supports Windows 95 and NT, with native look and feel. Code developed
for the X version of Qt can be recompiled and run using the Windows 95/NT
version of Qt, and vice versa.

Qt is currently used in hundreds of software development projects world wide,
including the K Desktop Environment (see http://www.kde.org). For more
examples, see http://www.trolltech.com/qtprogs.html.

Qt has excellent documentation: around 750 pages of postscript and fully
cross-referenced online html documentation. It is available on the web:
http://doc.trolltech.com/

Qt is easy to learn, with consistent naming across all the classes and a
14-chapter on-line tutorial with links into the rest of the documentation.
A number of 3rd-party books are also available.

Qt dramatically cuts down on development time and complexity in writing
user interface software for the X Window System. It allows the programmer
to focus directly on the programming task, and not mess around with
low-level Motif/X11 code.

Qt is fully object-oriented. All widgets and dialogs are C++ objects,
and, using inheritance, creation of new widgets is easy and natural.

Qt's revolutionary signal/slot mechanism provides true component
programming. Reusable components can work together without any knowledge
of each other, and in a type-safe way.

Qt has a very fast paint engine, in some cases ten times faster than other
toolkits. The X version is based directly on Xlib and uses neither
Motif nor X Intrinsics.

Qt is available under two different licenses:
  - The Qt Professional Edition License, for developing fully commercial
    software: see http://www.trolltech.com/pricing.html
  - The Q Public License (QPL), for developing free software (X Window System
    only).

This package contains shared libraries. 

%post -n %libqt3name
grep -q "^%qtdir/%_lib$" /etc/ld.so.conf || echo "%qtdir/%_lib" >> /etc/ld.so.conf
/sbin/ldconfig

%postun -n %libqt3name
if [ "$1" = "0" ]; then
   rm -f /etc/ld.so.conf.new
   grep -v -e "^%qtdir/%_lib$" /etc/ld.so.conf > /etc/ld.so.conf.new
   mv -f /etc/ld.so.conf.new /etc/ld.so.conf
fi
/sbin/ldconfig

%files -n %libqt3name
%defattr(-,root,root,-)
%dir %qtdir/
%dir %qtdir/%_lib/
%qtdir/%_lib/libqt-mt.so.3
%qtdir/%_lib/libqt-mt.so.3.3
%qtdir/%_lib/libqt-mt.so.%version
%qtdir/%_lib/libqt-mt.la
%qtdir/%_lib/libqui.so.1
%qtdir/%_lib/libqui.so.1.0
%qtdir/%_lib/libqui.so.1.0.0
%qtdir/%_lib/*.prl

%dir %{plugindir}/styles/
%{plugindir}/styles/*style.so

%if %{buildImmodule}
%dir %{plugindir}/inputmethods/
%{plugindir}/inputmethods/*.so
%endif

#--------------------------------------------------------------------

%package -n %libqt3name-devel
Summary: Qt3 - Files needed to build Qt3 based applications
Group: Development/KDE and Qt
Requires: %libqt3name = %version-%release
Requires: XFree86-devel
Provides: libqt-devel = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}
Obsoletes: libqt3-pch-headers < 3.3.5

%description -n %libqt3name-devel
Qt is a complete and well-designed multi-platform object-oriented framework for
developing graphical user interface (GUI) applications using C++. Qt has
seamless integration with OpenGL/Mesa 3D libraries.

Qt is free for development of free software on the X Window System. It includes
the complete source code for the X version and makefiles for Linux, Solaris,
SunOS, FreeBSD, OSF/1, Irix, BSD/OS, NetBSD, SCO, HP-UX and AIX. This edition
of Qt may be modified and distributed under the terms found in the LICENSE.QPL
file.

Qt also supports Windows 95 and NT, with native look and feel. Code developed
for the X version of Qt can be recompiled and run using the Windows 95/NT
version of Qt, and vice versa.

Qt is currently used in hundreds of software development projects world wide,
including the K Desktop Environment (see http://www.kde.org). For more
examples, see http://www.trolltech.com/qtprogs.html.

Qt has excellent documentation: around 750 pages of postscript and fully
cross-referenced online html documentation. It is available on the web:
http://doc.trolltech.com/

Qt is easy to learn, with consistent naming across all the classes and a
14-chapter on-line tutorial with links into the rest of the documentation.
A number of 3rd-party books are also available.

Qt dramatically cuts down on development time and complexity in writing
user interface software for the X Window System. It allows the programmer
to focus directly on the programming task, and not mess around with
low-level Motif/X11 code.

Qt is fully object-oriented. All widgets and dialogs are C++ objects,
and, using inheritance, creation of new widgets is easy and natural.

Qt's revolutionary signal/slot mechanism provides true component
programming. Reusable components can work together without any knowledge
of each other, and in a type-safe way.

Qt has a very fast paint engine, in some cases ten times faster than other
toolkits. The X version is based directly on Xlib and uses neither
Motif nor X Intrinsics.

Qt is available under two different licenses:
  - The Qt Professional Edition License, for developing fully commercial
    software: see http://www.trolltech.com/pricing.html
  - The Q Public License (QPL), for developing free software (X Window System
    only).

This package contains:
  - files needed to build Qt based applications
  - designer, assistant and linguist applications

%post -n %libqt3name-devel
/sbin/ldconfig
%update_menus

%postun -n %libqt3name-devel
/sbin/ldconfig
%clean_menus

%files -n %libqt3name-devel
%defattr(-,root,root,-)
%doc %_mandir/man1/*
%doc %_mandir/man3/*
%_bindir/assistant
%_bindir/designer-qt3
%_bindir/qmake
%qtdir/%_lib/*.so
%_menudir/*
%dir %qtdir/%_lib/pkgconfig/
%qtdir/%_lib/pkgconfig/*.pc
%dir %_libdir/pkgconfig/
%_libdir/pkgconfig/*.pc
%dir %_datadir/applnk/
%dir %_datadir/applnk/Development/
%_datadir/applnk/Development/*.desktop
%dir %_datadir/gnome/
%dir %_datadir/gnome/apps/
%dir %_datadir/gnome/apps/Development/
%_datadir/gnome/apps/Development/*.desktop
%dir %qtdir/
%dir %qtdir/bin
%qtdir/bin/assistant  
%qtdir/bin/designer-real  
%qtdir/bin/lrelease  
%qtdir/bin/moc    
%qtdir/bin/qmake
%multiarch %qtdir/bin/%multiarch_platform/qmake
%qtdir/bin/uic
%qtdir/bin/designer   
%qtdir/bin/linguist       
%qtdir/bin/lupdate   
%qtdir/bin/qm2ts  
%multiarch %dir %qtdir/include/%multiarch_platform
%multiarch %qtdir/include/%multiarch_platform/*.h
%dir %qtdir/include/
%qtdir/include/*.h
%dir %qtdir/include/private/
%qtdir/include/private/*.h
%dir %qtdir/templates/
%qtdir/templates/*.ui
%dir %{plugindir}/designer
%{plugindir}/designer/*
%dir %qtdir/mkspecs/
%qtdir/mkspecs/*
%dir %qtdir/src/
%qtdir/src/*

#--------------------------------------------------------------------
%if %{buildStatic}

%package -n %libqt3name-static-devel
Summary: Qt3 - Static files needed to build Qt3 based applications
Group: Development/KDE and Qt
Requires: %libqt3name-devel = %version-%release
Provides: libqt-static-devel = %{version}-%{release}
Provides: %{name}-static-devel = %{version}-%{release}

%description -n %libqt3name-static-devel
This package contains:
  - files needed to build static Qt based applications

%files -n %libqt3name-static-devel
%defattr(-,root,root,-)
%qtdir/%_lib/*.a

%endif

#--------------------------------------------------------------------

%package common
Summary:	config, language file for Qt
Group:      Development/KDE and Qt
Requires:   %libqt3name = %version
Obsoletes:	libqt3-common
Provides:	libqt3-common = %{version}-%{release}
# Laurent : allow to install package which use this provides (commercial packages which want to install under distro and used this provides
Provides:	qt = %{version}-%{release}
Provides:	qt3 = %{version}-%{release}

%description common
This package contains all config file and language file

%files common
%defattr(-,root,root,-)
%dir %{plugindir}
%if %buildSQL
%dir %{plugindir}/sqldrivers
%endif
%dir %qtdir/phrasebooks/
%qtdir/phrasebooks/*.qph
%dir %qtdir/
%dir %qtdir/bin
%qtdir/bin/qtconfig
%_bindir/qtconfig
%_sysconfdir/profile.d/*.csh
%_sysconfdir/profile.d/*.sh
%config(noreplace) %_sysconfdir/qtrc
%dir %qtdir/translations/
%qtdir/translations/*.qm

#--------------------------------------------------------------------

%if %buildSQL
%package -n %libqt3name-mysql
Summary: 	MySQL plugin for Qt
Group: 		Development/KDE and Qt
Requires:	%libqt3name = %version-%release
Provides:	%{name}-MySQL = %{version}-%{release}

%description -n %libqt3name-mysql
This package contain the MySQL plugin for Qt.

%files -n %libqt3name-mysql
%defattr(-,root,root)
%{plugindir}/sqldrivers/libqsqlmysql.so


%package -n %libqt3name-psql
Summary: 	PostgresSQL plugin for Qt
Group: 		Development/KDE and Qt
Requires:	%libqt3name = %version-%release
Provides:	%{name}-PostgreSQL = %{version}-%{release}

%description -n %libqt3name-psql
This package contain the PostgresSQL plugin for Qt.


%files -n %libqt3name-psql
%defattr(-,root,root)
%{plugindir}/sqldrivers/libqsqlpsql.so

%package -n %libqt3name-odbc
Summary: 	ODBC plugin for Qt
Group: 		Development/KDE and Qt
Requires:	%libqt3name = %version-%release
Provides:	%{name}-ODBC = %{version}-%{release}

%description -n %libqt3name-odbc
This package contain the ODBC plugin for Qt.


%files -n %libqt3name-odbc
%defattr(-,root,root)
%{plugindir}/sqldrivers/libqsqlodbc.so


%package -n %libqt3name-sqlite
Summary: 	Sqlite 2 plugin for Qt
Group: 		Development/KDE and Qt
Requires:	%libqt3name = %version-%release
Provides:	%{name}-Sqlite = %{version}-%{release}

%description -n %libqt3name-sqlite
This package contain the Sqlite 2 plugin for Qt.

%files -n %libqt3name-sqlite
%defattr(-,root,root)
%{plugindir}/sqldrivers/libqsqlite.so

%endif

#--------------------------------------------------------------------

%package -n %libqassistantname
Summary: Qt3 - Shared libraries
Group: System/Libraries

%description -n %libqassistantname
Qt3 - Shared libraries

%post -n %libqassistantname -p /sbin/ldconfig
%postun -n %libqassistantname -p /sbin/ldconfig

%files -n %libqassistantname
%defattr(-,root,root)
%qtdir/%_lib/libqassistantclient.so.*

#--------------------------------------------------------------------

%package -n %libdesignercore
Summary: Qt3 - Shared libraries
Group: System/Libraries

%description -n %libdesignercore
Qt3 - Shared libraries

%post -n %libdesignercore -p /sbin/ldconfig
%postun -n %libdesignercore -p /sbin/ldconfig

%files -n %libdesignercore
%defattr(-,root,root)
%qtdir/%_lib/libdesignercore.so.*

#--------------------------------------------------------------------

%package -n %libeditor
Summary: Qt3 - Shared libraries
Group: System/Libraries

%description -n %libeditor
Qt3 - Shared libraries

%post -n %libeditor -p /sbin/ldconfig
%postun -n %libeditor -p /sbin/ldconfig

%files -n %libeditor
%defattr(-,root,root)
%qtdir/%_lib/libeditor.so.*

#--------------------------------------------------------------------

%package example
Summary:    Qt examples.
Group:      Development/KDE and Qt
Obsoletes:  libqt3-example
Provides:   libqt3-example

%description example
This package contain Qt example.

%files example
%defattr(-,root,root)
%doc %_docdir/qt-%version/examples

#--------------------------------------------------------------------

%package tutorial
Summary:    Qt tutorials.
Group:      Development/KDE and Qt

%description tutorial
This package contain Qt tutorial.

%files tutorial
%defattr(-,root,root)
%doc %_docdir/qt-%version/tutorial

#--------------------------------------------------------------------

%package doc
Summary: Qt documentation
Group: Development/KDE and Qt
Conflicts:libqt3-devel <= 3.3.4-13mdk

%description doc
This package contain Qt documentation

%files doc
%dir %_docdir/qt-%version/
%doc %_docdir/qt-%version/FAQ
%doc %_docdir/qt-%version/LICENSE*
%doc %_docdir/qt-%version/README*
%dir %_docdir/qt-%version/doc/
%dir %_docdir/qt-%version/doc/html/
%doc %_docdir/qt-%version/doc/html/*
%dir %qtdir/doc/
%qtdir/doc/html

#--------------------------------------------------------------------


%prep
%setup -q -n %nameqt-%version

%if %useqtcopy
# Apply qt-copy patches
sh ./apply_patches
%endif

%patch1 -p1 -b .fix_xft_compile
%patch2 -p1 -b .fix_cups_lib
%patch3 -p1 -b .use_aa_by_default
%patch4 -p0 
%patch5 -p1 -b .fix_configure_space
%patch6 -p1 -b .fix_unicode_font_cache
%if "%_lib" != "lib"
sed 's,/lib64/,/lib/,' %PATCH7 | patch -p0 
%patch8 -p0 -b .fix_lib64
%patch13 -p1 -b .path_lib64
%patch22 -p1 
%else
%patch7 -p0 -b .fix_opengl
%endif
%patch9 -p0 -b .xpm_handling
%patch10 -p1 -b .fix_accessible
%if %{buildImmodule}
%patch11 -p1 -b .add_support_for_qt_immodule
%patch31 -p1 -b .diff_immodule
%patch32 -p1 -b .post_immodule
%patch33 -p1 -b .fix
%endif
%patch12 -p1 -b .space
%patch14 -p1 -b .linux32
%patch15 -p1 -b .fix_qt_export
%patch16 -p1 -b .sharedlibs
%patch17 -p1 -b .opentype
%patch19 -p0 -b .ext_sqlite
%patch23 -p0 -b .rubberband
%patch24 -p0 -b .qtranslator
%patch25 -p0 -b .designer_plugins

%build
export QTDIR=$(/bin/pwd)
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/doc/man:$MANPATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

%if %{buildImmodule}
sh ./make-symlinks.sh
%endif

%if %useqtcopy
make -f Makefile.cvs
%endif

# Default platform (take care to lib64 arches)
%if "%_lib" != "lib"
PLATFORM=linux-g++-64
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DUSE_LIB64_PATHES"
%else
PLATFORM=linux-g++
%endif
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"

function main_configure {
echo "yes" | ./configure \
	-I/usr/include/pgsql/ \
	-I/usr/include/pgsql/server/ \
	-I/usr/include/fontconfig \
	-I/usr/include/Xft2 \
	-I/usr/include/Xft2/X11/Xft \
	-I/usr/include/mysql/ \
	-prefix %qtdir/ \
	-libdir %qtdir/%_lib \
   -plugindir %qtdir/plugins/%_lib \
	-sysconfdir %_sysconfdir \
	-docdir %_docdir/qt-%version/doc/ \
   %if %{buildDebug}
   -debug \
   %else
	-release \
   %endif
	-qt-gif \
	-system-zlib \
	-system-nas-sound \
	-no-exceptions \
	-platform $PLATFORM \
	-enable-tools \
	-enable-kernel \
	-enable-widgets \
	-enable-dialogs \
	-enable-iconview \
	-enable-workspace \
	-enable-network \
	-enable-canvas \
	-enable-table \
	-enable-xml \
	-enable-input \
	-enable-opengl \
	-dlopen-opengl \
	%if %buildSQL		
		-enable-sql \
		-plugin-sql-mysql \
		-plugin-sql-odbc \
		-plugin-sql-psql \
		-plugin-sql-sqlite \
	%endif
	-plugin-style-cde \
	-plugin-style-compact \
	-plugin-style-motif \
	-plugin-style-sgi \
	-plugin-style-platinum \
	-plugin-style-motifplus \
	-thread \
	-stl \
	-qt-imgfmt-png \
	-qt-imgfmt-jpeg \
	-qt-imgfmt-mng  \
	-system-libpng \
	-system-libjpeg \
	-system-libmng \
	-sm \
	-xinerama \
	-xrender \
	-xrandr \
	-xcursor \
	-xft \
	-nis \
	-no-tablet \
	-v \
	-xkb \
	$*
}

%if %{buildStatic}

main_configure -static 
pushd src
	%make && make INSTALL_ROOT=%{buildroot} install_target
popd
mkdir safelib
mv lib/libqt-mt.a safelib
%endif

# Build shared
main_configure -shared 
%make symlinks src-qmake src-moc sub-src sub-tools


%install
export QTDIR=$(/bin/pwd)
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/doc/man:$MANPATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
rm -fr %buildroot


make install INSTALL_ROOT=%buildroot/

mkdir -p %buildroot/%_libdir/pkgconfig/
cd %buildroot/%_libdir/pkgconfig/
ln -sf %qtdir/%_lib/pkgconfig/qt-mt.pc qt-mt.pc
cd -



# David - 3.0.0-0.11mdk - Install missing documentation
install -d -m 0755 %buildroot/%_docdir/qt-%version/
install -m 0644 $RPM_BUILD_DIR/%nameqt-%version/FAQ       %buildroot/%_docdir/qt-%version/
install -m 0644 $RPM_BUILD_DIR/%nameqt-%version/LICENSE*  %buildroot/%_docdir/qt-%version/
install -m 0644 $RPM_BUILD_DIR/%nameqt-%version/README    %buildroot/%_docdir/qt-%version/
install -m 0644 $RPM_BUILD_DIR/%nameqt-%version/README-QT.TXT %buildroot/%_docdir/qt-%version/

rm -rf %buildroot/%qtdir/bin/qmake
install -m 0755  $RPM_BUILD_DIR/%nameqt-%version/qmake/qmake %buildroot/%qtdir/bin/

# David - 3.0.0-0.11mdk - Install a README for Mandriva Linux
install -m 0644 %SOURCE8 %buildroot/%_docdir/qt-%version/README.Mandriva_Linux
perl -pi -e "s|QtVersion|%version|" %buildroot/%_docdir/qt-%version/README.Mandriva_Linux
perl -pi -e "s|PackageVersion|%version-%release|" %buildroot/%_docdir/qt-%version/README.Mandriva_Linux


# David - 3.0.0-0.11mdk - Install man pages
install -d -m 0755 %buildroot/%_mandir/man1/
for i in $RPM_BUILD_DIR/%nameqt-%version/doc/man/man1/* ; do
		if [ ! -d $i ] ; then
		   install -m 0644 $i %buildroot/%_mandir/man1/
		fi
done
#
install -d -m 0755 %buildroot/%_mandir/man3/
for i in $RPM_BUILD_DIR/%nameqt-%version/doc/man/man3/* ; do
	    if [ ! -d $i ] ; then
   			install -m 0644 $i %buildroot/%_mandir/man3/
	    fi
done


install -d -m 0755 %buildroot/%_bindir/
install -m 0755 $RPM_BUILD_DIR/%nameqt-%version/bin/moc %buildroot/%qtdir/bin/moc

# David - 3.0.1-2mdk - Install .pri files needed to build examples and tutorials
install -d -m 0755 %buildroot/%qtdir/src/
for i in $RPM_BUILD_DIR/%nameqt-%version/src/*.pri; do
   install -m 0644 $i %buildroot/%qtdir/src/
done


cp -ar $RPM_BUILD_DIR/%nameqt-%version/examples/ %buildroot/%_docdir/qt-%version
cp -ar $RPM_BUILD_DIR/%nameqt-%version/tutorial/ %buildroot/%_docdir/qt-%version

# Fix include directory for examples ( based on David Faure changes )
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../../include|%qtdir/include|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../include|%qtdir/include|"

# Fix lib directory for examples
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../../../lib/libqt-mt.prl|%qtdir/%_lib/libqt-mt.prl|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../../lib/libqt-mt.prl|%qtdir/%_lib/libqt-mt.prl|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../lib/libqt-mt.prl|%qtdir/%_lib/libqt-mt.prl|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../src/qt_professional.pri|%qtdir/src/qt_professional.pri|"

# Set RPM_BUILD_DIR to QTDIR
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|$RPM_BUILD_DIR/qt-%version|%qtdir|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|$RPM_BUILD_DIR/qt-x11-free-%version/mkspecs/|%qtdir/mkspecs/|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|$RPM_BUILD_DIR/qt-x11-free-%version/|%qtdir/|"
find %buildroot/%_docdir/qt-%version/{examples,tutorial} -name Makefile | xargs perl -pi -e "s|../../lib/libqassistantclient.prl|%qtdir/%_lib/libqassistantclient.prl|"

# Remove .obj .moc directories
for name in `find %buildroot/%_docdir/qt-%version/{examples,tutorial} -type d -name .obj`; do
   rm -rf $name
done
for name in `find %buildroot/%_docdir/qt-%version/{examples,tutorial} -type d -name .moc`; do
   rm -rf $name
done


# David - 3.0.0-0.11mdk - Create a fake QTDIR (because Qt doesn't care of FHS
#                         and want all its directories in its own directory...)
cd %buildroot/%qtdir/
install -d -m 0755 doc
ln -s %_datadir/doc/qt-%version/doc/html/ doc/html
cd -


# David - 3.0.0-0.11mdk - Install needed files to automatically set QTDIR
#                         (because Qt doesn't care of FHS and want all its
#                         directories in its own directory...)
install -d -m 0755 %buildroot/%_sysconfdir/profile.d/
install -m 0755 %SOURCE1 %buildroot/%_sysconfdir/profile.d/qtdir3.csh
install -m 0755 %SOURCE2 %buildroot/%_sysconfdir/profile.d/qtdir3.sh


# Generate default qtrc
install -d -m 0755 %buildroot/%_sysconfdir/
cat >> %buildroot/%_sysconfdir/qtrc << EOF
[3.3]
libraryPath=%{qtdir}/plugins

[General]
enableXft=true
font=Sans,10,-1,5,0,0,0,0,0,0
style=galaxy
useXft=true
EOF


# David - 3.0.0-0.11mdk - Be sure designer is launched using the right environment
mv %buildroot/%qtdir/bin/designer %buildroot/%qtdir/bin/designer-real
install -m 0755 %SOURCE5 %buildroot/%qtdir/bin/designer
install -m 0755 %SOURCE6 %buildroot/%_bindir/assistant

pushd %buildroot/%_bindir
ln -s %qtdir/bin/qtconfig qtconfig
ln -s %qtdir/bin/designer designer-qt3
ln -s %qtdir/bin/qmake qmake
popd
 
# Removing invalid symlink. They really should not be here
# Old symlink if was set in right place, would create a cyclic symlynk
cd %buildroot/%qtdir/mkspecs/
if [ -h default ]; then
   rm -f default
fi
ln -s linux-g++ default
ln -s linux-g++-64 default64
cd -



# David - 3.0.0-0.11mdk - Install designer and linguist .desktop files for Gnome
install -d -m 0755 %buildroot/%_datadir/gnome/apps/Development/
install -m 0644 %SOURCE3 %buildroot/%_datadir/gnome/apps/Development/designer.desktop
install -m 0644 %SOURCE4 %buildroot/%_datadir/gnome/apps/Development/linguist.desktop


# David - 3.0.0-0.11mdk - Install designer and linguist .desktop files for KDE
install -d -m 0755 %buildroot/%_datadir/applnk/Development/
install -m 0644 %SOURCE3 %buildroot/%_datadir/applnk/Development/designer.desktop
install -m 0644 %SOURCE4 %buildroot/%_datadir/applnk/Development/linguist.desktop


## David - 3.0.0-0.11mdk - Install menu entries
install -d -m 0755 %buildroot/%_menudir/

# David - 3.0.0-0.11mdk - Install assistant menu entry
cat <<EOF > %buildroot/%_menudir/libqt3-devel-assistant
?package(libqt3-devel): needs=X11 \
                         section="More Applications/Documentation" \
			 title="Qt3 Assistant" \
			 longtitle="A manual browser for Qt3 documentation" \
			 command="%_bindir/assistant" \
			 icon="documentation_section.png"
EOF

# David - 3.0.0-0.11mdk - Install designer menu entry
cat <<EOF > %buildroot/%_menudir/libqt3-devel-designer
?package(libqt3-devel): needs=X11 \
                        section="More Applications/Development/Development Environments" \
			title="Qt3 Designer" \
			longtitle="A graphical designer/dialog builder for Qt3" \
			command="/usr/bin/designer-qt3" \
			mimetypes="application/x-designer" \
			icon="development_environment_section.png"
EOF

# David - 3.0.0-0.11mdk - Install linguist menu entry
cat <<EOF > %buildroot/%_menudir/libqt3-devel-linguist
?package(libqt3-devel): needs=X11 \
                        section="More Applications/Development/Development Environments" \
			title="Qt Linguist" \
			longtitle="A translation tool for Qt3" \
			command="%qtdir/bin/linguist" \
			mimeType="application/x-linguist" \
			icon="development_environment_section.png"
EOF

# Multiarch fixes
%multiarch_binaries %buildroot%qtdir/bin/qmake
%multiarch_includes %buildroot%qtdir/include/qconfig.h

%if %{buildStatic}
# Static install
install -d -m 0755 %buildroot/%qtdir/%_lib/ 
install -m644 safelib/*  %{buildroot}/%{qtdir}/%_lib/ 
%endif

%clean
rm -fr %buildroot

%changelog
* Thu Jun 22 2006 Helio Castro <helio@mandriva.com> 3.3.6-%mkrel 2

- Fix space touch with ximm

* Mon Mar 20 2006 Helio Castro <helio@mandriva.com> 3.3.5-%mkrel 7
 
- default and default64 since using lib32 patch

* Fri Mar 03 2006 Helio Castro <helio@mandriva.com> 3.3.5-%mkrel 6

- Backport fixes from cooker. Most symlinks fixes