Author: lkundrak
Update of /cvs/nonfree/rpms/Mosaic/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv27587/devel
Modified Files:
.cvsignore sources
Added Files:
Mosaic-2.7b5-compile.patch Mosaic-2.7b5-crash.patch
Mosaic-2.7b5-hash_url.patch Mosaic-2.7b5-modern.patch
Mosaic-2.7b5-redirect.patch Mosaic-2.7b5-script.patch
Mosaic.desktop Mosaic.spec
Log Message:
Import NCSA Mosaic
Mosaic-2.7b5-compile.patch:
--- NEW FILE Mosaic-2.7b5-compile.patch ---
Fix Mosaic 2.7b5 build (Fedora)
Lubomir Rintel <lkundrak(a)v3.sk>
configure.in
Detect and use shared libraries correctly
Set include path for correct Motif detection
config.sub
Don't complain if the machine is already specified
libhtmlw/HTML-PSformat.c
Use stdarg instead of ancient and discontinued vararg
libnut/system.c
libwww2/HTTCP.c
src/gui-dialogs.c
Do not redefine error handling variables
src/comment.c
src/comment.h
Do not redundantly define variables in files including comment.h
src/readPNG.c
Replace deprecated functions with current
src/Makefile.in
Do not depend on GCC internal headers
libnut/url-utils.c
libnut/url-utils.h
libwww2/HTInit.c
Don't redefine glibc's getline
diff -up Mosaic-src/config.sub.compile Mosaic-src/config.sub
--- Mosaic-src/config.sub.compile 1996-06-25 10:33:24.000000000 +0200
+++ Mosaic-src/config.sub 2009-03-29 16:31:24.014883456 +0200
@@ -138,11 +138,6 @@ case $basic_machine in
| sparc)
basic_machine=$basic_machine-unknown
;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized
1>&2
- exit 1
- ;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
@@ -592,6 +587,8 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
+ *-*)
+ ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized
1>&2
exit 1
diff -up Mosaic-src/configure.in.compile Mosaic-src/configure.in
--- Mosaic-src/configure.in.compile 1996-07-11 03:34:40.000000000 +0200
+++ Mosaic-src/configure.in 2009-03-29 16:31:24.016883493 +0200
@@ -119,6 +119,7 @@ AC_CHECK_LIB(Xmu, _XEditResCheckMessages
AC_CHECK_LIB(Xm, XmCreatePushButton, [
AC_DEFINE(MOTIF)
LIBS="-lXm ${LIBS}"
+CPPFLAGS="${CPPFLAGS} -I/usr/include/Xm"
])
dnl Checks for typedefs, structures, and compiler characteristics.
@@ -144,189 +145,69 @@ dnl as smartly as possible.
AC_MSG_CHECKING(for external software)
echo ""
-AC_MSG_CHECKING(for jpeg software)
-AC_ARG_WITH(jpegdir,
-[ --with-jpegdir=DIR the directory where the built jpeg library resides ],
+AC_ARG_WITH(jpeg,
+[ --with-jpeg=DIR the directory where the built jpeg library resides ],
[
-dnl We got a dir make sure we got the header and library
+dnl We got a dir make sure we got the header and library
if test -d ${withval} ; then
- if test -r ${withval}/libjpeg.a ; then
- LIBS="${withval}/libjpeg.a ${LIBS}"
- else
- if test -r ${withval}/lib/libjpeg.a ; then
- LIBS="${withval}/lib/libjpeg.a ${LIBS}"
- else
- AC_MSG_ERROR(Could not find libjpeg.a in ${withval})
- fi
- fi
-
if test -r ${withval}/jpeglib.h ; then
- CPPFLAGS="${CPPFLAGS} -I${withval}"
+ CPPFLAGS="${CPPFLAGS} -I${withval}"
+ LDFLAGS="-L${withval} ${LDFLAGS}"
else
- if test -r ${withval}/include/jpeglib.h ; then
- CPPFLAGS="${CPPFLAGS} -I${withval}/include"
- else
- AC_MSG_ERROR(Could not find jpeglib.h in ${withval})
- fi
+ CPPFLAGS="${CPPFLAGS} -I${withval}/include"
+ LDFLAGS="-L${withval}/lib ${LDFLAGS}"
fi
-else
- AC_MSG_RESULT(not)
- AC_MSG_ERROR(Couldn't find the specified jpeg dir: ${withval})
fi
-dnl Now we think we got it so lets check
- AC_TRY_LINK([#include<stdio.h>
- #include "jpeglib.h"],
- [jpeg_read_raw_data(NULL, NULL, 0)],
- [AC_DEFINE(HAVE_JPEG)
- AC_MSG_RESULT(found)],
- [AC_MSG_RESULT(not found)
- AC_MSG_ERROR(Couldn't find jpeg stuff in ${withval})])
-],
-[
- echo ""
- echo "Uh oh, you didn't include jpeg. Doing this will greatly"
- echo "increase your surfing pleasure. You can get it from these places:"
- echo "ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6a.tar.gz"
- echo "ftp://ftp.cs.wisc.edu/pub/ghost/jpegsrc.v6a.tar.gz"
- echo ""
- echo "If you go get it and build it, putting it into mosaic"
- echo "is as simple as doing this: "
- echo "./configure --with-jpegdir=/dir/where/you/installed/jpeg"
- echo ""
- echo "or take a look at the config script and edit the jpegdir field."
- echo "Then you just run:"
- echo "./config"
- echo ""
- echo "Would you like to configure to stop now so you can go get jpeg?"
- echo "(yes or no)"
- read ans
-
- case "${ans}" in
- "y" | "ye" | "yes")
- exit
- ;;
- esac
-])
-dnl Before we check for png lets make sure we can find libz
-AC_MSG_CHECKING(for libz)
-
-dnl We need libz after libpng in the link line but we have to check it
-dnl before we check libpng, this variable does the magic
-lib_save=${LIBS}
+AC_CHECK_LIB(jpeg, jpeg_read_raw_data,
+ [AC_DEFINE(HAVE_JPEG)
+ LIBS="${LIBS} -ljpeg"],
+ [AC_MSG_ERROR(Couldn't find jpeg)])
+])
-AC_ARG_WITH(zdir,
-[ --with-zdir=DIR the directory where the built z library resides ],
+AC_ARG_WITH(zlib,
+[ --with-zlib=DIR the directory where the built z library resides ],
[
-dnl We got a dir make sure we got the library
+
+dnl We got a dir make sure we got the header and library
if test -d ${withval} ; then
- if test -r ${withval}/libz.a ; then
- LIBS="${withval}/libz.a ${LIBS}"
- libz="${withval}/libz.a"
+ if test -r ${withval}/zlib.h ; then
+ CPPFLAGS="${CPPFLAGS} -I${withval}"
+ LDFLAGS="-L${withval} ${LDFLAGS}"
else
- if test -r ${withval}/lib/libz.a ; then
- LIBS="${withval}/lib/libz.a ${LIBS}"
- libz="${withval}/lib/libz.a"
- else
- AC_MSG_ERROR(Could not find libz.a in ${withval})
- fi
+ CPPFLAGS="${CPPFLAGS} -I${withval}/include"
+ LDFLAGS="-L${withval}/lib ${LDFLAGS}"
fi
-else
- AC_MSG_ERROR(Couldn't find the specified zlib dir: ${withval})
fi
-dnl Now we think we got it so lets check
- AC_TRY_LINK([#include<stdio.h>],
- [inflate();],
- [AC_DEFINE(HAVE_PNG)
- AC_MSG_RESULT(got it)
- have_z="yes"],
- [AC_MSG_RESULT(not found)
- AC_MSG_ERROR(Couldn't find png stuff in ${withval})])
-
-],
-[
-AC_MSG_RESULT(not)
])
-LIBS=${lib_save}
-if test "${have_z}" = "yes" ; then
-AC_MSG_CHECKING(for png)
-AC_ARG_WITH(pngdir,
- [ --with-pngdir=DIR the directory where the built png library resides ],
- [
+# Check for PNG
+AC_ARG_WITH(png,
+[ --with-png=DIR the directory where the built png library resides ],
+[
+
dnl We got a dir make sure we got the header and library
- if test -d ${withval} ; then
- if test -r ${withval}/libpng.a ; then
- LIBS="${withval}/libpng.a ${libz} ${LIBS}"
- else
- if test -r ${withval}/lib/libpng.a ; then
- LIBS="${withval}/lib/libpng.a ${libz} ${LIBS}"
- else
- AC_MSG_ERROR(Could not find libpng.a in ${withval})
- fi
- fi
-
- if test -r ${withval}/png.h ; then
- CPPFLAGS="$CPPFLAGS -I${withval}"
- else
- if test -r ${withval}/include/png.h ; then
- CPPFLAGS="$CPPFLAGS -I${withval}/include"
- else
- AC_MSG_ERROR(Could not find png.h in ${withval})
- fi
- fi
+if test -d ${withval} ; then
+ if test -r ${withval}/png.h ; then
+ CPPFLAGS="${CPPFLAGS} -I${withval}"
+ LDFLAGS="-L${withval} ${LDFLAGS}"
else
- AC_MSG_RESULT(not found)
- AC_MSG_ERROR(Couldn't find the specified png dir: ${withval})
+ CPPFLAGS="${CPPFLAGS} -I${withval}/include"
+ LDFLAGS="-L${withval}/lib ${LDFLAGS}"
fi
-dnl Now we think we got it so lets check
- AC_TRY_LINK([#include<stdio.h>
- #include "png.h"],
- [png_read_data(NULL, NULL, 0)],
- [AC_DEFINE(HAVE_PNG)
- AC_MSG_RESULT(got it)
- have_png="yes"],
- [AC_MSG_RESULT(not found)
- AC_MSG_ERROR(Couldn't find png stuff in ${withval})])
-],
-[
-AC_MSG_RESULT(not found)
-have_png='no'
-])
-else
-have_png='no'
-fi
-
-if test "${have_png}" = "no" ; then
- echo ""
- echo "Uh oh, you didn't include png. This will allow Mosaic to "
- echo "view png images. You can get it here:"
- echo "ftp://ftp.uu.net/graphics/png/src"
- echo "Before you run out and get it you will also need libz which can be"
- echo "found in the same place."
- echo ""
- echo "If you go get and build these things, putting png support into
mosaic"
- echo "is as simple as doing this: "
- echo "./configure --with-pngdir=/where/you/installed/png
--with-zdir=/where/you/installed/zlib"
- echo ""
- echo "Or you can just fill in the appropriate fields in the config script"
- echo "and to this:"
- echo "./config"
- echo ""
- echo "Would you like to configure to stop now so you can go get png/zlib?"
- echo "(yes or no)"
-
- read ans
-
- case "${ans}" in
- "y" | "ye" | "yes")
- exit
- ;;
- esac
fi
+AC_CHECK_LIB(png, png_read_info,
+ [AC_DEFINE(HAVE_PNG)
+ LIBS="${LIBS} -lpng"],
+ [AC_MSG_ERROR(Could not find png)])
+
+AC_CHECK_LIB(z, inflate,
+ [LIBS="${LIBS} -lz"],
+ [AC_MSG_ERROR(Could not find libz)])
+])
dnl AC_ARG_WITH(waisdir,
dnl [ --with-waisdir=DIR the directory where the built wais library resides dnl ],
diff -up Mosaic-src/libhtmlw/HTML-PSformat.c.compile Mosaic-src/libhtmlw/HTML-PSformat.c
--- Mosaic-src/libhtmlw/HTML-PSformat.c.compile 1996-06-27 01:36:53.000000000 +0200
+++ Mosaic-src/libhtmlw/HTML-PSformat.c 2009-03-29 16:31:24.020878980 +0200
@@ -59,7 +59,7 @@
*
*/
#include "../config.h"
-#include <varargs.h>
+#include <stdarg.h>
#include <string.h>
#include <stdio.h>
@@ -229,9 +229,7 @@ GetDpi(HTMLWidget hw)
*
*/
static int
-PSprintf(format, va_alist)
- char* format;
- va_dcl
+PSprintf(char *format, ...)
{
int len;
char *s;
@@ -251,7 +249,7 @@ PSprintf(format, va_alist)
}
PS_string = s;
}
- va_start(args);
+ va_start(args, format);
len = vsprintf(PS_string+PS_len, format, args);
/* this is a hack to make it work on systems were vsprintf(s,...)
* returns s, instead of the len.
diff -up Mosaic-src/libnut/system.c.compile Mosaic-src/libnut/system.c
--- Mosaic-src/libnut/system.c.compile 1996-06-27 03:08:52.000000000 +0200
+++ Mosaic-src/libnut/system.c 2009-03-29 16:31:24.022883077 +0200
@@ -102,10 +102,12 @@ extern char *strdup(char *str);
#endif
#ifndef VMS
+#if __GLIBC__ && __GLIBC__ < 2
extern int sys_nerr;
extern char *sys_errlist[];
extern int errno;
#endif
+#endif
#ifndef DISABLE_TRACE
diff -up Mosaic-src/libnut/url-utils.c.compile Mosaic-src/libnut/url-utils.c
--- Mosaic-src/libnut/url-utils.c.compile 1996-06-27 03:08:53.000000000 +0200
+++ Mosaic-src/libnut/url-utils.c 2009-03-29 16:31:24.082884586 +0200
@@ -164,6 +164,7 @@ int rind(char *s, char c) {
}
+#ifdef NO_GETLINE
int getline(char *s, int n, FILE *f) {
register int i=0;
@@ -180,6 +181,7 @@ int getline(char *s, int n, FILE *f) {
++i;
}
}
+#endif
void send_fd(FILE *f, FILE *fd)
diff -up Mosaic-src/libnut/url-utils.h.compile Mosaic-src/libnut/url-utils.h
--- Mosaic-src/libnut/url-utils.h.compile 1995-11-22 00:03:03.000000000 +0100
+++ Mosaic-src/libnut/url-utils.h 2009-03-29 16:31:24.084882702 +0200
@@ -6,7 +6,9 @@ char x2c(char *what);
void unescape_url(char *url);
void plustospace(char *str);
int rind(char *s, char c);
+#ifdef NO_GETLINE
int getline(char *s, int n, FILE *f);
+#endif
void send_fd(FILE *f, FILE *fd);
int ind(char *s, char c);
void escape_shell_cmd(char *cmd);
diff -up Mosaic-src/libwww2/HTInit.c.compile Mosaic-src/libwww2/HTInit.c
--- Mosaic-src/libwww2/HTInit.c.compile 1996-06-27 02:22:34.000000000 +0200
+++ Mosaic-src/libwww2/HTInit.c 2009-03-29 16:31:24.086882184 +0200
@@ -489,6 +489,7 @@ PUBLIC void HTFileInit NOARGS
#define MAX_STRING_LEN 256
+#ifdef NO_GETLINE
static int getline(char *s, int n, FILE *f)
{
register int i=0;
@@ -510,6 +511,7 @@ static int getline(char *s, int n, FILE
/* NOTREACHED */
}
+#endif
static void getword(char *word, char *line, char stop, char stop2)
{
diff -up Mosaic-src/libwww2/HTTCP.c.compile Mosaic-src/libwww2/HTTCP.c
--- Mosaic-src/libwww2/HTTCP.c.compile 1996-06-27 02:22:48.000000000 +0200
+++ Mosaic-src/libwww2/HTTCP.c 2009-03-29 16:31:24.040884199 +0200
@@ -72,8 +72,10 @@ PRIVATE char *hostname=0; /* The name o
extern int errno;
#endif /* errno */
+#if defined(__GLIBC__) && __GLIBC__ < 2
extern char *sys_errlist[]; /* see man perror on cernvax */
extern int sys_nerr;
+#endif
/* Report Internet Error
** ---------------------
diff -up Mosaic-src/src/comment.c.compile Mosaic-src/src/comment.c
--- Mosaic-src/src/comment.c.compile 1996-06-27 00:56:41.000000000 +0200
+++ Mosaic-src/src/comment.c 2009-03-29 16:31:24.042879972 +0200
@@ -62,6 +62,7 @@
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
+#define COMMENT_C
#include "comment.h"
diff -up Mosaic-src/src/comment.h.compile Mosaic-src/src/comment.h
--- Mosaic-src/src/comment.h.compile 1996-06-06 22:01:43.000000000 +0200
+++ Mosaic-src/src/comment.h 2009-03-29 16:31:24.045883497 +0200
@@ -67,6 +67,7 @@
#ifndef _COMMENT_H
#define _COMMENT_H
+#ifdef COMMENT_C
char *comment_card_html_top= \
"<title>\n" \
" Comment Card for Mosaic 2.6\n" \
@@ -293,6 +294,7 @@ char *comment_card_html_bot= \
"\n" \
"</form>\n" \
"\n";
+#endif /* COMMENT_C */
#endif
diff -up Mosaic-src/src/gui-dialogs.c.compile Mosaic-src/src/gui-dialogs.c
--- Mosaic-src/src/gui-dialogs.c.compile 1996-07-18 09:49:41.000000000 +0200
+++ Mosaic-src/src/gui-dialogs.c 2009-03-29 16:31:24.049878607 +0200
@@ -87,9 +87,11 @@ extern int is_uncompressed;
/*swp -- for ~ expansion*/
#include <pwd.h>
+#if __GLIBC__ && __GLIBC__ < 2
extern int sys_nerr;
extern char *sys_errlist[];
extern int errno;
+#endif
#define __MAX_HOME_LEN__ 256
int pathEval(char *dest, char *src);
char *getFileName(char *file_src);
diff -up Mosaic-src/src/Makefile.in.compile Mosaic-src/src/Makefile.in
--- Mosaic-src/src/Makefile.in.compile 1996-06-28 07:42:15.000000000 +0200
+++ Mosaic-src/src/Makefile.in 2009-03-29 16:31:24.052880378 +0200
@@ -199,7 +199,7 @@ cciBindings2.o: mosaic.h ../libXmx/Xmx.h
cciBindings2.o: toolbar.h prefs.h prefs_defs.h gui.h cci.h port.h
cciBindings2.o: cciBindings2.h cciServer.h list.h memStuffForPipSqueeks.h
cciBindings2.o: ../libwww2/HTFormat.h ../libwww2/HTUtils.h
-cciBindings2.o: ../libwww2/HTString.h /usr/include/stdarg.h
+cciBindings2.o: ../libwww2/HTString.h
cciBindings2.o: ../libwww2/HTStream.h ../libwww2/HTAtom.h ../libwww2/HTList.h
cciBindings2.o: ../libwww2/HTAnchor.h
@@ -207,7 +207,7 @@ support.o: cci.h port.h
bla.o: cciServer.h cci.h port.h list.h
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
-bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h /usr/include/stdarg.h
+bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
diff -up Mosaic-src/src/readPNG.c.compile Mosaic-src/src/readPNG.c
--- Mosaic-src/src/readPNG.c.compile 1996-06-30 14:30:00.000000000 +0200
+++ Mosaic-src/src/readPNG.c 2009-03-29 16:31:24.055883413 +0200
@@ -126,13 +126,13 @@ ReadPNG(FILE *infile,int *width, int *he
rewind(infile);
/* allocate the structures */
- png_ptr = (png_struct *)malloc(sizeof(png_struct));
+ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if(!png_ptr)
return 0;
info_ptr = (png_info *)malloc(sizeof(png_info));
if(!info_ptr) {
- free(png_ptr);
+ png_destroy_read_struct(&png_ptr, NULL, NULL);
return 0;
}
@@ -145,25 +145,20 @@ ReadPNG(FILE *infile,int *width, int *he
}
#endif
- png_read_destroy(png_ptr, info_ptr, (png_info *)0);
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
if(png_pixels != NULL)
free((char *)png_pixels);
if(row_pointers != NULL)
free((png_byte **)row_pointers);
-
- free((char *)png_ptr);
- free((char *)info_ptr);
+
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return 0;
}
- /* SWP -- Hopefully to fix cores on bad PNG files */
- png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL);
-
- /* initialize the structures */
+ /* initialize the structure */
png_info_init(info_ptr);
- png_read_init(png_ptr);
/* set up the input control */
png_init_io(png_ptr, infile);
@@ -409,12 +404,7 @@ ReadPNG(FILE *infile,int *width, int *he
free((png_byte **)row_pointers);
/* clean up after the read, and free any memory allocated */
- png_read_destroy(png_ptr, info_ptr, (png_info *)0);
-
-
- /* free the structures */
- free((char *)png_ptr);
- free((char *)info_ptr);
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return pixmap;
}
Mosaic-2.7b5-crash.patch:
--- NEW FILE Mosaic-2.7b5-crash.patch ---
JPEG closes frees FILE pointer upon unsuccessfull load, don't free it again.
Lubomir Rintel <lkundrak(a)v3.sk>
--- Mosaic-src.orig/src/picread.c 1996-06-27 00:57:12.000000000 +0200
+++ Mosaic-src/src/picread.c 2008-11-28 18:15:03.000000000 +0100
@@ -702,6 +702,10 @@ int *bg;
if (fp != stdin) fclose(fp);
return(bit_data);
}
+ else
+ {
+ fp = NULL;
+ }
#endif
}
Mosaic-2.7b5-hash_url.patch:
--- NEW FILE Mosaic-2.7b5-hash_url.patch ---
Render
wikipedia.org correctly.
Martin Nagy <mnagy(a)redhat.com>
diff -up Mosaic-src/src/globalhist.c.hash_url Mosaic-src/src/globalhist.c
--- Mosaic-src/src/globalhist.c.hash_url 2008-11-28 21:05:08.000000000 +0100
+++ Mosaic-src/src/globalhist.c 2008-11-28 21:09:56.000000000 +0100
@@ -210,7 +210,7 @@ static int hash_url (char *url)
len = strlen (url);
val = 0;
for (i = 0; i < 10; i++)
- val += url[(i * val + 7) % len];
+ val += (unsigned char)url[(i * val + 7) % len];
return val % HASH_TABLE_SIZE;
}
Mosaic-2.7b5-modern.patch:
--- NEW FILE Mosaic-2.7b5-modern.patch ---
Various fixes & hacks to make it understand today's web pages. (2008-11-27)
Lubomir Rintel <lkundrak(a)v3.sk>
HTMIME.c
Chuck ;charset=..., which would make us not understand the mime type.
We don't do any charset conversions anyways.
HTInit.c
Accept XHTML as HTML.
HTMLformat.c
Don't terminate head on junk tags such as META or STYLE.
They're better hidden if we don't grok them.
HTMLparse.c
Accept singly quoted argument values.
--- Mosaic-src.orig/libwww2/HTMIME.c 1996-06-27 02:22:36.000000000 +0200
+++ Mosaic-src/libwww2/HTMIME.c 2008-11-27 21:24:06.000000000 +0100
@@ -569,11 +569,14 @@ PRIVATE void HTMIME_put_character ARGS2(
if (www2Trace)
fprintf (stderr, "[MIME_put_char] Got content-type value
'%s'\n", me->value);
#endif
- /* Lowercase it. */
+ /* Lowercase it and strip charset. */
{
char *tmp;
for (tmp = me->value; *tmp; tmp++)
- *tmp = TOLOWER (*tmp);
+ if (*tmp == ';')
+ *tmp = '\0';
+ else
+ *tmp = TOLOWER (*tmp);
}
#ifndef DISABLE_TRACE
if (www2Trace)
--- Mosaic-src.orig/libwww2/HTInit.c 1996-06-27 02:22:34.000000000 +0200
+++ Mosaic-src/libwww2/HTInit.c 2008-11-27 21:30:34.000000000 +0100
@@ -56,6 +56,12 @@ PUBLIC void HTFormatInit NOARGS
HTSetConversion("text/plain", "www/present", HTPlainPresent, 1.0,
0.0, 0.0);
HTSetConversion("application/x-wais-source", "*", HTWSRCConvert,
1.0, 0.0, 0.0);
+ /* XHTML */
+ HTSetConversion("text/xhtml", "www/present", HTMosaicHTMLPresent,
1.0, 0.0, 0.0);
+ HTSetConversion("text/xhtml+xml", "www/present",
HTMosaicHTMLPresent, 1.0, 0.0, 0.0);
+ HTSetConversion("application/xhtml", "www/present",
HTMosaicHTMLPresent, 1.0, 0.0, 0.0);
+ HTSetConversion("application/xhtml+xml", "www/present",
HTMosaicHTMLPresent, 1.0, 0.0, 0.0);
+
/* These should override everything else. */
HTLoadTypesConfigFile (personal_type_map);
--- Mosaic-src.orig/libhtmlw/HTMLformat.c 1996-07-18 09:49:26.000000000 +0200
+++ Mosaic-src/libhtmlw/HTMLformat.c 2008-11-28 10:02:14.000000000 +0100
@@ -3448,16 +3448,6 @@ TriggerMarkChanges(hw, mptr, x, y)
type = mark->type;
font = NULL;
- /* If we are not in a tag that belongs in the HEAD, end the HEAD
- section - amb */
- if (InDocHead)
- if ((type != M_TITLE)&&(type != M_NONE)&&(type != M_BASE)&&
- (type != M_INDEX)&&(type != M_COMMENT))
- {
- Ignore = 0;
- InDocHead = 0;
- }
-
/*
* If Ignore is set, we ignore all further elements until we get to the
* end of the Ignore
--- Mosaic-src.orig/libhtmlw/HTMLparse.c 1996-06-27 01:37:04.000000000 +0200
+++ Mosaic-src/libhtmlw/HTMLparse.c 2008-11-28 10:35:49.000000000 +0100
@@ -1436,10 +1436,12 @@ AnchorTag(ptrp, startp, endp)
char *ptr;
char *start;
char tchar;
- int quoted;
+ int double_quoted;
+ int single_quoted;
int has_value;
- quoted = 0;
+ double_quoted = 0;
+ single_quoted = 0;
/*
* remove leading spaces, and set start
@@ -1508,7 +1510,13 @@ AnchorTag(ptrp, startp, endp)
if (*ptr == '\"')
{
- quoted = 1;
+ double_quoted = 1;
+ ptr++;
+ }
+
+ if (*ptr == '\'')
+ {
+ single_quoted = 1;
ptr++;
}
@@ -1516,13 +1524,20 @@ AnchorTag(ptrp, startp, endp)
/*
* Get tag value. Either a quoted string or a single word
*/
- if (quoted)
+ if (double_quoted)
{
while ((*ptr != '\"')&&(*ptr != '\0'))
{
ptr++;
}
}
+ else if (single_quoted)
+ {
+ while ((*ptr != '\'')&&(*ptr != '\0'))
+ {
+ ptr++;
+ }
+ }
else
{
while ((!isspace((int)*ptr))&&(*ptr != '\0'))
@@ -1564,7 +1579,7 @@ AnchorTag(ptrp, startp, endp)
/* If you forgot the end quote, you need to make sure you aren't
indexing ptr past the end of its own array -- SWP */
- if (quoted && *ptr!='\0')
+ if ((single_quoted || double_quoted) && *ptr!='\0')
{
ptr++;
}
Mosaic-2.7b5-redirect.patch:
--- NEW FILE Mosaic-2.7b5-redirect.patch ---
Fix relative redirects, for sites such as
microsoft.com
Martin Nagy <mnagy(a)redhat.com>
diff -up Mosaic-src/libwww2/HTMIME.c.redirect Mosaic-src/libwww2/HTMIME.c
--- Mosaic-src/libwww2/HTMIME.c.redirect 2008-11-29 05:04:46.000000000 +0100
+++ Mosaic-src/libwww2/HTMIME.c 2008-11-29 05:07:13.000000000 +0100
@@ -658,8 +658,37 @@ PRIVATE void HTMIME_put_character ARGS2(
#endif
break;
case LOCATION:
- me->location = me->value;
- redirecting_url = strdup (me->location);
+ if (me->value[0] == '/' && me->anchor != NULL &&
me->anchor->address != NULL) {
+ char *tmp;
+ char *end;
+ int len;
+ int value_len;
+
+ /* Skip the protocol name */
+ tmp = strstr(me->anchor->address, "://");
+ if (tmp != NULL)
+ tmp += 3;
+ else
+ tmp = me->anchor->address;
+ end = strchr(tmp, '/');
+ tmp = me->anchor->address;
+ if (end != NULL)
+ len = end - tmp;
+ else
+ len = strlen(tmp);
+
+ value_len = strlen(me->value);
+
+ redirecting_url = malloc(sizeof(char) * (len + value_len + 1));
+ strncpy(redirecting_url, tmp, len);
+ strncpy(redirecting_url + len, me->value, value_len);
+ redirecting_url[len + value_len] = '\0';
+
+ me->location = strdup (redirecting_url);
+ } else {
+ me->location = me->value;
+ redirecting_url = strdup (me->location);
+ }
#ifndef DISABLE_TRACE
if (www2Trace)
fprintf(stderr,
Mosaic-2.7b5-script.patch:
--- NEW FILE Mosaic-2.7b5-script.patch ---
Skip <script> tags, for the cases where careless authors don't comment its
content out.
Lubomir Rintel <lkundrak(a)v3.sk>
--- Mosaic-src.orig/libhtmlw/HTMLparse.c 1996-06-27 01:37:04.000000000 +0200
+++ Mosaic-src/libhtmlw/HTMLparse.c 2008-11-28 19:04:50.000000000 +0100
@@ -622,7 +622,7 @@ get_mark(start, endp)
}
/* amb - check if we are in a comment, start tag is <!-- */
- if (strncmp (start, "<!--", 4)==0)
+ if (strncmp (start, "<!--", 4)==0 || strncasecmp (start,
"<script", 7)==0)
comment=1;
start++;
@@ -652,9 +652,12 @@ get_mark(start, endp)
{
if ( (*ptr == '>') && (!first_gt) )
first_gt = ptr;
- if (strncmp (ptr, "--", 2) == 0) /* found double dash (--) */
+ if (strncmp (ptr, "--", 2) == 0 || strncasecmp (ptr, "</script",
8) == 0) /* found double dash (--) */
{
- ptr += 2;
+ if (ptr[0] == '-')
+ ptr += 2;
+ else
+ ptr += 8;
while ((*ptr != '\0') && ((*ptr == ' ') || (*ptr ==
'\n')
|| (*ptr == '-') ))
ptr++; /* skip spaces and newlines */
--- NEW FILE Mosaic.desktop ---
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Mosaic
Comment=Web Browser
GenericName=Web Browser
Exec=Mosaic %f
Icon=Mosaic
Categories=Network;WebBrowser;
MimeType=text/html;
Terminal=false
--- NEW FILE Mosaic.spec ---
Name: Mosaic
Version: 2.7
Release: 0.3.b5%{?dist}
Summary: Web Browser
Group: Applications/Internet
# This is different from "NCSA" license
License: Mosaic
URL:
http://www.ncsa.uiuc.edu/Projects/mosaic.html
Source0:
ftp://ftp.ncsa.uiuc.edu/Mosaic/Unix/source/Mosaic-src-2.7b5.tar.gz
Source1: Mosaic.desktop
Patch0: Mosaic-2.7b5-compile.patch
Patch1: Mosaic-2.7b5-modern.patch
Patch2: Mosaic-2.7b5-crash.patch
Patch3: Mosaic-2.7b5-script.patch
Patch4: Mosaic-2.7b5-hash_url.patch
Patch5: Mosaic-2.7b5-redirect.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?rhel}
BuildRequires: openmotif-devel
%else
BuildRequires: lesstif-devel
%endif
BuildRequires: libjpeg-devel libpng-devel
BuildRequires: autoconf ImageMagick desktop-file-utils
BuildRequires: libXmu-devel
%description
Mosaic is a web browser and client for protocols such as FTP, Usenet, and
Gopher. Its has a clean, easily understood user interface and is capable of
displaying images inline with text.
%prep
%setup -q -n %{name}-src
%patch0 -p1 -b .compile
%patch1 -p1 -b .modern
%patch2 -p1 -b .crash
%patch3 -p1 -b .script
%patch4 -p1 -b .hash_url
%patch5 -p1 -b .redirect
%build
autoconf
%configure --with-png --with-jpeg
make %{?_smp_mflags}
# Convert the icon into Icon Theme Specification compilant one
convert src/pixmaps/s_icon.1.xpm Mosaic.png
# Fix permissions for debuginfo package
chmod 0644 src/bitmaps/busy_9.xbm libnut/url-utils.c
%install
rm -rf $RPM_BUILD_ROOT
# Directory structure
install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -d $RPM_BUILD_ROOT%{_datadir}/applications
install -d $RPM_BUILD_ROOT%{_bindir}
# Executable
install src/Mosaic $RPM_BUILD_ROOT%{_bindir}
# Icon
install -pm 0644 Mosaic.png $RPM_BUILD_ROOT%{_datadir}/pixmaps
# Menu entry
desktop-file-install %{SOURCE1} \
--dir=$RPM_BUILD_ROOT%{_datadir}/applications
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_bindir}/Mosaic
%{_datadir}/pixmaps/Mosaic.png
%{_datadir}/applications/Mosaic.desktop
%doc CHANGES COPYRIGHT FEATURES INSTALL README
%doc README.resources.html
%changelog
* Thu Apr 23 2009 Lubomir Rintel <lkundrak(a)v3.sk> - 2.7-0.3.b5
- Grammar fixes
- Fix buildrequires
- Correct license tag
- Strip executable bits off source files
- Don't use vendor tag for desktop menu entry
* Sun Mar 29 2009 Lubomir Rintel <lkundrak(a)v3.sk> - 2.7-0.2.b5
- Fix build for Fedora 11
* Tue Nov 25 2008 Lubomir Rintel <lkundrak(a)v3.sk> - 2.7-0.1.b5
- Initial packaging
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/Mosaic/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 23 Apr 2009 18:29:51 -0000 1.1
+++ .cvsignore 24 Apr 2009 06:26:48 -0000 1.2
@@ -0,0 +1 @@
+Mosaic-src-2.7b5.tar.gz
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/Mosaic/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 23 Apr 2009 18:29:51 -0000 1.1
+++ sources 24 Apr 2009 06:26:48 -0000 1.2
@@ -0,0 +1 @@
+3060c79a063948bcc2fa867c334702d2 Mosaic-src-2.7b5.tar.gz