[packages/gnokii] Rel 10

arekm arekm at pld-linux.org
Sat Aug 22 22:27:29 CEST 2026


commit 92b0a9e1afae5143115612df2d4df838f2b8af55
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Aug 22 22:27:19 2026 +0200

    Rel 10

 gnokii-ical-string-free.patch |  19 ++++++++
 gnokii-libical4.patch         | 107 ++++++++++++++++++++++++++++++++++++++++++
 gnokii.spec                   |  18 +++++--
 3 files changed, 139 insertions(+), 5 deletions(-)
---
diff --git a/gnokii.spec b/gnokii.spec
index 9671ad3..7f68503 100644
--- a/gnokii.spec
+++ b/gnokii.spec
@@ -14,11 +14,11 @@ Summary:	Linux/Unix tool suite for mobile phones
 Summary(pl.UTF-8):	Linuksowy/uniksowy zestaw narzędzi dla telefonów komórkowych
 Name:		gnokii
 Version:	0.6.31
-Release:	9
+Release:	10
 Epoch:		1
 License:	GPL v2+
 Group:		Applications/Communications
-Source0:	http://www.gnokii.org/download/gnokii/%{name}-%{version}.tar.bz2
+Source0:	https://download.samba.org/pub/gnokii/gnokii/%{name}-%{version}.tar.bz2
 # Source0-md5:	d9627f4a1152d3ea7806df4532850d5f
 Source1:	%{name}.desktop
 Source2:	%{name}.png
@@ -29,7 +29,9 @@ Patch1:		no-inline.patch
 Patch2:		%{name}-gcc7.patch
 Patch3:		%{name}-codeset.patch
 Patch4:		%{name}-mysql.patch
-URL:		http://www.gnokii.org/
+Patch5:		%{name}-libical4.patch
+Patch6:		%{name}-ical-string-free.patch
+URL:		https://savannah.nongnu.org/projects/gnokii/
 BuildRequires:	autoconf
 BuildRequires:	automake >= 1:1.8
 %{?with_bluetooth:BuildRequires:	bluez-libs-devel >= 2.8-2}
@@ -46,6 +48,7 @@ BuildRequires:	mysql-devel
 BuildRequires:	pkgconfig
 BuildRequires:	postgresql-devel
 BuildRequires:	rpmbuild(macros) >= 1.268
+BuildRequires:	sqlite3-devel
 BuildRequires:	xorg-lib-libX11-devel
 BuildRequires:	xorg-lib-libXpm-devel
 Requires:	libgnokii = %{epoch}:%{version}-%{release}
@@ -91,9 +94,12 @@ Biblioteka współdzielona gnokii.
 Summary:	libgnokii heades files
 Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki libgnokii
 Group:		Development/Libraries
-Requires:	bluez-libs-devel >= 2.8-2
+%{?with_bluetooth:Requires:	bluez-libs-devel >= 2.8-2}
+Requires:	glib2-devel >= 2.0
+%{?with_ical:Requires:	libical-devel}
 Requires:	libgnokii = %{epoch}:%{version}-%{release}
-Requires:	libusb-compat-devel
+%{?with_usb:Requires:	libusb-compat-devel}
+%{?with_pcsc:Requires:	pcsc-lite-devel}
 Requires:	xorg-lib-libX11-devel
 Requires:	xorg-lib-libXpm-devel
 Obsoletes:	gnokii-devel
@@ -188,6 +194,8 @@ Wtyczka obsługi plików dla gnokii-smsd.
 %patch -P2 -p1
 %patch -P3 -p1
 %patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
 
 %build
 %{__gettextize}
