# SPEC file overview:
# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/#con_rpm-spec-file-overview
# Fedora packaging guidelines:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/

%global debug_package %{nil}

Name:    purple-gowhatsapp
Version: 1.6.0
Release: 1.ndias%{?dist}
Summary: A libpurple/Pidgin plugin for WhatsApp

License: GPLv3
URL:     https://github.com/hoehermann/purple-gowhatsapp
Source0: https://github.com/hoehermann/purple-gowhatsapp/archive/refs/tags/v%{version}.tar.gz

BuildRequires: cmake, gcc, libpurple-devel, gdk-pixbuf2-devel, golang-bin, git

%description
This is a re-write of purple-gowhatsapp, switching back-ends from go-whatsapp
to whatsmeow. whatsmeow is written by Tulir Asokan. It has multi-device support.

%prep
%setup -q


%build
mkdir build
cd build
cmake ..
cmake --build .
chmod -R 755 src/go/go/pkg/mod

%install
cd build
make DESTDIR=$RPM_BUILD_ROOT install/strip

%files
%doc CHANGELOG.md README.md
%license LICENSE

%{_libdir}/purple-2/libwhatsmeow.so
%{_datadir}/pixmaps/pidgin/protocols/16/whatsapp.png
%{_datadir}/pixmaps/pidgin/protocols/22/whatsapp.png
%{_datadir}/pixmaps/pidgin/protocols/48/whatsapp.png
%{_datadir}/pixmaps/pidgin/protocols/64/whatsapp.png


%changelog
* Mon Sep 19 2022 Nuno Dias <Nuno.Dias@gmail.com> - 1.6.0-1.ndias
- Version 1.6.0