2007-10-31 Damien Carbery <[email protected]>
authordcarbery
Wed, 31 Oct 2007 17:13:29 +0000
changeset 11095 6dad7ee85c27
parent 11094 9e3909fa5e72
child 11096 b8ed71cdf0d5
2007-10-31 Damien Carbery <[email protected]> * SUNWevolution.spec: Put the /usr/gnu references inside '%if %option_with_gnu_iconv' test. * patches/totem-06-asprintf.diff: Rework to check whether asprintf is available, providing local version (by ErwannC) if necessary.
ChangeLog
SUNWevolution.spec
patches/totem-06-asprintf.diff
--- a/ChangeLog	Wed Oct 31 16:56:45 2007 +0000
+++ b/ChangeLog	Wed Oct 31 17:13:29 2007 +0000
@@ -1,3 +1,10 @@
+2007-10-31  Damien Carbery <[email protected]>
+
+	* SUNWevolution.spec: Put the /usr/gnu references inside '%if
+	  %option_with_gnu_iconv' test.
+	* patches/totem-06-asprintf.diff: Rework to check whether asprintf is
+	  available, providing local version (by ErwannC) if necessary.
+
 2007-10-31  Ghee Teo <[email protected]>
 
 	* base-specs/ospm.spec: updated to include patch.
--- a/SUNWevolution.spec	Wed Oct 31 16:56:45 2007 +0000
+++ b/SUNWevolution.spec	Wed Oct 31 17:13:29 2007 +0000
@@ -115,7 +115,10 @@
 #       should be re-enabled once these issues are fixed
 export LD=/usr/ccs/bin/ld 
 export LDFLAGS="%{?arch_ldadd} -Wl,-z,ignore -L%{_libdir} -R%{_libdir}"
-export CFLAGS="%optflags -I/usr/gnu/include -L/usr/gnu/lib -R/usr/gnu/lib"
+export CFLAGS="%optflags"
+%if %option_with_gnu_iconv
+export CFLAGS="$CFLAGS -I/usr/gnu/include -L/usr/gnu/lib -R/usr/gnu/lib"
+%endif
 export RPM_OPT_FLAGS="$CFLAGS"
 export PERL=/usr/perl5/bin/perl
 export PKG_CONFIG_PATH=%{_pkg_config_path}:%{_builddir}/%name-%version/evolution-%{evolution.version}
@@ -288,6 +291,8 @@
 
 %changelog
 * Wed Oct 31 2006 - [email protected]
+- Put the /usr/gnu references inside '%if %option_with_gnu_iconv' test.
+* Wed Oct 31 2006 - [email protected]
 - Remove %{_libexecdir}/evolution/%{evolution.major_version}/evolution-backup
   as it is not in the 2.21.1 tarball.
 * Mon Oct 22 2006 - [email protected]
--- a/patches/totem-06-asprintf.diff	Wed Oct 31 16:56:45 2007 +0000
+++ b/patches/totem-06-asprintf.diff	Wed Oct 31 17:13:29 2007 +0000
@@ -1,28 +1,73 @@
---- totem-2.21.0/src/plparse/xmlparser.c.orig	2007-10-31 08:27:00.697622853 +0000
-+++ totem-2.21.0/src/plparse/xmlparser.c	2007-10-31 08:49:00.820702556 +0000
-@@ -193,7 +193,12 @@
-     if (subnode->name == cdata) {
-       /* most recent node is CDATA - append to it */
-       char *newtext;
-+#ifndef __sun
-       asprintf (&newtext, "%s%s", subnode->data, text);
+--- totem-2.21.0/configure.in.orig	2007-10-31 16:37:01.207940646 +0000
++++ totem-2.21.0/configure.in	2007-10-31 16:40:38.323711378 +0000
+@@ -685,6 +685,8 @@
+ AM_CONDITIONAL([ENABLE_MULLY_PLUGIN],[test "$enable_mully_plugin" = "yes"])
+ AM_CONDITIONAL([ENABLE_CONE_PLUGIN],[test "$enable_cone_plugin" = "yes"])
+ 
++AC_CHECK_FUNCS(asprintf)
++
+ dnl ********
+ dnl Nautilus
+ dnl ********
+--- totem-2.21.0/src/plparse/xmlparser.c.orig	2007-10-31 16:50:22.077219472 +0000
++++ totem-2.21.0/src/plparse/xmlparser.c	2007-10-31 16:52:26.658959221 +0000
+@@ -56,6 +56,59 @@
+ /* private global variables */
+ static int xml_parser_mode;
+ 
++/* Local copy of asprintf for systems that do not provide it. */
++#ifndef HAVE_ASPRINTF
++int asprintf(char **out, const char *fmt, ...)
++{
++    va_list ap;
++    int ret_status = EOF;
++    char dir_name[2001];
++    char file_name[2000];
++    FILE *fp = NULL;
++    char *work = NULL;
++
++    va_start(ap, fmt);
++
++    /* Warning: tmpfile() does not work well on Windows (MinGW)
++     *          if user does not have write access on the drive where 
++     *          working dir is? */
++#ifdef __MINGW32__
++    /* file_name = G_tempfile(); */
++    GetTempPath ( 2000, dir_name );
++    GetTempFileName ( dir_name, "asprintf", 0, file_name );
++    fp = fopen ( file_name, "w+" );
 +#else
-+      newtext = malloc (sizeof (char *) * 2056);
-+      sprintf(newtext, "%s%s", subnode->data, text);
++    fp = tmpfile(); 
++#endif /* __MINGW32__ */
++
++    if ( fp ) {
++        int count;
++
++        count = vfprintf(fp, fmt, ap);
++        if (count >= 0) {
++            work = calloc(count + 1, sizeof(char));
++            if (work != NULL) {
++                rewind(fp);
++                ret_status = fread(work, sizeof(char), count, fp);
++                if (ret_status != count) {
++                    ret_status = EOF;
++                    free(work);
++                    work = NULL;
++                }
++            }
++        }
++        fclose(fp);
++#ifdef __MINGW32__
++        unlink ( file_name );
++#endif /* __MINGW32__ */
++    }
++    va_end(ap);
++    *out = work;
++
++    return ret_status;
++}
 +#endif
-       free (subnode->data);
-       subnode->data = newtext;
-     } else {
-@@ -206,7 +211,12 @@
-   } else if (node->data) {
-     /* "no" subtree, but we have existing text - append to it */
-     char *newtext;
-+#ifndef __sun
-     asprintf (&newtext, "%s%s", node->data, text);
-+#else
-+      newtext = malloc (sizeof (char *) * 2056);
-+      sprintf(newtext, "%s%s", node->data, text);
-+#endif
-     free (node->data);
-     node->data = newtext;
-   } else {
++
+ /* private functions */
+ 
+ static char * strtoupper(char * str) {