SHA256
1
0
forked from pool/pidgin

Accepting request 584078 from network:pidgin

OBS-URL: https://build.opensuse.org/request/show/584078
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pidgin?expand=0&rev=124
This commit is contained in:
Dominique Leuenberger 2018-03-08 09:42:00 +00:00 committed by Git OBS Bridge
commit b3c9517c64
5 changed files with 167 additions and 359 deletions

View File

@ -0,0 +1,64 @@
Actually make things work in python3.
Author: Jan Synacek <jsynacek@redhat.com>
--- a/libpurple/purple-remote 2015-06-03 09:52:26.324668688 +0200
+++ b/libpurple/purple-remote 2015-06-03 09:55:41.287253981 +0200
@@ -3,13 +3,13 @@
import codecs
import dbus
import re
-import urllib
+import urllib.parse
import sys
import xml.dom.minidom
sys.stdin = codecs.getwriter('utf-8')(sys.stdin);
-sys.stdout = codecs.getwriter('utf-8')(sys.stdout);
+sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach());
xml.dom.minidom.Element.all = xml.dom.minidom.Element.getElementsByTagName
@@ -41,7 +41,7 @@ class CheckedAttribute:
return result
def show_help(requested=False):
- print """This program uses D-Bus to communicate with purple.
+ print("""This program uses D-Bus to communicate with purple.
Usage:
@@ -72,7 +72,7 @@ Examples of commands:
PurpleAccountsFindConnected?name=&protocol=prpl-jabber
PurpleAccountsFindConnected(,prpl-jabber)
-""" % sys.argv[0]
+""" % sys.argv[0])
if (requested):
sys.exit(0)
else:
@@ -120,7 +120,7 @@ def execute(uri):
if paramstring is not None:
for param in paramstring.split("&"):
key, value = extendlist(param.split("=",1), 2, "")
- params[key] = urllib.unquote(value)
+ params[key] = urllib.parse.unquote(value)
accountname = params.get("account", "")
@@ -233,12 +233,12 @@ if len(sys.argv) == 1:
elif (sys.argv[1] == "--help" or sys.argv[1] == "-h"):
show_help(True)
elif (obj == None):
- print "No existing libpurple instance detected."
+ print("No existing libpurple instance detected.")
sys.exit(1);
for arg in sys.argv[1:]:
output = execute(arg)
if (output != None):
- print output
+ print(output)

View File

