File libqtkeychain.spec of Package qtkeychain

#
# spec file for package qtkeychain
#
# Copyright (c) 2012 Klaas Freitag <freitag@owncloud.com>, ownCloud GmbH.
#
# 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, issues or comments via http://github.com/owncloud/mirall/issues
#

%define _soversion 0

%if 0%{?suse_version} == 1110 
%define make_install %{makeinstall}
%endif

%if 0%{?rhel_version} == 600 || 0%{?centos_version} == 600 || 0%{?suse_version} == 1110
# We need a more recent, prefixed Qt for SLE11
%define qtprefix opt-
%define _prefix /opt/qt-4.8
%else
%define qtprefix %{nil}
%endif

Name:           %{qtprefix}libqtkeychain
BuildRequires:  cmake
BuildRequires:  gcc-c++ 

%if 0%{?fedora_version} || 0%{?centos_version} == 700 
BuildRequires:  qt4 qt4-devel >= 4.6
%ifarch i586
BuildRequires:  -centos-release
%endif
%else
BuildRequires:  %{qtprefix}libqt4-devel >= 4.6
%endif

Version:        0.5
Release:        0
Summary:        A cross platform password store library
License:        MIT
Group:          Development/Libraries/C and C++
Url:            https://github.com/frankosterfeld/qtkeychain
Source0:        qtkeychain-%{version}.tar.bz2

%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?suse_version} == 1110
Patch1:         cmake.diff
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
use qtkeychain to store passwords easy and secure on Linux, Windows and
Mac.


%package -n %{name}%{_soversion}
Summary:        A cross platform password store library
Group:          Development/Libraries/C and C++
%if 0%{?fedora_version} > 18
Obsoletes:      qtkeychain
# needed for Fedora 20; installation of owncloud-client fails without the Provides: here.
Provides:       qtkeychain
%endif
Obsoletes:      %{name}%{_soversion} = 0.20140128


%description -n %{name}%{_soversion}
use qtkeychain to store passwords easy and secure on Linux, Windows and
Mac.

%package devel
Summary:        A cross platform password store library
Group:          Development/Libraries/C and C++
AutoReqProv:    on
Requires:       %{qtprefix}libqtkeychain%{_soversion} = %{version}
%if 0%{?fedora_version} > 18
Obsoletes:      qtkeychain-devel
%endif


%description devel
use qtkeychain to store passwords easy and secure on Linux, Windows and
Mac.

This package contains development files for libqtkeychain.

%prep
%setup -q -n qtkeychain-%{version}

%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?suse_version} == 1110
%patch1 -p1
%endif

%build
export LD_LIBRARY_PATH=%_libdir
export PATH=$PATH:%_bindir
mkdir build
pushd build

cmake .. \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_VERBOSE_MAKEFILE=ON \
%ifarch %arm ppc ppc64
    -DWITH_CRASHREPORTER=OFF \
    -DWITH_BREAKPAD=OFF \
%endif
    -DBUILD_RELEASE=ON

%__make %{?jobs:-j%jobs} || %__make -j1
popd

%install
pushd build
%make_install
popd

%post -n %{name}%{_soversion} -p /sbin/ldconfig

%postun -n %{name}%{_soversion} -p /sbin/ldconfig

%files -n %{name}%{_soversion}
%defattr(-,root,root)
%{_libdir}/libqtkeychain.so.*
%{_prefix}/share/qt4/translations/qtkeychain_*.qm
%doc COPYING ReadMe.txt

%files devel
%defattr(-,root,root)
%{_includedir}/qtkeychain
%{_libdir}/cmake
%{_libdir}/libqtkeychain.so

%changelog
openSUSE Build Service is sponsored by