Name:           qt-mobility
Version:        1.2.2
Release:        2
Summary:        Framwork of qt mobility
License:        LGPLv2 with exceptions
URL:            https://code.qt.io/cgit/qt-mobility/qt-mobility.git
Source0:        qt-mobility-opensource-src-%{version}-169da60c.tar.xz
Patch0:         qt-mobility-opensource-src-1.2.2-gcc6.patch
Patch1:         qt-mobility-opensource-src-1.2.2-pkgconfig.patch
Patch2:         qt-mobility-opensource-src-1.2.2-sensors_ftbfs.patch

BuildRequires:  gcc-c++ perl proj-devel pkgconfig(xv) pkgconfig(QtGui) pkgconfig(QtOpenGL)
BuildRequires:  pkgconfig(QtDeclarative) pkgconfig(QtCore) pkgconfig(libudev) pkgconfig(libnm)
BuildRequires:  pkgconfig(alsa) pkgconfig(blkid) pkgconfig(bluez) pkgconfig(libpulse)
Requires:       qt4

Provides:       qt4-mobility = %{version}-%{release} qt4-mobility%{?_isa} = %{version}-%{release}
Provides:       %{name}-connectivity = %{version}-%{release} %{name}-contacts = %{version}-%{release}
Obsoletes:      %{name}-connectivity < %{version}-%{release} %{name}-contacts < %{version}-%{release}
Provides:       %{name}-feedback = %{version}-%{release} %{name}-gallery = %{version}-%{release}
Obsoletes:      %{name}-feedback < %{version}-%{release} %{name}-gallery < %{version}-%{release}
Provides:       %{name}-location = %{version}-%{release} %{name}-multimediakit = %{version}-%{release}
Obsoletes:      %{name}-location < %{version}-%{release} %{name}-multimediakit < %{version}-%{release}
Provides:       %{name}-organizer = %{version}-%{release} %{name}-pim = %{version}-%{release}
Obsoletes:      %{name}-organizer < %{version}-%{release} %{name}-pim < %{version}-%{release}
Provides:       %{name}-versit = %{version}-%{release} %{name}-publishsubscribe = %{version}-%{release}
Obsoletes:      %{name}-versit < %{version}-%{release} %{name}-publishsubscribe < %{version}-%{release}
Provides:       %{name}-sensors = %{version}-%{release} %{name}-serviceframework = %{version}-%{release}
Obsoletes:      %{name}-sensors < %{version}-%{release} %{name}-serviceframework < %{version}-%{release}
Provides:       %{name}-bearer = %{version}-%{release}
Obsoletes:      %{name}-bearer < %{version}-%{release}

%description
This pacakge provides a set of APIs to Qt. It is also not only a single API but a collection of APIs 
and frameworks. These APIs give the developer a range of desirable functions for a mobile platform,
but now these functions become possible on platforms not traditionally associated with some of the
features. It will be used by developers to build a variety of applications and services that are mobile
capable or familiar to mobile users, irrespective of whether the platform is mobile or not. This means
that there is the possibility of easy transfer of user experience from PC to phone or vice versa.

%package devel
Summary:  The development files for %{name}
Requires: qt4-devel %{name} = %{version}-%{release}
Provides: qt4-mobility-devel = %{version}-%{release} qt4-mobility-devel%{?_isa} = %{version}-%{release}
Provides: %{name}-bearer-devel = %{version}-%{release} %{name}-connectivity-devel = %{version}-%{release}
Provides: %{name}-feedback-devel = %{version}-%{release} %{name}-contacts-devel = %{version}-%{release}
Provides: %{name}-gallery-devel = %{version}-%{release} %{name}-location-devel = %{version}-%{release}
Provides: %{name}-multimediakit-devel = %{version}-%{release} %{name}-organizer-devel = %{version}-%{release}
Provides: %{name}-publishsubscribe-devel = %{version}-%{release} %{name}-sensors-devel = %{version}-%{release}
Provides: %{name}-serviceframework-devel = %{version}-%{release} %{name}-versit-devel = %{version}-%{release}
Provides: %{name}-systeminfo-devel = %{version}-%{release}

%description devel
This package contain the development files for %{name}.

%prep
%autosetup -n %{name}-opensource-src-%{version} -p1
rm -r src/3rdparty/proj

%build
PATH=%{_qt4_bindir}:$PATH; export PATH

./configure -prefix %{_qt4_prefix} -bindir %{_bindir} -headerdir %{_qt4_headerdir} -release\
  -languages "ar cs da de es fr he hu ja ko pl pt ru sk sl sv uk zh_CN zh_TW" \
  -libdir %{_qt4_libdir} -plugindir %{_qt4_plugindir} -qmake-exec %{_qt4_qmake} \

%{qmake_qt4} -r
%make_build
%make_build qch_docs

%install
make install INSTALL_ROOT=%{buildroot}

%find_lang %{name} --all-name --with-qt --without-mo

%ldconfig_scriptlets

%files -f %{name}.lang
%license LICENSE.LGPL LGPL_EXCEPTION.txt
%dir %{_qt4_importdir}/QtMobility/
%{_qt4_importdir}/QtMobility/{connectivity/,feedback/,gallery/}
%{_qt4_importdir}/QtMobility/{location/,contacts/,organizer/,systeminfo/}
%{_qt4_importdir}/QtMobility/{publishsubscribe/,sensors/,serviceframework/}
%{_qt4_importdir}/QtMultimediaKit/
%{_qt4_libdir}/libQt{Bearer,Connectivity,Feedback,Gallery,Sensors}.so.1*
%{_qt4_libdir}/libQt{Location,MultimediaKit,Contacts,Organizer}.so.1*
%{_qt4_libdir}/libQt{Versit,VersitOrganizer,PublishSubscribe}.so.1*
%{_qt4_libdir}/libQt{ServiceFramework,SystemInfo}.so.1*
%{_qt4_plugindir}/{feedback/,geoservices/,landmarks/,audio/,sensors/}
%{_qt4_plugindir}/{mediaservice/,playlistformats/,contacts/,versit/}
%{_qt4_plugindir}/sensorgestures/

%files devel
%{_bindir}/*
%{_qt4_prefix}/mkspecs/features/mobility*.prf
%{_qt4_headerdir}/Qt*/
%{_qt4_libdir}/{libQt*.prl,libQt*.so}
%{_qt4_libdir}/pkgconfig/Qt*.pc

%changelog
* Thu Dec 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.2.2-1
- Package init
