File purple-whatsapp.spec of Package purple-whatsapp

#
# spec file for package purple-whatsapp
#
# Copyright (c) 2016 SUSE LINUX 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 _name   whatsapp-purple
Name:           purple-whatsapp
Version:        0.9.0
Release:        0
Summary:        WhatsApp protocol implementation for libpurple (Pidgin)
License:        GPL-2.0+
Group:          Productivity/Networking/Instant Messenger
Url:            https://github.com/davidgfnet/whatsapp-purple
Source:         https://github.com/davidgfnet/whatsapp-purple/archive/v%{version}.tar.gz#/%{_name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE whatsapp-purple-cflags.patch -- Support setting CFLAGS.
Patch0:         whatsapp-purple-cflags.patch
# PATCH-FIX-UPSTREAM whatsapp-purple-libcurve25519-fix-impl-decl.patch -- Fix implicit declarations in libcurve25519.
Patch1:         whatsapp-purple-libcurve25519-fix-impl-decl.patch
BuildRequires:  freeimage-devel
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(purple)

%description
This is a WhatsApp plugin for Pidgin and other libpurple-based
messengers. It connects to the WhatsApp servers using the password
(which needs to be retrieved separately). Only one client can
connect at a time (including your phone).

%package -n libpurple-plugin-whatsapp
Summary:        WhatsApp protocol implementation for libpurple
Group:          Productivity/Networking/Instant Messenger
Enhances:       libpurple
# whatsapp-purple was last used in openSUSE Leap 42.2.
Provides:       %{_name} = %{version}-%{release}
Obsoletes:      %{_name} < %{version}-%{release}

%description -n libpurple-plugin-whatsapp
This is a WhatsApp plugin for Pidgin and other libpurple-based
messengers. It connects to the WhatsApp servers using the password
(which needs to be retrieved separately). Only one client can
connect at a time (including your phone).

%package -n pidgin-plugin-whatsapp
Summary:        WhatsApp protocol implementation for Pidgin
Group:          Productivity/Networking/Instant Messenger
Requires:       libpurple-plugin-whatsapp = %{version}
Supplements:    packageand(libpurple-plugin-whatsapp:pidgin)
BuildArch:      noarch
%requires_ge    pidgin

%description -n pidgin-plugin-whatsapp
This is a WhatsApp plugin for Pidgin and other libpurple-based
messengers. It connects to the WhatsApp servers using the password
(which needs to be retrieved separately). Only one client can
connect at a time (including your phone).

This package provides the icon set for Pidgin.

%prep
%setup -q -n %{_name}-%{version}
%patch0 -p1
%patch1 -p1

%build
make %{?_smp_mflags} V=1 \
  CPPFLAGS="%{optflags}"

%install
%make_install

%files -n libpurple-plugin-whatsapp
%defattr(-,root,root)
%doc README.md
%{_libdir}/purple-2/libwhatsapp.so

%files -n pidgin-plugin-whatsapp
%defattr(-,root,root)
%dir %{_datadir}/pixmaps/pidgin/
%dir %{_datadir}/pixmaps/pidgin/protocols/
%dir %{_datadir}/pixmaps/pidgin/protocols/*/
%{_datadir}/pixmaps/pidgin/protocols/*/whatsapp.*

%changelog