File purple-gowhatsapp.spec of Package purple-gowhatsapp
#
# spec file for package purple-gowhatsapp
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define _name gowhatsapp
Name: purple-gowhatsapp
Version: 0.0+git20220925
Release: 0
Summary: WhatsApp protocol plugin for libpurple
License: GPL-2.0-or-later
URL: https://github.com/hoehermann/purple-gowhatsapp
#!CreateArchive: purple-gowhatsapp
Source0: %{name}-%{version}.tar.xz
Source1: vendor.tar.gz
BuildRequires: pkgconfig
BuildRequires: pkgconfig(glib-2.0) >= 2.28.0
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(libmarkdown) >= 3.0.0
BuildRequires: pkgconfig(purple)
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
BuildRequires: pkgconfig(opusfile)
BuildRequires: gcc >= 9.2.0
# BuildRequires: cmake >= 3.8
BuildRequires: make
BuildRequires: go >= 1.22
BuildRequires: golang-packaging
BuildRequires: notmuch-devel
BuildRequires: scdoc
BuildRequires: zstd
Recommends: w3m
%description
A libpurple/Pidgin plugin for WhatsApp.
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.
%package -n libpurple-plugin-%{_name}
Summary: WhatsApp protocol plugin for libpurple
Enhances: libpurple
%description -n libpurple-plugin-%{_name}
WhatsApp protocol plugin for libpurple-based applications.
%package -n pidgin-plugin-%{_name}
Summary: WhatsApp protocol plugin for Pidgin
Requires: libpurple-plugin-%{_name} = %{version}
Supplements: (libpurple-plugin-%{_name} and pidgin)
BuildArch: noarch
%description -n pidgin-plugin-%{_name}
WhatsApp protocol plugin for libpurple-based applications.
This package provides the icon set for Pidgin.
%prep
%setup -q
cd src
tar xf %{SOURCE1}
%build
cd src
cp dummy/libwhatsmeow.h .
export GOPATH="$(mktemp -t -d 'go-build-XXXXXX')"
CGO_CFLAGS="%{optflags} -DPLUGIN_VERSION=$(cat ../VERSION)"
export CGO_CFLAGS="$CGO_CFLAGS $(pkg-config -cflags glib-2.0 purple opusfile gdk-pixbuf-2.0)"
export CGO_LDFLAGS="$(pkg-config --libs glib-2.0 purple opusfile gdk-pixbuf-2.0)"
export GOFLAGS="-v -mod=vendor -buildmode=c-shared"
go build -o libwhatsmeow.so
go build -o libwhatsmeow.so
%install
install -dm0755 libwhatsmeow.so %{buildroot}%{_libdir}/purple-2/libwhatsmeow.so
for size in 16 22 48 64 ; do
install -dm0644 pixmaps/pidgin/protocols/${size}/%{_name}.png \
%{buildroot}%{_datadir}/pixmaps/pidgin/protocols/${size}/%{_name}.png
done
%files -n libpurple-plugin-%{_name}
%license LICENSE
%doc README.md
%{_libdir}/purple-2/libwhatsmeow.so
%files -n pidgin-plugin-%{_name}
%dir %{_datadir}/pixmaps/pidgin/
%dir %{_datadir}/pixmaps/pidgin/protocols/
%dir %{_datadir}/pixmaps/pidgin/protocols/*/
%{_datadir}/pixmaps/pidgin/protocols/*/%{_name}.*
%changelog