File telepathy-qt4.spec of Package telepathy-qt4

#
# spec file for package telepathy-qt4
#
# Copyright (c) 2014 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         libname libtelepathy-qt4
%define         major   2
%define         farstream 1
%if 0%{?suse_version} > 1310
%define         gstreamer1 1
%else
%define         gstreamer1 0
%endif

Name:           telepathy-qt4
Version:        0.9.5
Release:        0
Summary:        Qt4 bindings for the Telepathy Library
License:        LGPL-2.1+
Group:          Development/Tools/Other
Url:            http://telepathy.freedesktop.org/
Source:         http://telepathy.freedesktop.org/releases/telepathy-qt/telepathy-qt-%{version}.tar.gz
# PATCH-FIX-UPSTREAM search-for-gstreamer1.0.diff -- searches for gstreamer1.0, which is only required for includes
Patch0:         search-for-gstreamer1.0.diff
# PATCH-FIX-UPSTREAM search-for-farstream0.2.diff -- searches for farstream0.2, instead of deprecated 0.1
Patch1:         search-for-farstream0.2.diff
# PATCH-FIX-UPSTREAM search-for-telepathy-farstream-0.4.diff -- searches for telepathy-farstream-0.4
Patch2:         search-for-telepathy-farstream-0.4.diff
BuildRequires:  cmake
BuildRequires:  dbus-1-python
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  libqt4-devel
BuildRequires:  libxml2-devel
BuildRequires:  python-xml
BuildRequires:  pkgconfig(telepathy-glib)
%if 0%{?farstream}
%if 0%{?gstreamer1}
BuildRequires:  pkgconfig(farstream-0.2)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(telepathy-farstream)
%else
BuildRequires:  pkgconfig(farstream-0.1)
BuildRequires:  pkgconfig(gstreamer-0.10)
BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
%if 0%{?suse_version} <= 1310
BuildRequires:  pkgconfig(telepathy-farstream-0.4)
%else
BuildRequires:  pkgconfig(telepathy-farstream)
%endif
%endif
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Telepathy-Qt4 is a high-level binding for Telepathy, similar to telepathy-glib but for Qt 4.

%package -n %{libname}-%{major}
Summary:        Library for performing syntax highlighting in Qt documents
Group:          Development/Tools/Other
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}

%description -n %{libname}-%{major}
Telepathy-Qt4 is a high-level binding for Telepathy, similar to telepathy-glib but for Qt 4.

%if 0%{?farstream}
%package -n %{libname}-farstream%{major}
Summary:        Library for performing syntax highlighting in Qt documents
Group:          Development/Tools/Other
Obsoletes:      %{libname}-farsight%{major}

%description -n %{libname}-farstream%{major}
Telepathy-farstream-Qt4 is a high-level binding for Telepathy, similar to telepathy-glib but for Qt 4.
%endif

%package devel
Summary:        Header files, libraries and development documentation for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{libname}-%{major} = %{version}
Provides:       %{name}-service-devel-static = %{version}
%if 0%{?farstream}
Requires:       %{libname}-farstream%{major} = %{version}
%if 0%{?gstreamer1}
Requires:       pkgconfig(gstreamer-1.0)
Requires:       pkgconfig(gstreamer-plugins-base-1.0)
%else
Requires:       pkgconfig(gstreamer-0.10)
Requires:       pkgconfig(gstreamer-plugins-base-0.10)
%endif
%endif

%description devel
This package contains the header files, static libraries and development documentation for %{name}. If you like to develop programs using %{name}, you will need to install %{name}-devel.

%prep
%setup -q -n telepathy-qt-%{version}
%if 0%{?suse_version} <= 1310
%patch0 -Rp1
%patch1 -p1
%patch2 -p1
%endif

%build
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"
if [ %{_lib} = lib64 ]; then
  EXTRA_FLAGS="$EXTRA_FLAGS -DLIB_SUFFIX=64"
fi
mkdir build
cd build
cmake .. -DCMAKE_CXXFLAGS="%{optflags}" -DCMAKE_CFLAGS="%{optflags}" $EXTRA_FLAGS -DCMAKE_INSTALL_PREFIX=/usr \
          -DENABLE_TESTS=FALSE -DENABLE_EXAMPLES=FALSE -DENABLE_FARSIGHT=FALSE -DENABLE_FARSTREAM=TRUE -DDISABLE_WERROR=TRUE
make %{?_smp_mflags}

%install
cd build
%make_install
cd ..
%fdupes %{buildroot}

%post -n %{libname}-%{major} -p /sbin/ldconfig

%postun -n %{libname}-%{major} -p /sbin/ldconfig

%if 0%{?farstream}
%post -n %{libname}-farstream%{major} -p /sbin/ldconfig

%postun -n %{libname}-farstream%{major} -p /sbin/ldconfig
%endif

%files -n %{libname}-%{major}
%defattr(-,root,root)
%{_libdir}/libtelepathy-qt4.so.*

%if 0%{?farstream}
%files -n %{libname}-farstream%{major}
%defattr(-,root,root)
%{_libdir}/libtelepathy-qt4-farstream.so.*
%endif

%files devel
%defattr(-,root,root)
%doc AUTHORS ChangeLog README COPYING HACKING NEWS
%{_includedir}/telepathy-qt4/
%{_libdir}/libtelepathy-qt4.so
%{_libdir}/libtelepathy-qt4-service.a
%{_libdir}/pkgconfig/TelepathyQt4.pc
%{_libdir}/cmake/TelepathyQt4/
%{_libdir}/cmake/TelepathyQt4Service/
%{_libdir}/pkgconfig/TelepathyQt4Service.pc
%if 0%{?farstream}
%{_libdir}/cmake/TelepathyQt4Farstream/
%{_libdir}/libtelepathy-qt4-farstream.so
%{_libdir}/pkgconfig/TelepathyQt4Farstream.pc
%endif

%changelog
openSUSE Build Service is sponsored by