diff --git a/gnokii-ical-string-free.patch b/gnokii-ical-string-free.patch
new file mode 100644
index 0000000..ca4ca86
--- /dev/null
+++ b/gnokii-ical-string-free.patch
@@ -0,0 +1,19 @@
+Fix double free in the DEBUG build: icalcomponent_as_ical_string() returns a
+pointer into libical's temporary buffer ring, which libical frees itself when
+the ring wraps, so gnokii's free() on it aborts the process after enough
+gn_icalstr2calnote() calls. icalcomponent_as_ical_string_r() returns memory
+the caller owns.
+
+--- gnokii-0.6.31/common/vcal.c.orig	2026-08-22 22:09:23.593247373 +0200
++++ gnokii-0.6.31/common/vcal.c	2026-08-22 22:09:23.663169325 +0200
+@@ -564,7 +564,9 @@
+ #ifdef DEBUG
+ 		char *temp;
+ 
+-		temp = icalcomponent_as_ical_string(compresult);
++		/* the non-_r variant hands back libical's ring buffer, which
++		 * libical frees itself once the ring wraps */
++		temp = icalcomponent_as_ical_string_r(compresult);
+ 		dprintf("Component found\n%s\n", temp);
+ 		free(temp);
+ #endif
diff --git a/gnokii-libical4.patch b/gnokii-libical4.patch
new file mode 100644
index 0000000..7e9a725
--- /dev/null
+++ b/gnokii-libical4.patch
@@ -0,0 +1,107 @@
+Build gnokii against libical 4.0, which renamed icalrecurrencetype_from_string
+and icaltime_add and turned icalrecurrencetype into a refcounted heap object
+passed by pointer. Kept compatible with libical 3.x.
+
+--- gnokii-0.6.31/common/vcal.c.orig	2026-08-22 21:57:27.776580707 +0200
++++ gnokii-0.6.31/common/vcal.c	2026-08-22 21:57:45.666147372 +0200
+@@ -44,6 +44,20 @@
+ /* needs gnokii-internal.h for string_base64() and utf8_encode() */
+ #  include "gnokii-internal.h"
+ #  include <libical/ical.h>
++/* libical 4.0 turned icalrecurrencetype into a refcounted heap object and
++ * renamed two of the calls used below. Call sites use the 4.0 spelling. */
++#  if defined(ICAL_MAJOR_VERSION) && ICAL_MAJOR_VERSION >= 4
++typedef struct icalrecurrencetype *gn_icalrecurrencetype;
++#    define GN_RECUR(r)					(r)
++#    define GN_RECUR_VALID(r)				((r) != NULL)
++#  else
++typedef struct icalrecurrencetype gn_icalrecurrencetype;
++#    define GN_RECUR(r)					(&(r))
++#    define GN_RECUR_VALID(r)				(1)
++#    define icalrecurrencetype_new_from_string(s)	icalrecurrencetype_from_string(s)
++#    define icalrecurrencetype_unref(r)			((void)(r))
++#    define icalduration_extend(t, d)			icaltime_add((t), (d))
++#  endif
+ /* mother's little helpers */
+ static int iterate_cal(icalcomponent *parent, int depth, int *count, icalcomponent **result, icalcomponent_kind kind);
+ static const char *comp_get_category(icalcomponent *comp);
+@@ -190,6 +204,7 @@
+ 	icalcomponent_add_property(vevent, icalproperty_new_dtstart(stime));
+ 
+ 	if (calnote->recurrence) {
++		gn_icalrecurrencetype recur;
+ 		char rrule[64];
+ 		char *freq;
+ 		int interval = 1;
+@@ -224,7 +239,12 @@
+ 			snprintf(rrule, sizeof(rrule), "FREQ=%s;INTERVAL=%d", freq, interval);
+ 		else
+ 			snprintf(rrule, sizeof(rrule), "FREQ=%s;COUNT=%d;INTERVAL=%d", freq, calnote->occurrences, interval);
+-		icalcomponent_add_property(vevent, icalproperty_new_rrule(icalrecurrencetype_from_string(rrule)));
++		recur = icalrecurrencetype_new_from_string(rrule);
++		if (GN_RECUR_VALID(recur)) {
++			icalcomponent_add_property(vevent, icalproperty_new_rrule(recur));
++			/* icalproperty_new_rrule() takes its own reference */
++			icalrecurrencetype_unref(recur);
++		}
+ 	}
+ norecurrence:
+ 
+@@ -419,7 +439,8 @@
+ 		const char *str;
+ 		icalcomponent *alarm = {0};
+ 		icalproperty *rrule;
+-		struct icalrecurrencetype recur;
++		gn_icalrecurrencetype recur;
++		const struct icalrecurrencetype *rec;
+ 		retval = GN_ERR_NONE;
+ 
+ 		calnote->phone_number[0] = 0;
+@@ -495,7 +516,7 @@
+ 					}
+ 					if (!(icaldurationtype_is_bad_duration(trigger_value.duration) ||
+ 							icaldurationtype_is_null_duration(trigger_value.duration))) {
+-						alarm_start = icaltime_add(alarm_start, trigger_value.duration);
++						alarm_start = icalduration_extend(alarm_start, trigger_value.duration);
+ 					}
+ 					calnote->alarm.enabled = 1;
+ 					calnote->alarm.timestamp.year = alarm_start.year;
+@@ -515,29 +536,31 @@
+ 		/* recurrence */
+ 		rrule = icalcomponent_get_first_property(compresult, ICAL_RRULE_PROPERTY);
+ 		if (rrule) {
++			/* icalproperty_get_rrule() returns a borrowed reference */
+ 			recur = icalproperty_get_rrule(rrule);
+-			calnote->occurrences = recur.count;
+-			switch (recur.freq) {
++			rec = GN_RECUR(recur);
++			calnote->occurrences = rec->count;
++			switch (rec->freq) {
+ 			case ICAL_SECONDLY_RECURRENCE:
+ 				dprintf("Not supported recurrence type. Approximating recurrence\n");
+-				calnote->recurrence = recur.interval / 3600;
++				calnote->recurrence = rec->interval / 3600;
+ 				if (!calnote->recurrence)
+ 					calnote->recurrence = 1;
+ 				break;
+ 			case ICAL_MINUTELY_RECURRENCE:
+ 				dprintf("Not supported recurrence type. Approximating recurrence\n");
+-				calnote->recurrence = recur.interval / 60;
++				calnote->recurrence = rec->interval / 60;
+ 				if (!calnote->recurrence)
+ 					calnote->recurrence = 1;
+ 				break;
+ 			case ICAL_HOURLY_RECURRENCE:
+-				calnote->recurrence = recur.interval;
++				calnote->recurrence = rec->interval;
+ 				break;
+ 			case ICAL_DAILY_RECURRENCE:
+-				calnote->recurrence = recur.interval * 24;
++				calnote->recurrence = rec->interval * 24;
+ 				break;
+ 			case ICAL_WEEKLY_RECURRENCE:
+-				calnote->recurrence = recur.interval * 24 * 7;
++				calnote->recurrence = rec->interval * 24 * 7;
+ 				break;
+ 			case ICAL_MONTHLY_RECURRENCE:
+ 				calnote->recurrence = GN_CALNOTE_MONTHLY;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gnokii.git/commitdiff/92b0a9e1afae5143115612df2d4df838f2b8af55



More information about the pld-cvs-commit mailing list