File qt-mobility.spec of Package qt-mobility

#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define snapshot    20110922
%define baseversion 1.2.0
Name:           qt-mobility
Version:        %{baseversion}_%{snapshot}
Release:        0
License:        LGPL-2.1
Summary:        Qt Mobility APIs
Url:            http://qt.nokia.com
Group:          System/Libraries
#Source0:        http://get.qt.nokia.com/qt/add-ons/%{name}-opensource-src-%{version}.tar.gz
Source0:        %{name}-opensource-src-%{baseversion}-%{snapshot}.tar.bz2
Patch1:         qt-mobility-opensource-src-translationsdir.patch
Patch2:         qt-mobility-opensource-src-1.2.0-include-unistdh.patch
Patch3:         qt-mobility-opensource-src-1.2.0-pkgconfig.patch
BuildRequires:  NetworkManager-devel
BuildRequires:  alsa-devel
BuildRequires:  bluez-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gdb
BuildRequires:  gstreamer-0_10-plugins-base-devel
BuildRequires:  icu
BuildRequires:  libQtWebKit-devel
BuildRequires:  messagingframework-devel
BuildRequires:  pulseaudio-devel
BuildRequires:  pkgconfig(gstreamer-0.10)

%description
Qt Mobility Project delivers a set of mobile device related APIs to Qt.
These APIs allow the developer to use these features with ease from one
framework and apply them to phones, netbooks and non-mobile personal computers.

%package devel
Summary:        Development files for using QtMobility
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This package contains the files necessary to develop QtMobility applications

%prep
%setup -q -n %{name}-opensource-src-%{baseversion}
%patch1
%patch2 -p1
%patch3

%define _qt4_prefix %{_libdir}/qt4
%define _qt4_plugindir %{_qt4_prefix}/plugins
%define _qt4_examplesdir %{_qt4_prefix}/examples/qt-mobility
%define _qt4_tools_bindir %{_qt4_prefix}/bin

%build
export PATH=$PATH:%{_libdir}/qt4/bin
export QMF_INCLUDEDIR=%{_includedir}/QtMessagingFramework
export QMF_LIBDIR=%{_libdir}
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"

#Hack - we'll want to include tests, but these are causing build issues
#Furthermore, we should be using the configure directive, but that includes options that
#qt-mobility's configure script doesn't support.
./configure \
	-prefix %{_qt4_prefix} \
	-bindir %{_bindir} \
	-libdir %{_libdir} \
	-headerdir %{_includedir} \
	-plugindir %{_qt4_plugindir}
#        -libdir %{_qt4_libdir} \

make %{?_smp_mflags}

%install
%makeinstall INSTALL_ROOT=%{buildroot}

# QtMobility.pc
mkdir -p %{buildroot}%{_libdir}/pkgconfig
cat >%{buildroot}%{_libdir}/pkgconfig/QtMobility.pc<<EOF
libdir=%{_libdir}
includedir=%{_includedir}

Name: Qtmobility
Description: Qt Mobility
Version: %{version}
EOF

#remove path headings of build environment
qtbearer="%{buildroot}%{_libdir}/pkgconfig/QtBearer.pc"
qtconnectivity="%{buildroot}%{_libdir}/pkgconfig/QtConnectivity.pc"
qtcontacts="%{buildroot}%{_libdir}/pkgconfig/QtContacts.pc"
qtfeedback="%{buildroot}%{_libdir}/pkgconfig/QtFeedback.pc"
qtgallery="%{buildroot}%{_libdir}/pkgconfig/QtGallery.pc"
qtlocation="%{buildroot}%{_libdir}/pkgconfig/QtLocation.pc"
qtmultimediakit="%{buildroot}%{_libdir}/pkgconfig/QtMultimediaKit.pc"
qtorganizer="%{buildroot}%{_libdir}/pkgconfig/QtOrganizer.pc"
qtpublishsubscribe="%{buildroot}%{_libdir}/pkgconfig/QtPublishSubscribe.pc"
qtsensors="%{buildroot}%{_libdir}/pkgconfig/QtSensors.pc"
qtserviceframework="%{buildroot}%{_libdir}/pkgconfig/QtServiceFramework.pc"
qtsysteminfo="%{buildroot}%{_libdir}/pkgconfig/QtSystemInfo.pc"
qtversit="%{buildroot}%{_libdir}/pkgconfig/QtVersit.pc"
qtversitorganizer="%{buildroot}%{_libdir}/pkgconfig/QtVersitOrganizer.pc"
croppath="$RPM_BUILD_DIR/qt-mobility-opensource-src-%{baseversion}"
for pcfile in $qtbearer $qtconnectivity $qtcontacts $qtfeedback $qtgallery $qtlocation $qtmultimediakit $qtorganizer $qtpublishsubscribe $qtsensors $qtserviceframework $qtsysteminfo $qtversit $qtversitorganizer
do
  sed -ri s,$croppath,, $pcfile
done

%fdupes %{buildroot}

%check
cd tests
# broken with Qt 4.6
qmake . || true
# currently broken ...
make check || true

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_libdir}/*.so.*
%{_libdir}/*.prl
%{_qt4_plugindir}/audio
%{_qt4_plugindir}/contacts
%{_qt4_plugindir}/feedback
%{_qt4_plugindir}/geoservices
%{_qt4_plugindir}/imports
%{_qt4_plugindir}/landmarks
%{_qt4_plugindir}/mediaservice
#%%{_qt4_plugindir}/organizer
%{_qt4_plugindir}/sensors
%{_qt4_plugindir}/playlistformats
%{_qt4_plugindir}/versit
#%{_qt4_prefix}/mkspecs/features/mobility.prf
%{_datadir}/qt4/mkspecs/features/mobility.prf
%{_datadir}/qt4/mkspecs/features/mobilityconfig.prf
#%{_datadir}/qt4/translations/qtmobility_*.qm

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_libdir}/pkgconfig/QtMobility.pc
%{_libdir}/pkgconfig/QtBearer.pc
%{_libdir}/pkgconfig/QtConnectivity.pc
%{_libdir}/pkgconfig/QtContacts.pc
%{_libdir}/pkgconfig/QtFeedback.pc
%{_libdir}/pkgconfig/QtGallery.pc
%{_libdir}/pkgconfig/QtLocation.pc
%{_libdir}/pkgconfig/QtMultimediaKit.pc
%{_libdir}/pkgconfig/QtOrganizer.pc
%{_libdir}/pkgconfig/QtPublishSubscribe.pc
%{_libdir}/pkgconfig/QtSensors.pc
%{_libdir}/pkgconfig/QtServiceFramework.pc
%{_libdir}/pkgconfig/QtSystemInfo.pc
%{_libdir}/pkgconfig/QtVersit.pc
%{_libdir}/pkgconfig/QtVersitOrganizer.pc
%{_includedir}/*
#%{_qt4_examplesdir}/*
#%{_qt4_tools_bindir}/*
#%{_qt4_plugindir}/xmldata/notesmanagerservice.xml

%changelog
openSUSE Build Service is sponsored by