Update to 3.0.0
This commit is contained in:
parent
ab5f0693ea
commit
e3ca4fd3b3
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
/libical-1.0.tar.gz
|
||||
/libical-1.0.1.tar.gz
|
||||
/libical-2.0.0.tar.gz
|
||||
/libical-3.0.0.tar.gz
|
||||
|
@ -1,23 +0,0 @@
|
||||
diff -up libical-2.0.0/src/libical/icalrecur.c.arm libical-2.0.0/src/libical/icalrecur.c
|
||||
--- libical-2.0.0/src/libical/icalrecur.c.arm 2016-01-18 15:37:30.117898162 +0100
|
||||
+++ libical-2.0.0/src/libical/icalrecur.c 2016-01-18 15:37:36.730897882 +0100
|
||||
@@ -491,8 +491,8 @@ static int icalrecur_add_bydayrules(stru
|
||||
|
||||
while (n != 0) {
|
||||
int sign = 1;
|
||||
- char weekno; /* note: Novell/Groupwise sends BYDAY=255SU,
|
||||
- so we fit in a signed char to get -1 SU for last Sun */
|
||||
+ signed char weekno; /* note: Novell/Groupwise sends BYDAY=255SU,
|
||||
+ so we fit in a signed char to get -1 SU for last Sun */
|
||||
icalrecurrencetype_weekday wd;
|
||||
|
||||
if (i == ICAL_BY_DAY_SIZE) {
|
||||
@@ -510,7 +510,7 @@ static int icalrecur_add_bydayrules(stru
|
||||
}
|
||||
|
||||
/* Get Optional weekno */
|
||||
- weekno = (char)strtol(t, &t, 10);
|
||||
+ weekno = (signed char)strtol(t, &t, 10);
|
||||
if (weekno < 0) {
|
||||
weekno = -weekno;
|
||||
sign = -1;
|
@ -1,11 +0,0 @@
|
||||
diff -up libical-2.0.0/src/libical/icallangbind.h.funcnamefix libical-2.0.0/src/libical/icallangbind.h
|
||||
--- libical-2.0.0/src/libical/icallangbind.h.funcnamefix 2016-01-18 17:38:21.642590895 +0100
|
||||
+++ libical-2.0.0/src/libical/icallangbind.h 2016-01-18 17:38:32.424590438 +0100
|
||||
@@ -63,6 +63,6 @@ LIBICAL_ICAL_EXPORT int icallangbind_str
|
||||
|
||||
LIBICAL_ICAL_EXPORT const char *icallangbind_quote_as_ical(const char *str);
|
||||
|
||||
-LIBICAL_ICAL_EXPORT char *callangbind_quote_as_ical_r(const char *str);
|
||||
+LIBICAL_ICAL_EXPORT char *icallangbind_quote_as_ical_r(const char *str);
|
||||
|
||||
#endif
|
@ -1,210 +0,0 @@
|
||||
diff -up libical-2.0.0/src/libical/icalrecur.c.rscale libical-2.0.0/src/libical/icalrecur.c
|
||||
--- libical-2.0.0/src/libical/icalrecur.c.rscale 2016-02-11 13:27:37.626579781 +0100
|
||||
+++ libical-2.0.0/src/libical/icalrecur.c 2016-02-11 14:49:56.751367100 +0100
|
||||
@@ -134,6 +134,7 @@
|
||||
#endif
|
||||
|
||||
#include "icalrecur.h"
|
||||
+#include "icalarray.h"
|
||||
#include "icalerror.h"
|
||||
#include "icalmemory.h"
|
||||
#include "icaltimezone.h"
|
||||
@@ -186,6 +187,139 @@
|
||||
|
||||
#define LEAP_MONTH 0x1000
|
||||
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+#include <pthread.h>
|
||||
+static pthread_mutex_t rscale_texts_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
+#endif
|
||||
+
|
||||
+static icalarray *rscale_texts = NULL;
|
||||
+
|
||||
+static void initialize_rscale_texts(void)
|
||||
+{
|
||||
+#if defined(HAVE_LIBICU)
|
||||
+ UErrorCode status = U_ZERO_ERROR;
|
||||
+ UEnumeration *en;
|
||||
+ const char *cal;
|
||||
+#endif
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_lock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+
|
||||
+ if (rscale_texts != NULL) {
|
||||
+ #if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_unlock(&rscale_texts_mutex);
|
||||
+ #endif
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ rscale_texts = icalarray_new(sizeof(char **), 20);
|
||||
+
|
||||
+#if defined(HAVE_LIBICU)
|
||||
+ en = ucal_getKeywordValuesForLocale("calendar", NULL, FALSE, &status);
|
||||
+ while ((cal = uenum_next(en, NULL, &status))) {
|
||||
+ char *copy = icalmemory_strdup(cal);
|
||||
+ icalarray_append(rscale_texts, ©);
|
||||
+ }
|
||||
+ uenum_close(en);
|
||||
+#endif
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_unlock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+static const char *match_rscale_text(const char *text)
|
||||
+{
|
||||
+ size_t ii;
|
||||
+ const char *res = NULL;
|
||||
+
|
||||
+ if(!text) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ initialize_rscale_texts();
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_lock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+
|
||||
+ for(ii = 0; rscale_texts && ii < rscale_texts->num_elements; ii++) {
|
||||
+ const char **stored, *p1, *p2;
|
||||
+
|
||||
+ stored = icalarray_element_at(rscale_texts, ii);
|
||||
+ if(!stored || !*stored)
|
||||
+ continue;
|
||||
+
|
||||
+ for(p1 = *stored, p2 = text; *p1 && *p2; p1++, p2++) {
|
||||
+ if (tolower(*p1) != tolower(*p2))
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if(!*p1 && !*p2) {
|
||||
+ res = *stored;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_unlock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+static const char *match_or_add_rscale_text(const char *text)
|
||||
+{
|
||||
+ const char *res;
|
||||
+
|
||||
+ if(!text) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ res = match_rscale_text (text);
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_lock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+
|
||||
+ if(!res && rscale_texts) {
|
||||
+ res = icalmemory_strdup(text);
|
||||
+ icalarray_append(rscale_texts, &res);
|
||||
+ }
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_unlock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+void icalrecur_free_rscale_texts(void)
|
||||
+{
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_lock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+
|
||||
+ if(rscale_texts) {
|
||||
+ size_t ii;
|
||||
+ for(ii = 0; rscale_texts && ii < rscale_texts->num_elements; ii++) {
|
||||
+ char **stored;
|
||||
+
|
||||
+ stored = icalarray_element_at(rscale_texts, ii);
|
||||
+ if(stored && *stored)
|
||||
+ icalmemory_free_buffer(*stored);
|
||||
+ }
|
||||
+
|
||||
+ icalarray_free(rscale_texts);
|
||||
+ rscale_texts = NULL;
|
||||
+ }
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD)
|
||||
+ pthread_mutex_unlock(&rscale_texts_mutex);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
int icalrecurrencetype_rscale_is_supported(void)
|
||||
{
|
||||
return RSCALE_IS_SUPPORTED;
|
||||
@@ -585,7 +719,7 @@ struct icalrecurrencetype icalrecurrence
|
||||
if (parser.rt.freq == ICAL_NO_RECURRENCE) r = -1;
|
||||
} else if (icalrecurrencetype_rscale_is_supported() &&
|
||||
strcasecmp(name, "RSCALE") == 0) {
|
||||
- parser.rt.rscale = icalmemory_tmp_copy(value);
|
||||
+ parser.rt.rscale = match_or_add_rscale_text(value);
|
||||
} else if (icalrecurrencetype_rscale_is_supported() &&
|
||||
strcasecmp(name, "SKIP") == 0) {
|
||||
parser.rt.skip = icalrecur_string_to_skip(value);
|
||||
@@ -1359,19 +1493,16 @@ static int initialize_iterator(icalrecur
|
||||
impl->greg = NULL;
|
||||
} else {
|
||||
UEnumeration *en;
|
||||
- const char *cal;
|
||||
- char *r;
|
||||
+ const char *cal, *rrscale;
|
||||
|
||||
- /* Lowercase the specified calendar */
|
||||
- for (r = rule.rscale; *r; r++) {
|
||||
- *r = tolower((int)*r);
|
||||
- }
|
||||
+ /* This can be a user-created string, thus not a one from the pool */
|
||||
+ rrscale = match_or_add_rscale_text (rule.rscale);
|
||||
|
||||
/* Check if specified calendar is supported */
|
||||
en = ucal_getKeywordValuesForLocale("calendar", NULL, FALSE, &status);
|
||||
while ((cal = uenum_next(en, NULL, &status))) {
|
||||
- if (!strcmp(cal, rule.rscale)) {
|
||||
- is_hebrew = !strcmp(rule.rscale, "hebrew");
|
||||
+ if (rrscale == match_rscale_text(cal)) {
|
||||
+ is_hebrew = rrscale == match_rscale_text("hebrew");
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff -up libical-2.0.0/src/libical/icalrecur.h.rscale libical-2.0.0/src/libical/icalrecur.h
|
||||
--- libical-2.0.0/src/libical/icalrecur.h.rscale 2016-02-11 14:08:38.754473804 +0100
|
||||
+++ libical-2.0.0/src/libical/icalrecur.h 2016-02-11 14:51:58.542361856 +0100
|
||||
@@ -181,7 +181,7 @@ struct icalrecurrencetype
|
||||
short by_set_pos[ICAL_BY_SETPOS_SIZE];
|
||||
|
||||
/* For RSCALE extension (RFC 7529) */
|
||||
- char *rscale;
|
||||
+ const char *rscale;
|
||||
icalrecurrencetype_skip skip;
|
||||
};
|
||||
|
||||
@@ -191,6 +191,12 @@ LIBICAL_ICAL_EXPORT icalarray *icalrecur
|
||||
|
||||
LIBICAL_ICAL_EXPORT void icalrecurrencetype_clear(struct icalrecurrencetype *r);
|
||||
|
||||
+/* Frees pool of calendar names used by icalrecurrencetype::rscale.
|
||||
+ * Do not call if anything else can use it (like components or other
|
||||
+ * icalrecurrencetype structures).
|
||||
+ */
|
||||
+LIBICAL_ICAL_EXPORT void icalrecur_free_rscale_texts(void);
|
||||
+
|
||||
/**
|
||||
* Array Encoding
|
||||
*
|
85
libical.spec
85
libical.spec
@ -1,19 +1,28 @@
|
||||
Summary: Reference implementation of the iCalendar data type and serialization format
|
||||
Name: libical
|
||||
Version: 2.0.0
|
||||
Release: 12%{?dist}
|
||||
License: LGPLv2 or MPLv1.1
|
||||
Version: 3.0.0
|
||||
Release: 1%{?dist}
|
||||
License: LGPLv2.1 or MPLv2.0
|
||||
URL: http://freeassociation.sourceforge.net/
|
||||
Source: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
Patch0: libical-2.0.0-arm.patch
|
||||
Patch1: libical-2.0.0-funcnamefix.patch
|
||||
Patch2: libical-2.0.0-rscale-use-after-free.patch
|
||||
|
||||
Provides: libical-glib = %{version}
|
||||
Obsoletes: libical-glib < 3.0.0
|
||||
|
||||
BuildRequires: bison, byacc, flex
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gtk-doc
|
||||
BuildRequires: pkgconfig(gobject-2.0)
|
||||
BuildRequires: pkgconfig(gobject-introspection-1.0)
|
||||
BuildRequires: pkgconfig(libxml-2.0)
|
||||
BuildRequires: pkgconfig(icu-i18n)
|
||||
BuildRequires: pkgconfig(icu-uc)
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: python3
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-gobject
|
||||
BuildRequires: vala
|
||||
BuildRequires: vala-tools
|
||||
Requires: tzdata
|
||||
|
||||
%description
|
||||
@ -27,14 +36,37 @@ Requires: pkgconfig(icu-i18n)
|
||||
Requires: pkgconfig(icu-uc)
|
||||
|
||||
%description devel
|
||||
The libical-devel package contains libraries and header files for developing
|
||||
The libical-devel package contains libraries and header files for developing
|
||||
applications that use libical.
|
||||
|
||||
%package glib
|
||||
Summary: GObject wrapper for libical library
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description glib
|
||||
This package provides a GObject wrapper for libical library with support
|
||||
of GObject Introspection.
|
||||
|
||||
%package glib-doc
|
||||
Summary: Documentation files for %{name}-glib
|
||||
Group: Development/Libraries
|
||||
BuildArch: noarch
|
||||
|
||||
%description glib-doc
|
||||
This package contains developer documentation for %{name}-glib.
|
||||
|
||||
%package glib-devel
|
||||
Summary: Development files for building against %{name}-glib
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: pkgconfig(glib-2.0)
|
||||
Requires: pkgconfig(gobject-2.0)
|
||||
|
||||
%description glib-devel
|
||||
Development files needed for building things which link against %{name}-glib.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .arm
|
||||
%patch1 -p1 -b .funcnamefix
|
||||
%patch2 -p1 -b .rscale-use-after-free
|
||||
|
||||
%build
|
||||
mkdir -p %{_target_platform}
|
||||
@ -42,6 +74,9 @@ pushd %{_target_platform}
|
||||
%{cmake} .. \
|
||||
-DUSE_INTEROPERABLE_VTIMEZONES:BOOL=true \
|
||||
-DICAL_ALLOW_EMPTY_PROPERTIES:BOOL=true \
|
||||
-DGOBJECT_INTROSPECTION:BOOL=true \
|
||||
-DICAL_GLIB:BOOL=true \
|
||||
-DICAL_GLIB_VAPI:BOOL=true \
|
||||
-DSHARED_ONLY:BOOL=true
|
||||
popd
|
||||
|
||||
@ -50,7 +85,6 @@ make %{?_smp_mflags} -C %{_target_platform}
|
||||
%install
|
||||
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
|
||||
|
||||
|
||||
%check
|
||||
make test ARGS="-V" -C %{_target_platform}
|
||||
|
||||
@ -60,11 +94,13 @@ make test ARGS="-V" -C %{_target_platform}
|
||||
|
||||
%files
|
||||
%doc LICENSE ReadMe.txt THANKS
|
||||
%{_libdir}/libical.so.2*
|
||||
%{_libdir}/libical_cxx.so.2*
|
||||
%{_libdir}/libicalss.so.2*
|
||||
%{_libdir}/libicalss_cxx.so.2*
|
||||
%{_libdir}/libicalvcal.so.2*
|
||||
%{_libdir}/libical.so.3*
|
||||
%{_libdir}/libical_cxx.so.3*
|
||||
%{_libdir}/libicalss.so.3*
|
||||
%{_libdir}/libicalss_cxx.so.3*
|
||||
%{_libdir}/libicalvcal.so.3*
|
||||
%{_libdir}/girepository-1.0/libical-%{version}.typelib
|
||||
%{_datadir}/gir-1.0/libical-%{version}.gir
|
||||
|
||||
%files devel
|
||||
%doc doc/UsingLibical.txt
|
||||
@ -77,7 +113,24 @@ make test ARGS="-V" -C %{_target_platform}
|
||||
%{_libdir}/cmake/LibIcal/
|
||||
%{_includedir}/libical/
|
||||
|
||||
%files glib
|
||||
%{_libdir}/libical-glib.so.3*
|
||||
%{_libdir}/girepository-1.0/ICalGLib-3.0.typelib
|
||||
%{_datadir}/gir-1.0/ICalGLib-3.0.gir
|
||||
|
||||
%files glib-devel
|
||||
%{_libdir}/libical-glib.so
|
||||
%{_libdir}/pkgconfig/libical-glib.pc
|
||||
%{_includedir}/libical-glib/
|
||||
%{_datadir}/vala/vapi/libical-glib.vapi
|
||||
|
||||
%files glib-doc
|
||||
%{_datadir}/gtk-doc/html/%{name}-glib
|
||||
|
||||
%changelog
|
||||
* Mon Nov 06 2017 Milan Crha <mcrha@redhat.com> - 3.0.0-1
|
||||
- Update to 3.0.0
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user