@ -1,226 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -2222,6 +2222,20 @@ MSN, Yahoo!, Novell Groupwise and Google
fi
dnl #######################################################################
+dnl # Check for gnome-keyring
+dnl #--enable-gnome-keyring=(yes|no)
+dnl #######################################################################
+AC_ARG_ENABLE(gnome-keyring,
+ AC_HELP_STRING([--enable-gnome-keyring],
+ [use gnome keyring for storing password [default=no]]),,
+ enable_gnome_keyring=no)
+if test "x$enable_gnome_keyring" = "xyes"; then
+ PKG_CHECK_MODULES(PURPLE_KEYRING,
+ gnome-keyring-1,
+ AC_DEFINE(PURPLE_ENABLE_KEYRING, [], [Set if we should use gnome-keyring]))
+fi
+
+dnl #######################################################################
dnl # Check for Tcl
dnl #######################################################################
AC_ARG_ENABLE(tcl, [AC_HELP_STRING([--disable-tcl],
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -54,6 +54,16 @@ typedef struct
#define PURPLE_ACCOUNT_GET_PRIVATE(account) \
((PurpleAccountPrivate *) (account->priv))
+#ifdef PURPLE_ENABLE_KEYRING
+#include <gnome-keyring.h>
+
+static char *
+purple_account_get_password_from_keyring(const char *_prpl, const char *_user);
+static gboolean
+purple_account_set_password_in_keyring(const char *_prpl, const char *_user,
+ const char *password);
+#endif
+
/* TODO: Should use PurpleValue instead of this? What about "ui"? */
typedef struct
{
@@ -394,8 +404,13 @@ account_to_xmlnode(PurpleAccount *accoun
if (purple_account_get_remember_password(account) &&
((tmp = purple_account_get_password(account)) != NULL))
{
+#ifdef PURPLE_ENABLE_KEYRING
+ purple_account_set_password_in_keyring(purple_account_get_protocol_id(account),
+ purple_account_get_username(account), tmp);
+#else
child = xmlnode_new_child(node, "password");
xmlnode_insert_data(child, tmp, -1);
+#endif
} else if (_purple_account_is_password_encrypted(account)) {
const char *keyring = NULL;
const char *mode = NULL;
@@ -903,6 +918,7 @@ parse_account(xmlnode *node)
char *protocol_id = NULL;
char *name = NULL;
char *data;
+ gboolean got_pwd = FALSE;
child = xmlnode_get_child(node, "protocol");
if (child != NULL)
@@ -927,36 +943,51 @@ parse_account(xmlnode *node)
}
ret = purple_account_new(name, _purple_oscar_convert(name, protocol_id)); /* XXX: */
+#ifdef PURPLE_ENABLE_KEYRING
+
+ /* Read the password from GNOME Keyring */
+ data = purple_account_get_password_from_keyring(protocol_id, name);
+ if (data)
+ {
+ got_pwd = TRUE;
+ purple_account_set_remember_password(ret, TRUE);
+ purple_account_set_password(ret, data);
+ g_free(data);
+ }
+#endif
g_free(name);
g_free(protocol_id);
/* Read the password */
- child = xmlnode_get_child(node, "password");
- if (child != NULL) {
- const char *keyring_id = xmlnode_get_attrib(child, "keyring_id");
- const char *mode = xmlnode_get_attrib(child, "mode");
- gboolean is_plaintext;
-
- data = xmlnode_get_data(child);
-
- if (keyring_id == NULL || keyring_id[0] == '\0')
- is_plaintext = TRUE;
- else if (g_strcmp0(keyring_id, "keyring-internal") != 0)
- is_plaintext = FALSE;
- else if (mode == NULL || mode[0] == '\0' || g_strcmp0(mode, "cleartext") == 0)
- is_plaintext = TRUE;
- else
- is_plaintext = FALSE;
-
- if (is_plaintext) {
- purple_account_set_remember_password(ret, TRUE);
- purple_account_set_password(ret, data);
- } else {
- purple_debug_warning("account", "found encrypted password, "
- "but it's not supported in 2.x.y\n");
- _purple_account_set_encrypted_password(ret, keyring_id, mode, data);
+ if (!got_pwd)
+ {
+ child = xmlnode_get_child(node, "password");
+ if (child != NULL) {
+ const char *keyring_id = xmlnode_get_attrib(child, "keyring_id");
+ const char *mode = xmlnode_get_attrib(child, "mode");
+ gboolean is_plaintext;
+
+ data = xmlnode_get_data(child);
+
+ if (keyring_id == NULL || keyring_id[0] == '\0')
+ is_plaintext = TRUE;
+ else if (g_strcmp0(keyring_id, "keyring-internal") != 0)
+ is_plaintext = FALSE;
+ else if (mode == NULL || mode[0] == '\0' || g_strcmp0(mode, "cleartext") == 0)
+ is_plaintext = TRUE;
+ else
+ is_plaintext = FALSE;
+
+ if (is_plaintext) {
+ purple_account_set_remember_password(ret, TRUE);
+ purple_account_set_password(ret, data);
+ } else {
+ purple_debug_warning("account", "found encrypted password, "
+ "but it's not supported in 2.x.y\n");
+ _purple_account_set_encrypted_password(ret, keyring_id, mode, data);
+ }
+ g_free(data);
}
- g_free(data);
}
/* Read the alias */
@@ -3375,6 +3406,64 @@ purple_accounts_uninit(void)
purple_signals_unregister_by_instance(handle);
}
+#ifdef PURPLE_ENABLE_KEYRING
+static char *
+purple_account_get_password_from_keyring(const char *_prpl, const char *_user)
+{
+ GnomeKeyringNetworkPasswordData *found_item;
+ GnomeKeyringResult result;
+ GList *matches;
+ char *password;
+
+ matches = NULL;
+
+ result = gnome_keyring_find_network_password_sync(
+ _user, /* user */
+ NULL, /* domain */
+ "gaim.local", /* server */
+ NULL, /* object */
+ _prpl, /* protocol */
+ NULL, /* authtype */
+ 1863, /* port */
+ &matches);
+
+ if (result != GNOME_KEYRING_RESULT_OK)
+ return NULL;
+
+ g_assert(matches != NULL && matches->data != NULL);
+
+ found_item = (GnomeKeyringNetworkPasswordData *) matches->data;
+
+ password = g_strdup(found_item->password);
+
+ gnome_keyring_network_password_list_free(matches);
+
+ return password;
+}
+
+static gboolean
+purple_account_set_password_in_keyring(const char *_prpl, const char *_user,
+ const char *_password)
+{
+ GnomeKeyringResult result;
+ guint32 item_id;
+
+ result = gnome_keyring_set_network_password_sync(
+ NULL, /* default keyring */
+ _user, /* user */
+ NULL, /* domain */
+ "gaim.local", /* server */
+ NULL, /* object */
+ _prpl, /* protocol */
+ NULL, /* authtype */
+ 1863, /* port */
+ _password, /* password */
+ &item_id);
+
+ return (result == GNOME_KEYRING_RESULT_OK);
+}
+#endif
+
/* libpurple 3.0.0 compatibility */
static void
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -309,6 +309,7 @@ libpurple_la_LIBADD = \
$(GLIB_LIBS) \
$(LIBXML_LIBS) \
$(NETWORKMANAGER_LIBS) \
+ $(PURPLE_KEYRING_LIBS) \
$(INTLLIBS) \
$(FARSTREAM_LIBS) \
$(GSTREAMER_LIBS) \
@@ -334,7 +335,8 @@ AM_CPPFLAGS = \
$(GSTAPP_CFLAGS) \
$(GSTINTERFACES_CFLAGS) \
$(IDN_CFLAGS) \
- $(NETWORKMANAGER_CFLAGS)
+ $(NETWORKMANAGER_CFLAGS) \
+ $(PURPLE_KEYRING_CFLAGS)
# INSTALL_SSL_CERTIFICATES is true when SSL_CERTIFICATES_DIR is empty.
# We want to use SSL_CERTIFICATES_DIR when it's not empty.

View File

@ -1,7 +1,7 @@
Index: pidgin-2.10.11/finch/libgnt/gntwm.c
Index: pidgin-2.12.0/finch/libgnt/gntwm.c
===================================================================
--- pidgin-2.10.11.orig/finch/libgnt/gntwm.c
+++ pidgin-2.10.11/finch/libgnt/gntwm.c
--- pidgin-2.12.0.orig/finch/libgnt/gntwm.c
+++ pidgin-2.12.0/finch/libgnt/gntwm.c
@@ -174,37 +174,37 @@ work_around_for_ncurses_bug(void)
cchar_t ch;
PANEL *below = panel;
@ -10,26 +10,26 @@ Index: pidgin-2.10.11/finch/libgnt/gntwm.c
- ex = panel->win->_maxx + sx;
- sy = panel->win->_begy;
- ey = panel->win->_maxy + sy;
+ sx = getbegx(panel->win);
+ ex = getmaxx(panel->win) + sx;
+ sy = getbegy(panel->win);
+ ey = getmaxy(panel->win) + sy;
+ sx = getbegx(panel_window(panel));
+ ex = getmaxx(panel_window(panel)) + sx;
+ sy = getbegy(panel_window(panel));
+ ey = getmaxy(panel_window(panel)) + sy;
while ((below = panel_below(below)) != NULL) {
- if (sy > below->win->_begy + below->win->_maxy ||
- ey < below->win->_begy)
+ if (sy > getbegy(below->win) + getmaxy(below->win) ||
+ ey < getbegy(below->win))
+ if (sy > getbegy(panel_window(below)) + getmaxy(panel_window(below)) ||
+ ey < getbegy(panel_window(below)))
continue;
- if (sx > below->win->_begx + below->win->_maxx ||
- ex < below->win->_begx)
+ if (sx > getbegx(below->win) + getmaxx(below->win) ||
+ ex < getbegx(below->win))
+ if (sx > getbegx(panel_window(below)) + getmaxx(panel_window(below)) ||
+ ex < getbegx(panel_window(below)))
continue;
- for (y = MAX(sy, below->win->_begy); y <= MIN(ey, below->win->_begy + below->win->_maxy); y++) {
- if (mvwin_wch(below->win, y - below->win->_begy, sx - 1 - below->win->_begx, &ch) != OK)
+ for (y = MAX(sy, getbegy(below->win)); y <= MIN(ey, getbegy(below->win) + getmaxy(below->win)); y++) {
+ if (mvwin_wch(below->win, y - getbegy(below->win), sx - 1 - getbegx(below->win), &ch) != OK)
+ for (y = MAX(sy, getbegy(panel_window(below))); y <= MIN(ey, getbegy(panel_window(below)) + getmaxy(panel_window(below))); y++) {
+ if (mvwin_wch(panel_window(below), y - getbegy(panel_window(below)), sx - 1 - getbegx(panel_window(below)), &ch) != OK)
goto right;
w = widestringwidth(ch.chars);
if (w > 1 && (ch.attr & 1)) {
@ -37,12 +37,12 @@ Index: pidgin-2.10.11/finch/libgnt/gntwm.c
ch.attr &= ~ A_CHARTEXT;
- mvwadd_wch(below->win, y - below->win->_begy, sx - 1 - below->win->_begx, &ch);
- touchline(below->win, y - below->win->_begy, 1);
+ mvwadd_wch(below->win, y - getbegy(below->win), sx - 1 - getbegx(below->win), &ch);
+ touchline(below->win, y - getbegy(below->win), 1);
+ mvwadd_wch(panel_window(below), y - getbegy(panel_window(below)), sx - 1 - getbegx(panel_window(below)), &ch);
+ touchline(panel_window(below), y - getbegy(panel_window(below)), 1);
}
right:
- if (mvwin_wch(below->win, y - below->win->_begy, ex + 1 - below->win->_begx, &ch) != OK)
+ if (mvwin_wch(below->win, y - getbegy(below->win), ex + 1 - getbegx(below->win), &ch) != OK)
+ if (mvwin_wch(panel_window(below), y - getbegy(panel_window(below)), ex + 1 - getbegx(panel_window(below)), &ch) != OK)
continue;
w = widestringwidth(ch.chars);
if (w > 1 && !(ch.attr & 1)) {
@ -50,8 +50,8 @@ Index: pidgin-2.10.11/finch/libgnt/gntwm.c
ch.attr &= ~ A_CHARTEXT;
- mvwadd_wch(below->win, y - below->win->_begy, ex + 1 - below->win->_begx, &ch);
- touchline(below->win, y - below->win->_begy, 1);
+ mvwadd_wch(below->win, y - getbegy(below->win), ex + 1 - getbegx(below->win), &ch);
+ touchline(below->win, y - getbegy(below->win), 1);
+ mvwadd_wch(panel_window(below), y - getbegy(panel_window(below)), ex + 1 - getbegx(panel_window(below)), &ch);
+ touchline(panel_window(below), y - getbegy(panel_window(below)), 1);
}
}
}

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Tue Mar 6 21:35:58 UTC 2018 - mgorse@suse.com
- Add pidgin-2.10.11-purple-remote-python3.patch: port
purple-remote to python 3 (bsc#1084147).
- Export PYTHON=python3 in %build.
- Adjust scripts to invoke python3, not python2.
-------------------------------------------------------------------
Tue Mar 6 20:12:39 UTC 2018 - sor.alexei@meowr.ru
- Drop support for SLE 11 and openSUSE older than 42.x.
- Remove pidgin-gnome-keyring.patch: was only useful for SLE 11.
-------------------------------------------------------------------
Tue Mar 6 15:52:11 UTC 2018 - dimstar@opensuse.org
- Update pidgin-ncurses-6.0-accessors.patch to cope with ncurses
enabling opaque-panels. Pidgin should not access internal
structures of ncurses.
-------------------------------------------------------------------
Sat Dec 29 14:06:45 UTC 2017 - sor.alexei@meowr.ru

View File

@ -1,7 +1,7 @@
#
# spec file for package pidgin
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 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
@ -21,7 +21,7 @@ Name: pidgin
Version: 2.12.0
Release: 0
Summary: Multiprotocol Instant Messaging Client
License: GPL-2.0
License: GPL-2.0-only
Group: Productivity/Networking/Instant Messenger
Url: https://pidgin.im/
Source: http://downloads.sf.net/%{name}/%{name}-%{version}.tar.bz2
@ -32,85 +32,64 @@ Source3: pidgin-prefs.xml
Patch0: pidgin-nonblock-common.patch
# PATCH-FIX-OPENSUSE pidgin-nonblock-gwim.patch
Patch1: pidgin-nonblock-gwim.patch
# PATCH-FEATURE-SLE pidgin-gnome-keyring.patch
Patch2: pidgin-gnome-keyring.patch
# PATCH-FIX-OPENSUSE pidgin-fix-perl-build.patch vuntz@opensuse.org -- Revert https://bitbucket.org/pidgin/main/commits/a083625 as it breaks the build.
Patch3: pidgin-fix-perl-build.patch
Patch2: pidgin-fix-perl-build.patch
# PATCH-FIX-UPSTREAM pidgin-ncurses-6.0-accessors.patch pidgin.im#16764 dimstar@opensuse.org -- Fix build with NCurses 6.0 with WINDOW_OPAQUE set to 1.
Patch4: pidgin-ncurses-6.0-accessors.patch
Patch3: pidgin-ncurses-6.0-accessors.patch
# PATCH-FIX-UPSTREAM pidgin-2.10.11-purple-remote-python3.patch bsc#1084147 mgorse@suse.com -- Port purple=-remote to Python 3.
Patch4: pidgin-2.10.11-purple-remote-python3.patch
# PATCH-FIX-SLE pidgin-use-default-alsa.patch bsc#886670 tiwai@suse.de -- Use ALSA as a default for avoiding broken volume control.
Patch5: pidgin-use-default-alsa.patch
BuildRequires: NetworkManager-devel
# Can use external libzephyr.
BuildRequires: cyrus-sasl-devel
BuildRequires: dbus-1-devel
BuildRequires: dbus-1-glib-devel
BuildRequires: ca-certificates-mozilla
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: graphviz
BuildRequires: gtk-doc
BuildRequires: gtkspell-devel
BuildRequires: intltool
BuildRequires: libavahi-glib-devel
BuildRequires: libgadu-devel
BuildRequires: libgnutls-devel
BuildRequires: libidn-devel
BuildRequires: libnotify-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: libxslt
BuildRequires: meanwhile-devel
BuildRequires: mozilla-nspr-devel
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
BuildRequires: startup-notification-devel
BuildRequires: tk-devel
BuildRequires: update-desktop-files
Requires: perl-base >= %{perl_version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1120
BuildRequires: translation-update-upstream
%else
# gnome-keyring support summary (boo#566286):
# 11.1 & SLE11: patch present and active (boo#569025)
# 11.2 and above: patch not applied
# For openSUSE, it's better to avoid this patch:
# + does not work well outside GNOME
# - passwords are stored in readable form
BuildRequires: gnome-keyring-devel
Recommends: %{name}-emoticons-nld
Recommends: %{name}-emoticons-tango
%endif
%if 0%{?suse_version} > 1210
BuildRequires: libSM-devel
BuildRequires: libX11-devel
BuildRequires: libXScrnSaver-devel
BuildRequires: libXext-devel
BuildRequires: mozilla-nss-devel
%endif
%if 0%{?suse_version} >= 1230
BuildRequires: ca-certificates-mozilla
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(NetworkManager)
BuildRequires: pkgconfig(avahi-glib)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(gtkspell-2.0)
BuildRequires: pkgconfig(libgadu)
BuildRequires: pkgconfig(libidn)
BuildRequires: pkgconfig(libnotify)
# Can use external libzephyr.
BuildRequires: pkgconfig(libsasl2)
BuildRequires: pkgconfig(libstartup-notification-1.0)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(meanwhile)
BuildRequires: pkgconfig(nspr)
BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(tk)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xscrnsaver)
Requires: ca-certificates-mozilla
%else
BuildRequires: openssl-certs
Requires: openssl-certs
%endif
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
BuildRequires: farstream-devel >= 0.2.7
BuildRequires: gstreamer-devel
BuildRequires: gstreamer-plugins-base-devel
Requires: perl-base >= %{perl_version}
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 120200 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
BuildRequires: pkgconfig(farstream-0.2) >= 0.2.7
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-app-1.0)
BuildRequires: pkgconfig(gstreamer-video-1.0)
Recommends: gstreamer-plugins-good
%else
BuildRequires: gstreamer-0_10-devel
BuildRequires: gstreamer-0_10-plugins-base-devel
BuildRequires: pkgconfig(gstreamer-0.10)
BuildRequires: pkgconfig(gstreamer-interfaces-0.10)
Recommends: gstreamer-0_10-plugins-good
%endif
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120300
BuildRequires: python2-devel
%else
BuildRequires: python-devel
%endif
%if 0%{?suse_version} >= 1500 && !0%{?is_opensuse}
Recommends: purple-import-empathy
%endif
@ -128,9 +107,9 @@ support many more with plugins.
Summary: Development Headers, Documentation, and Libraries for Pidgin
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: glib2-devel
Requires: gtk2-devel
Requires: libpurple-devel = %{version}
Requires: pkgconfig(glib-2.0)
Requires: pkgconfig(gtk+-2.0)
%description devel
The pidgin-devel package contains the header files, developer
@ -139,19 +118,19 @@ and plugins.
%package -n libpurple
Summary: GLib-based Instant Messenger Library
# Not really required, but standard XMPP accounts require it, if compiled with SASL support.
Group: System/Libraries
Requires: ca-certificates-mozilla
# Not really required, but standard XMPP accounts require it, if compiled with SASL support.
Requires: cyrus-sasl-digestmd5
Requires: cyrus-sasl-plain
# Needed for purple-url-handler.
Requires: dbus-1-python
Requires: libpurple-branding
Requires: perl >= %{perl_version}
Recommends: libpurple-lang
%if 0%{?suse_version} >= 1230
Requires: ca-certificates-mozilla
# Needed for purple-url-handler.
%if 0%{?suse_version} >= 1500
Requires: python3-dbus-python
%else
Requires: openssl-certs
Requires: dbus-1-python3
%endif
%description -n libpurple
@ -172,9 +151,7 @@ Requires: libpurple = %{version}
Supplements: packageand(libpurple:branding-upstream)
Conflicts: otherproviders(libpurple-branding)
Provides: libpurple-branding = %{version}
%if 0%{?suse_version} >= 1210
BuildArch: noarch
%endif
#BRAND: Provides /etc/purple/prefs.xml, the default configuration for
#BRAND: libpurple, and libpurple-based clients.
@ -192,11 +169,10 @@ This package provides the upstream default configuration for Pidgin.
%package -n libpurple-devel
Summary: Development Headers, Documentation, and Libraries for libpurple
Group: Development/Libraries/C and C++
Requires: NetworkManager-devel
Requires: NetworkManager-glib
Requires: glib2-devel
Requires: libpurple = %{version}
Requires: libxml2-devel
Requires: pkgconfig(NetworkManager)
Requires: pkgconfig(glib-2.0)
Requires: pkgconfig(libxml-2.0)
%description -n libpurple-devel
The libpurple-devel package contains the header files, developer
@ -219,8 +195,8 @@ Summary: Sametime Plugin for Pidgin using the Meanwhile Library
Group: Productivity/Networking/Instant Messenger
Requires: libpurple = %{version}
# libpurple-meanwhile was last used in openSUSE Leap 42.2.
Provides: libpurple-meanwhile = %{version}-%{release}
Obsoletes: libpurple-meanwhile < %{version}-%{release}
Provides: libpurple-meanwhile = %{version}
Obsoletes: libpurple-meanwhile < %{version}
%description -n libpurple-plugin-sametime
IBM Sametime plugin for Pidgin using the Meanwhile library.
@ -240,10 +216,10 @@ and text.
Summary: Headers etc. for finch Stuffs
Group: Development/Libraries/C and C++
Requires: finch = %{version}
Requires: glib2-devel
Requires: glibc-devel
Requires: libpurple-devel = %{version}
Requires: ncurses-devel
Requires: pkgconfig(glib-2.0)
%description -n finch-devel
The finch-devel package contains the header files, developer
@ -252,9 +228,7 @@ scripts and plugins.
%prep
%setup -q
%if 0%{?suse_version} >= 1120
translation-update-upstream
%endif
%patch0 -p1
%patch1 -p1
%patch2 -p1
@ -271,13 +245,14 @@ mv po/my_MM.po po/my.po
sed -i "/ALL_LINGUAS/s/ my_MM / my /" configure.ac
# Do not use env for python sripts.
sed -i '/^#!/s|env python$|python2|' libpurple/purple-*
sed -i '/^#!/s|env python$|python3|' libpurple/purple-*
%build
export CFLAGS="%{optflags} -fstack-protector -fPIC"
export CXXFLAGS="%{optflags} -fstack-protector -fPIC"
export FFLAGS="%{optflags} -fstack-protector -fPIC"
export LDFLAGS="-pie"
export PYTHON=python3
autoreconf -fi
%configure \
--disable-static \
@ -285,15 +260,12 @@ autoreconf -fi
--enable-cyrus-sasl \
--enable-dbus \
--enable-gstreamer \
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 120200
--with-gstreamer=1.0 \
--enable-vv \
%else
--with-gstreamer=0.10 \
--disable-vv \
%endif
%if 0%{?suse_version} < 1120
--enable-gnome-keyring \
%endif
--enable-nm \
--enable-dbus \
@ -306,10 +278,6 @@ make %{?_smp_mflags} V=1
%install
%make_install
%if 0%{?suse_version} <= 1140
mkdir -p %{buildroot}%{_sysconfdir}/purple/
rm -f %{buildroot}%{_sysconfdir}/gconf/schemas/purple.schemas
%endif
install -Dpm 0644 %{name}-prefs.xml %{buildroot}%{_sysconfdir}/purple/prefs.xml
%perl_process_packlist
@ -329,7 +297,7 @@ done
%suse_update_desktop_file -N %{_name} -G "Instant Messenger" %{name}
%find_lang %{name} %{?no_lang_C}
%if 0%{?suse_version} > 1130 && 0%{?suse_version} <= 1320
%if 0%{?suse_version} < 1500
%post
%desktop_database_post
%icon_theme_cache_post
@ -348,8 +316,12 @@ done
%postun -n finch -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS COPYING COPYRIGHT ChangeLog README doc/the_penguin.txt
%if 0%{?suse_version} >= 1500
%license COPYING
%else
%doc COPYING
%endif
%doc AUTHORS COPYRIGHT ChangeLog README doc/the_penguin.txt
%{_bindir}/%{name}
%{_libdir}/%{name}/
%{_datadir}/sounds/purple/
@ -361,13 +333,11 @@ done
%{_mandir}/man1/%{name}.1%{?ext_man}
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/man3/%{_name}.3*%{?ext_man}
%files -n libpurple
%defattr(-,root,root)
%dir %{_sysconfdir}/purple/
%{_bindir}/purple-client-example
%{_bindir}/purple-remote
@ -381,36 +351,17 @@ done
%exclude %{_libdir}/purple-2/tcl.so
%files -n libpurple-lang -f %{name}.lang
%defattr(-,root,root)
%if 0%{?suse_version} < 1140
# These locales are not included in respective products.
# See https://bugzilla.opensuse.org/show_bug.cgi?id=659001
%dir %{_datadir}/locale/brx/
%dir %{_datadir}/locale/brx/LC_MESSAGES/
%dir %{_datadir}/locale/ku_IQ/
%dir %{_datadir}/locale/ku_IQ/LC_MESSAGES/
%dir %{_datadir}/locale/mhr/
%dir %{_datadir}/locale/mhr/LC_MESSAGES/
%dir %{_datadir}/locale/ms_MY/
%dir %{_datadir}/locale/ms_MY/LC_MESSAGES/
%dir %{_datadir}/locale/sd/
%dir %{_datadir}/locale/sd/LC_MESSAGES/
%endif
%files -n libpurple-branding-upstream
%defattr(-,root,root)
%config %{_sysconfdir}/purple/prefs.xml
%files -n libpurple-tcl
%defattr(-,root,root)
%{_libdir}/purple-2/tcl.so
%files -n libpurple-plugin-sametime
%defattr(-,root,root)
%{_libdir}/purple-2/libsametime.so
%files -n libpurple-devel
%defattr(-,root,root)
%doc ChangeLog.API HACKING PLUGIN_HOWTO
%doc libpurple/purple-notifications-example
%{_includedir}/libpurple/
@ -421,7 +372,6 @@ done
%{_mandir}/man3/Purple.3*
%files -n finch
%defattr(-,root,root)
%{_bindir}/finch
%{_libdir}/finch/
%{_libdir}/libgnt.so.*
@ -430,7 +380,6 @@ done
%{_mandir}/man1/finch.1*
%files -n finch-devel
%defattr(-,root,root)
%{_includedir}/finch/
%{_includedir}/gnt/
%{_libdir}/libgnt.so