commit 9b07afceccfc08a070a8187a561d0345a3b0c657 Author: Dmitry Samoylik Date: Thu Dec 26 16:53:07 2024 +0300 import man2html-1.6-36.g.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d111cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/man2html_1.6g-6.debian.tar.gz +SOURCES/man-1.6g.tar.gz diff --git a/.man2html.metadata b/.man2html.metadata new file mode 100644 index 0000000..d2adfd9 --- /dev/null +++ b/.man2html.metadata @@ -0,0 +1,2 @@ +f002034b7d353a00d9a0bad069cb56f3778c4381 SOURCES/man2html_1.6g-6.debian.tar.gz +ef9e1f36a1a536a31112d52c3f39340900b0d3cb SOURCES/man-1.6g.tar.gz diff --git a/SOURCES/man2html-BR-empty-line.patch b/SOURCES/man2html-BR-empty-line.patch new file mode 100644 index 0000000..189d263 --- /dev/null +++ b/SOURCES/man2html-BR-empty-line.patch @@ -0,0 +1,17 @@ +Ignore font change requests that are note followed by any words (closes: #489181). + +diff -ruN -x '*.rej' -x '*.orig' man-1.6f-old/man2html/man2html.c man-1.6f/man2html/man2html.c +--- man-1.6f-old/man2html/man2html.c 2008-09-07 10:56:00.000000000 +0200 ++++ man-1.6f/man2html/man2html.c 2008-09-07 10:56:54.000000000 +0200 +@@ -2131,7 +2131,10 @@ + char font[2]; + font[0] = c[0]; font[1] = c[1]; + c = c+j; +- if (*c == '\n') c++; ++ if (*c == '\n') { ++ c++; ++ break; ++ } + sl = fill_words(c, wordlist, SIZE(wordlist), &words, '\n'); + c = sl+1; + /* .BR name (section) diff --git a/SOURCES/man2html-all-args.patch b/SOURCES/man2html-all-args.patch new file mode 100644 index 0000000..638e199 --- /dev/null +++ b/SOURCES/man2html-all-args.patch @@ -0,0 +1,50 @@ +Handle \$* and \$@ escapes. + +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/man2html.c man-1.6e/man2html/man2html.c +--- man-1.6e-old/man2html/man2html.c 2007-04-17 00:34:40.000000000 +0200 ++++ man-1.6e/man2html/man2html.c 2007-04-17 00:29:47.000000000 +0200 +@@ -615,6 +615,7 @@ + static char * + scan_escape(char *c) { + char *h=NULL; ++ char *tmp = NULL; + char b[10]; + INTDEF *intd; + int exoutputp,exskipescape; +@@ -630,8 +631,26 @@ + case '$': + if (argument) { + c++; +- i=(*c -'1'); +- if (!(h=argument[i])) h=""; ++ if (*c == '*' || *c == '@') { ++ int len = 0; ++ int quote = (*c == '@') ? 2 : 0; ++ ++ for (i = 0; ((h = argument[i])); i++) ++ len += strlen(h) + 1 + quote; ++ tmp = (char*) xmalloc(len + 1); ++ *tmp = 0; ++ ++ for (i = 0; ((h = argument[i])); i++) { ++ sprintf(tmp, "%s %s%s%s", tmp, ++ quote ? "\"" : "", ++ h, ++ quote ? "\"" : ""); ++ }; ++ h = tmp + 1; ++ } else { ++ i=(*c -'1'); ++ if (!(h=argument[i])) h=""; ++ } + } + break; + case 'z': +@@ -791,6 +810,7 @@ + } + c++; + if (!skip_escape) out_html(h); ++ if (tmp) free(tmp); + return c; + } + diff --git a/SOURCES/man2html-c99.patch b/SOURCES/man2html-c99.patch new file mode 100644 index 0000000..e5c9254 --- /dev/null +++ b/SOURCES/man2html-c99.patch @@ -0,0 +1,15 @@ +Include for the strcmp function. This avoids an implicit +function declaration and build failures with future compilers that no +longer support them by default. + +diff -ur man-1.6g.orig/src/makemsg.c man-1.6g/src/makemsg.c +--- man-1.6g.orig/src/makemsg.c 2006-08-02 20:11:44.000000000 +0200 ++++ man-1.6g/src/makemsg.c 2023-02-07 19:14:51.354523820 +0100 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #ifdef __QNX__ + #include + #endif diff --git a/SOURCES/man2html-cgi.patch b/SOURCES/man2html-cgi.patch new file mode 100644 index 0000000..f4c9db6 --- /dev/null +++ b/SOURCES/man2html-cgi.patch @@ -0,0 +1,92 @@ +Only in ./debian/patches: man2html-double-quotes.patch +diff -ur ../man2html-deb.orig/debian/sources/Makefile ./debian/sources/Makefile +--- ../man2html-deb.orig/debian/sources/Makefile 2011-11-02 12:45:37.000000000 -0700 ++++ ./debian/sources/Makefile 2011-12-15 05:31:23.702465064 -0700 +@@ -2,15 +2,15 @@ + # $Id: Makefile 241 2011-01-09 20:55:40Z robert $ + # + CC = gcc +-CGI_DIR = $(PREFIX)/usr/lib/cgi-bin/man ++CGI_DIR = $(PREFIX)/usr/lib/man2html/cgi-bin/man + SHARE_DIR = $(PREFIX)/usr/share/man2html +-DOC_DIR = $(PREFIX)/usr/share/doc/man2html-base ++DOC_DIR = $(PREFIX)/usr/share/doc/man2html + +-CGIBASE = /cgi-bin/man +-MAN_CONFIG = /etc/manpath.config ++CGIBASE = /man ++MAN_CONFIG = /etc/man_db.conf + + DEFINES = -DMAN_CONFIG='"$(MAN_CONFIG)"' +-CFLAGS = -pipe -g -Wall -Wextra $(DEFINES) $(DEBIAN_CFLAGS) ++CFLAGS += -pipe -g -Wall -Wextra $(DEFINES) + + # + # Installer program: +@@ -32,13 +32,12 @@ + $(CC) $(CFLAGS) $^ -o $@ + + install: targets ++ mkdir -p $(CGI_DIR) ++ mkdir -p $(SHARE_DIR) ++ mkdir -p $(DOC_DIR) + $(INSTALL) -p -m 0755 man2html.cgi $(CGI_DIR)/man2html +- $(INSTALL) -p -m 0755 mansearch $(CGI_DIR) + $(INSTALL) -p -m 0755 manwhatis $(CGI_DIR) + ln $(CGI_DIR)/manwhatis $(CGI_DIR)/mansec +- $(INSTALL) -p -m0644 swish++.conf $(SHARE_DIR) +- $(INSTALL) -p -m0644 man.html $(DOC_DIR)/html +- + + clean: + rm -f *.o *~ core manwhatis mansec man2html.cgi +Only in ./debian/sources: Makefile~ +diff -ur ../man2html-deb.orig/debian/sources/man2html.cgi.c ./debian/sources/man2html.cgi.c +--- ../man2html-deb.orig/debian/sources/man2html.cgi.c 2011-11-02 12:45:37.000000000 -0700 ++++ ./debian/sources/man2html.cgi.c 2011-12-15 05:23:34.806269725 -0700 +@@ -41,11 +41,11 @@ + #endif + + #ifndef CGIBASE +-#define CGIBASE "/cgi-bin/man" ++#define CGIBASE "/man" + #endif + + #ifndef LYNXCGIBASE +-#define LYNXCGIBASE "lynxcgi:/usr/lib/cgi-bin/man" ++#define LYNXCGIBASE "lynxcgi:/usr/lib/man2html/cgi-bin/man" + #endif + + +diff -ur ../man2html-deb.orig/debian/sources/man.html ./debian/sources/man.html +--- ../man2html-deb.orig/debian/sources/man.html 2011-11-02 12:45:37.000000000 -0700 ++++ ./debian/sources/man.html 2011-12-15 05:13:46.492823889 -0700 +@@ -13,12 +13,10 @@ + Depending on how you are accessing this file you are now reading, at least one of + the following URL should work: + +-

+-Please see the /usr/share/doc/man2html/README.Debian file for more details. + + +diff -ur ../man2html-deb.orig/debian/sources/manwhatis.c ./debian/sources/manwhatis.c +--- ../man2html-deb.orig/debian/sources/manwhatis.c 2011-11-02 12:45:37.000000000 -0700 ++++ ./debian/sources/manwhatis.c 2011-12-15 05:24:06.484620719 -0700 +@@ -38,8 +38,8 @@ + + #define MAX 10000 + +-#define CGIBASE "/cgi-bin/man" +-#define LYNXCGIBASE "lynxcgi:/usr/lib/cgi-bin/man" ++#define CGIBASE "/man" ++#define LYNXCGIBASE "lynxcgi:/usr/lib/man2html/cgi-bin/man" + + enum {mansec, manwhatis} called_as=manwhatis; + char manpath[200]; diff --git a/SOURCES/man2html-configure-c99.patch b/SOURCES/man2html-configure-c99.patch new file mode 100644 index 0000000..a2429a7 --- /dev/null +++ b/SOURCES/man2html-configure-c99.patch @@ -0,0 +1,86 @@ +Avoid implicit ints and implicit function declarations during the +(non-autoconf) build environment probing stage. + +This prevents build failures with future compilers. + +diff -ur man-1.6g.orig/configure man-1.6g/configure +--- man-1.6g.orig/configure 2010-12-31 21:28:46.000000000 +0100 ++++ man-1.6g/configure 2023-02-07 19:08:27.312390739 +0100 +@@ -223,7 +223,7 @@ + echo checking for ANSI C header files + echo "#include + #include +-main() { exit(0); strerror(0); }" > conftest.c ++int main(void) { exit(0); strerror(0); }" > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then + DEFS="$DEFS -DSTDC_HEADERS" +@@ -236,7 +236,7 @@ + + echo checking for sys/termios.h + echo "#include +-main() { exit(0); }" > conftest.c ++int main(void) { return 0; }" > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then + DEFS="$DEFS -DTERMIOS_HEADER" +@@ -245,11 +245,11 @@ + + echo checking for POSIX.1 header files + echo "#include +-main() { ++int main(void) { + #ifdef _POSIX_VERSION +-exit(0); ++return 0; + #else +-exit(1); ++return 1; + #endif + }" > conftest.c + eval $compile +@@ -260,7 +260,7 @@ + + echo checking for BSD string and memory functions + echo "#include +-main() { exit(0); rindex(0, 0); bzero(0, 0); }" > conftest.c ++int main(void) { return 0; rindex(0, 0); bzero(0, 0); }" > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then : + else DEFS="$DEFS -DUSG" +@@ -269,7 +269,7 @@ + + echo checking whether sys/types.h defines uid_t + echo '#include +-main() { uid_t x; exit(0); }' > conftest.c ++int main(void) { uid_t x; return 0; }' > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then : + else +@@ -302,7 +302,7 @@ + #endif + #endif + #endif +-main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c ++int main(void) { char *p = (char *) alloca(1); return 0; }' > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then : + elif test -d /usr/ucblib; then LIBS="$LIBS -L/usr/ucblib -lucb" +@@ -314,7 +314,7 @@ + if [ $usenls = true ]; then + echo checking for nls + echo '#include +- main() {nl_catd catfd; exit(0); }' > conftest.c ++ int main(void) {nl_catd catfd; return 0; }' > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then : + else +@@ -332,7 +332,7 @@ + #include + #include + struct option long_opts[] = { { "", no_argument, NULL, 0 } }; +-main() { exit(0); }' > conftest.c ++int main(void) { return 0; }' > conftest.c + eval $compile + if test -s conftest && ./conftest 2>/dev/null; then + manpathoption="--path" diff --git a/SOURCES/man2html-doc.patch b/SOURCES/man2html-doc.patch new file mode 100644 index 0000000..09a2e86 --- /dev/null +++ b/SOURCES/man2html-doc.patch @@ -0,0 +1,84 @@ +diff -ur ../man-1.6g-orig/man2html/hman.1 ./man2html/hman.1 +--- ../man-1.6g-orig/man2html/hman.1 2007-12-31 14:27:36.000000000 -0700 ++++ ./man2html/hman.1 2012-05-11 17:19:30.614092335 -0700 +@@ -33,13 +33,15 @@ + .SH OPTIONS + .TP + .B \-\^P " browser" +-Specify which browser (like lynx, xmosaic, arena, chimera, +-netscape, amaya, ...) to use. ++Specify which browser (like lynx, elinks, firefox, or chromium-browser, ...) ++to use. + This option overrides the + .B MANHTMLPAGER + environment variable. +-The default is the non-httpd version of +-.BR lynx . ++Otherwise, ++.B hman ++will use your system's default browser via ++.BR xdg-open (1) . + .TP + .B \-\^H " host" + Specify from what host to get the man pages. +@@ -60,10 +62,3 @@ + .SH "SEE ALSO" + .BR man (1), + .BR man2html (1), +-.BR arena (1), +-.BR lynx (1), +-.BR netscape (1), +-.BR xmosaic (1), +-.BR glimpse (1) +- +-http://www.mcom.com/newsref/std/x-remote.html +diff -ur ../man-1.6g-orig/man2html/man2html.1 ./man2html/man2html.1 +--- ../man-1.6g-orig/man2html/man2html.1 2007-12-31 14:27:36.000000000 -0700 ++++ ./man2html/man2html.1 2012-05-11 17:13:59.360876849 -0700 +@@ -39,7 +39,7 @@ + .LP + .TS + l l. +-foo(3x) "http://localhost/cgi-bin/man/man2html?3x+foo" ++foo(3x) "http://localhost/man/man2html?3x+foo" + method://string "method://string" + www.host.name "http://www.host.name" + ftp.host.name "ftp://ftp.host.name" +@@ -87,7 +87,7 @@ + .TP + .B \-\^l + Set method:cgipath to +-.RI lynxcgi: /home/httpd . ++.RI lynxcgi: /usr/lib/man2html . + .TP + .BI \-\^L " dir" + Set method:cgipath to +@@ -95,7 +95,7 @@ + .TP + .BI \-\^M " man2htmlpath" + Set the man2htmlpath to use. The default is +-.IR /cgi-bin/man/man2html . ++.IR /man/man2html . + .TP + .B \-\^p + Set separator to '/'. +@@ -114,7 +114,7 @@ + When some http daemon is running, lynx, or any other browser, + can be used to browse the man pages, using the http method. + The option \-l (for `lynxcgi') selects the former behaviour. +-With it, the default cgipath is \fI/home/httpd\fP. ++With it, the default cgipath is \fI/usr/lib/man2html\fP. + + In general, a cgi script can be called by + .IP +@@ -137,8 +137,8 @@ + + .SH BUGS + There are many heuristics. The output will not always be perfect. +-The lynxcgi method will not work if lynx was compiled without +-selecting support for it. There may be problems with security. ++The lynxcgi method will not work if lynx is not configured for it. ++There may be problems with security. + + .SH AUTHOR + Richard Verhoeven was the original author of diff --git a/SOURCES/man2html-double-quotes.patch b/SOURCES/man2html-double-quotes.patch new file mode 100644 index 0000000..97ee3a4 --- /dev/null +++ b/SOURCES/man2html-double-quotes.patch @@ -0,0 +1,32 @@ +Properly decode double quotes inside the quoted text (closes: #406098). + +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/man2html.c man-1.6e/man2html/man2html.c +--- man-1.6e-old/man2html/man2html.c 2007-04-20 10:55:11.000000000 +0200 ++++ man-1.6e/man2html/man2html.c 2007-04-20 11:03:54.000000000 +0200 +@@ -1307,7 +1307,7 @@ + */ + static char * + fill_words(char *str, char *words[], int maxn, int *n, char eow) { +- char *s = str; ++ char *s = str, *t; + int backslash = 0; + int skipspace = 0; /* 1 if space is not end-of-word */ + +@@ -1316,8 +1316,15 @@ + while (*s && (*s != '\n' || backslash)) { + if (!backslash) { + if (*s == '"') { +- *s = '\a'; +- skipspace = !skipspace; ++ if (skipspace && *(s+1) == '"') { ++ /* "" inside the quoted text means " */ ++ for (t = s++; t > words[*n]; t--) ++ *t = *(t-1); ++ words[*n]++; ++ } else { ++ *s = '\a'; ++ skipspace = !skipspace; ++ } + } else if (*s == escapesym) { + backslash = 1; + } else if ((*s == ' ' || *s == '\t') && !skipspace) { diff --git a/SOURCES/man2html-escape-N.patch b/SOURCES/man2html-escape-N.patch new file mode 100644 index 0000000..b5f46ff --- /dev/null +++ b/SOURCES/man2html-escape-N.patch @@ -0,0 +1,35 @@ +Add support for \N'n' groff sequences (closes: #348553). + +diff -ruN man-1.6c-old/man2html/man2html.c man-1.6c/man2html/man2html.c +--- man-1.6c-old/man2html/man2html.c 2006-02-09 19:19:09.000000000 +0100 ++++ man-1.6c/man2html/man2html.c 2006-02-09 19:17:53.000000000 +0100 +@@ -511,7 +511,7 @@ + static char * + scan_escape(char *c) { + char *h=NULL; +- char b[5]; ++ char b[10]; + INTDEF *intd; + int exoutputp,exskipescape; + int i,j; +@@ -661,6 +661,20 @@ + output_possible=exoutputp; + skip_escape=exskipescape; + break; ++ case 'N': ++ /* convert \N'ddd' into &#ddd; */ ++ c++; ++ i=*c; ++ j=0; ++ b[j++] = '&'; ++ b[j++] = '#'; ++ while (*(++c) != i) ++ if (isdigit(*c) && j < sizeof(b) - 2) ++ b[j++] = *c; ++ b[j++] = ';'; ++ b[j] = '\0'; ++ h = b; ++ break; + case 'c': no_newline_output=1; break; + case '{': newline_for_fun++; h="";break; + case '}': if (newline_for_fun) newline_for_fun--; h="";break; diff --git a/SOURCES/man2html-file-link.patch b/SOURCES/man2html-file-link.patch new file mode 100644 index 0000000..5421943 --- /dev/null +++ b/SOURCES/man2html-file-link.patch @@ -0,0 +1,29 @@ +diff -Nur ../man-1.6g.orig/man2html/cgibase.c ./man2html/cgibase.c +--- ../man-1.6g.orig/man2html/cgibase.c 2005-08-20 16:26:06.000000000 -0700 ++++ ./man2html/cgibase.c 2011-12-15 02:45:00.826764389 -0700 +@@ -97,7 +97,7 @@ + + void + include_file_html(char *g) { +- printf("%s>", g,g); ++ printf("%s>", g,g); + } + + void +diff -Nur ../man-1.6g.orig/man2html/man2html.c ./man2html/man2html.c +--- ../man-1.6g.orig/man2html/man2html.c 2007-08-05 12:15:23.000000000 -0700 ++++ ./man2html/man2html.c 2011-12-15 02:45:00.837764508 -0700 +@@ -116,11 +116,11 @@ + ** www.host.name -> http://www.host.name + ** ftp.host.name -> ftp://ftp.host.name + ** name@host -> mailto:name@host +- ** -> file:/usr/include/name.h (guess) ++ ** -> file:///usr/include/name.h (guess) + ** + ** Other possible links to add in the future: + ** +- ** /dir/dir/file -> file:/dir/dir/file ++ ** /dir/dir/file -> file:///dir/dir/file + */ + int i,j,nr; + char *f, *g, *h; diff --git a/SOURCES/man2html-format.patch b/SOURCES/man2html-format.patch new file mode 100644 index 0000000..35ace37 --- /dev/null +++ b/SOURCES/man2html-format.patch @@ -0,0 +1,20 @@ +--- ./debian.orig/sources/manwhatis.c 2011-11-02 12:45:37.000000000 -0700 ++++ ./debian/sources/manwhatis.c 2012-05-13 15:15:40.690492812 -0700 +@@ -291,7 +291,7 @@ + fputs("

",f); + for(j=33; j%c\n",j,j); ++ fprintf(f,"%c\n",(char)j,(char)j); + fprintf(f,"
Section index\n", cgibase); + fputs("
\n
\n",f); + +@@ -337,7 +337,7 @@ + fputs("
\n
\n",f); + for(j=0; j< sizeof(usedletters); j++) + if(usedletters[j]) +- fprintf(f,"%c\n",j,j); ++ fprintf(f,"%c\n",(char)j,(char)j); + fputs("
\n",f); + + fprintf(f,"\n\n"); diff --git a/SOURCES/man2html-gcc-warnings.patch b/SOURCES/man2html-gcc-warnings.patch new file mode 100644 index 0000000..8b94928 --- /dev/null +++ b/SOURCES/man2html-gcc-warnings.patch @@ -0,0 +1,85 @@ +Fix some gcc warnings. + +Index: man-1.6g/man2html/cgibase.c +=================================================================== +--- man-1.6g.orig/man2html/cgibase.c 2011-01-09 17:49:52.000000000 +0100 ++++ man-1.6g/man2html/cgibase.c 2011-01-09 17:51:03.000000000 +0100 +@@ -82,13 +82,13 @@ + { + char timebuf[TIMEBUFSZ]; + struct tm *timetm; +- time_t clock; ++ time_t now; + + timebuf[0] = 0; + #ifdef TIMEFORMAT + sprintf(timebuf, "Time: "); +- clock=time(NULL); +- timetm=gmtime(&clock); ++ now=time(NULL); ++ timetm=gmtime(&now); + strftime(timebuf+6, TIMEBUFSZ-6, TIMEFORMAT, timetm); + timebuf[TIMEBUFSZ-1] = 0; + #endif +Index: man-1.6g/man2html/man2html.c +=================================================================== +--- man-1.6g.orig/man2html/man2html.c 2011-01-09 17:49:52.000000000 +0100 ++++ man-1.6g/man2html/man2html.c 2011-01-09 17:54:37.000000000 +0100 +@@ -644,7 +644,7 @@ + *tmp = 0; + + for (i = 0; ((h = argument[i])); i++) { +- sprintf(tmp, "%s %s%s%s", tmp, ++ sprintf(tmp + strlen(tmp), " %s%s%s", + quote ? "\"" : "", + h, + quote ? "\"" : ""); +@@ -1720,12 +1720,12 @@ + for (i=1; inr=i; + de->slen=0; + de->next=strdef; + de->st=NULL; + strdef=de; +- h=NULL; +- c=scan_troff(c, 1, &h); +- de->st=h; ++ hl=NULL; ++ c=scan_troff(c, 1, &hl); ++ de->st=hl; + de->slen=curpos; + } else { + if (mode) { /* .ds */ +- char *h=NULL; +- c=scan_troff(c, 1, &h); ++ char *hl=NULL; ++ c=scan_troff(c, 1, &hl); + free(de->st); /* segfault XXX */ + de->slen=curpos; +- de->st=h; ++ de->st=hl; + } else { /* .as */ + c=scan_troff(c,1,&de->st); /* XXX */ + de->slen+=curpos; diff --git a/SOURCES/man2html-groff-segfault.patch b/SOURCES/man2html-groff-segfault.patch new file mode 100644 index 0000000..5ce828b --- /dev/null +++ b/SOURCES/man2html-groff-segfault.patch @@ -0,0 +1,78 @@ +Fix segfault when viewing groff(7) page. + +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/man2html.c man-1.6e/man2html/man2html.c +--- man-1.6e-old/man2html/man2html.c 2007-04-23 17:33:44.000000000 +0200 ++++ man-1.6e/man2html/man2html.c 2007-04-23 17:33:45.000000000 +0200 +@@ -1673,7 +1673,7 @@ + + int i,j,mode = 0; + char *h; +- char *wordlist[20]; ++ char *wordlist[30]; + int words; + char *sl; + LONGSTRDEF *owndef; +@@ -1713,7 +1713,7 @@ + if (mandoc_command) + scan_troff_mandoc(wordlist[i],1,&h); + else +- scan_troff(wordlist[i],1,&h); ++ scan_troff(wordlist[i],2,&h); + wordlist[i]=h; + } + for (i=words; ist[deflen+1]=0; + *sl='\n'; + } else switch (i) { + case V('a','b'): +@@ -2426,12 +2427,13 @@ + j=3; + } + c=sl+1; ++ *sl=0; + sl=c; + while (*c && strncmp(c,wordlist[1],j)) c=skip_till_newline(c); + de = find_longstrdef(defdef, i, longname, &longname); + if (mode && de) olen=strlen(de->st); + j=olen+c-sl; +- h= (char*) xmalloc((j*2+4)*sizeof(char)); ++ h= (char*) xmalloc((j*2+5)*sizeof(char)); + if (h) { + for (j=0; jst[j]; +@@ -2452,6 +2454,7 @@ + de = (LONGSTRDEF*) xmalloc(sizeof(LONGSTRDEF)); + de->nr=i; + de->longname=longname; ++ de->slen=0; + de->next=defdef; + de->st=h; + defdef=de; +@@ -2997,12 +3000,12 @@ + h++; + FLUSHIBP; + h = scan_escape(h); +- } else if (*h == controlsym && h[-1] == '\n') { ++ } else if (san != 2 && *h == controlsym && h[-1] == '\n') { + h++; + FLUSHIBP; + h = scan_request(h); + if (san && h[-1] == '\n') h--; +- } else if (mandoc_line ++ } else if (san != 2 && mandoc_line + && *(h) && isupper(*(h)) + && *(h+1) && islower(*(h+1)) + && *(h+2) && isspace(*(h+2))) { +@@ -3010,7 +3013,7 @@ + FLUSHIBP; + h = scan_request(h); + if (san && h[-1] == '\n') h--; +- } else if (*h == nobreaksym && h[-1] == '\n') { ++ } else if (san != 2 && *h == nobreaksym && h[-1] == '\n') { + h++; + FLUSHIBP; + h = scan_request(h); diff --git a/SOURCES/man2html-hman-bashism.patch b/SOURCES/man2html-hman-bashism.patch new file mode 100644 index 0000000..3459a4b --- /dev/null +++ b/SOURCES/man2html-hman-bashism.patch @@ -0,0 +1,14 @@ +Remove bashism from hman + +diff -ruN man-1.6c-old/man2html/hman.sh man-1.6c/man2html/hman.sh +--- man-1.6c-old/man2html/hman.sh 2003-03-11 16:53:29.000000000 +0100 ++++ man-1.6c/man2html/hman.sh 2004-07-27 22:17:05.000000000 +0200 +@@ -42,7 +42,7 @@ + fi + + # Interface to a live (already running) netscape browser. +-function nsfunc () { ++nsfunc () { + if ( /bin/ps xc | grep -q 'netscape$' ) ; then + if [ -x netscape-remote ] ; then + exec netscape-remote -remote "openURL($1,new_window)" diff --git a/SOURCES/man2html-hman-section.patch b/SOURCES/man2html-hman-section.patch new file mode 100644 index 0000000..c9d972e --- /dev/null +++ b/SOURCES/man2html-hman-section.patch @@ -0,0 +1,20 @@ +--- ../man-1.6g-orig/man2html/hman.sh 2005-08-20 16:26:06.000000000 -0700 ++++ ./man2html/hman.sh 2012-05-24 17:00:56.488558100 -0700 +@@ -72,7 +72,7 @@ + 0) $BROWSER $CG/man2html ;; + 1) case "$1" in + 1|2|3|4|5|6|7|8|l|n) +- $BROWSER "$CG/mansec?$CG+$1" ;; ++ $BROWSER "$CG/mansec?$1" ;; + /*) + $BROWSER "$CG/man2html?$1" ;; + */*) +@@ -85,7 +85,7 @@ + $BROWSER "$CG/mansearch?$2" ;; + *) + if [ "$2" = index ]; then +- $BROWSER "$CG/manwhatis?$CG+$1" ++ $BROWSER "$CG/manwhatis?$1" + else + $BROWSER "$CG/man2html?$1+$2" + fi ;; diff --git a/SOURCES/man2html-hman.patch b/SOURCES/man2html-hman.patch new file mode 100644 index 0000000..0196284 --- /dev/null +++ b/SOURCES/man2html-hman.patch @@ -0,0 +1,33 @@ +--- ../man-1.6g-orig/man2html/hman.sh 2005-08-20 16:26:06.000000000 -0700 ++++ ./man2html/hman.sh 2012-05-11 17:04:07.750683958 -0700 +@@ -22,9 +22,9 @@ + exit 0 + fi + +-# The user has to set MANHTMLPAGER (or he will get httpd-free lynx). +-# Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ... +-BROWSER=${MANHTMLPAGER-lynxcgi} ++# The user has to set MANHTMLPAGER (or they will get default via `xdg-open`). ++# Pick your favorite browser: lynx, elinks, firefox, chromium, etc. ... ++BROWSER=${MANHTMLPAGER-xdg-open} + # + # If the man pages are on a remote host, specify it in MANHTMLHOST. + HOST=${MANHTMLHOST-localhost} +@@ -57,14 +57,14 @@ + case $BROWSER in + lynxcgi) + BROWSER=lynx +- CG="lynxcgi:/home/httpd/cgi-bin/man" ++ CG="lynxcgi:/usr/lib/man2html/cgi-bin/man" + ;; + netscape) + BROWSER=nsfunc +- CG="http://$HOST/cgi-bin/man" ++ CG="http://$HOST/man" + ;; + *) +- CG="http://$HOST/cgi-bin/man" ++ CG="http://$HOST/man" + ;; + esac + diff --git a/SOURCES/man2html-it-typo.patch b/SOURCES/man2html-it-typo.patch new file mode 100644 index 0000000..7a80c1a --- /dev/null +++ b/SOURCES/man2html-it-typo.patch @@ -0,0 +1,14 @@ +Fix syntax error in the Italian man2html(1) page. + +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/locales/it/man2html.1 man-1.6e/man2html/locales/it/man2html.1 +--- man-1.6e-old/man2html/locales/it/man2html.1 2006-08-02 20:33:41.000000000 +0200 ++++ man-1.6e/man2html/locales/it/man2html.1 2007-02-01 22:34:53.000000000 +0100 +@@ -62,7 +62,7 @@ + + .SH OPZIONI + Quando si legge da stdin non è sempre chiaro come effettuare l'espansione +-.so . L'opzione \-D permette a uno script di definire la ++\&.so . L'opzione \-D permette a uno script di definire la + directory di lavoro. + .LP + .TP diff --git a/SOURCES/man2html-localized-manpage-paths.patch b/SOURCES/man2html-localized-manpage-paths.patch new file mode 100644 index 0000000..38f2304 --- /dev/null +++ b/SOURCES/man2html-localized-manpage-paths.patch @@ -0,0 +1,78 @@ +diff -ru ../man-1.6g/man2html/locales/fr/man2html.1 ./man2html/locales/fr/man2html.1 +--- ../man-1.6g/man2html/locales/fr/man2html.1 2006-01-25 18:20:42.000000000 -0500 ++++ ./man2html/locales/fr/man2html.1 2012-07-16 06:38:00.729431350 -0400 +@@ -45,7 +45,7 @@ + .LP + .TS + l l. +-foo(3x) "http://localhost/cgi-bin/man/man2html?3x+foo" ++foo(3x) "http://localhost/man/man2html?3x+foo" + method://string "method://string" + www.host.name "http://www.host.name" + ftp.host.name "ftp://ftp.host.name" +@@ -94,7 +94,7 @@ + .TP + .B \-\^l + Positionner method:cgipath à +-.RI lynxcgi: /home/httpd . ++.RI lynxcgi: /usr/lib/man2html . + .TP + .BI \-\^L " dir" + Positionner method:cgipath à +@@ -102,7 +102,7 @@ + .TP + .BI \-\^M " man2htmlpath" + Positionner le chemin vers man2html à utiliser. La valeur par défaut est +-.IR /cgi-bin/man/man2html . ++.IR /man/man2html . + .TP + .B \-\^p + Positionner le séparateur à «\ /\ ». +@@ -122,7 +122,7 @@ + quel autre navigateur pour parcourir les pages de manuel en utilisant + la méthode http. + L'option \-l (pour «\ lynxcgi\ ») sélectionne ce fonctionnement. +-Avec elle, le chemin cgi par défaut est \fI/home/httpd\fP. ++Avec elle, le chemin cgi par défaut est \fI/usr/lib/man2html\fP. + + En général, un script cgi peut être appelé de la façon suivante + .IP +diff -ru ../man-1.6g/man2html/locales/it/man2html.1 ./man2html/locales/it/man2html.1 +--- ../man-1.6g/man2html/locales/it/man2html.1 2006-08-02 14:33:41.000000000 -0400 ++++ ./man2html/locales/it/man2html.1 2012-07-16 06:42:38.028418717 -0400 +@@ -44,7 +44,7 @@ + .LP + .TS + l l. +-foo(3x) "http://localhost/cgi-bin/man/man2html?3x+foo" ++foo(3x) "http://localhost/man/man2html?3x+foo" + method://string "method://string" + www.host.name "http://www.host.name" + ftp.host.name "ftp://ftp.host.name" +@@ -94,7 +94,7 @@ + .TP + .B \-\^l + Set method:cgipath to +-.RI lynxcgi: /home/httpd . ++.RI lynxcgi: /usr/lib/man2html . + .TP + .BI \-\^L " dir" + Set method:cgipath to +@@ -102,7 +102,7 @@ + .TP + .BI \-\^M " man2htmlpath" + Imposta il man2htmlpath da usare. Il valore predefinito è +-.IR /cgi-bin/man/man2html . ++.IR /man/man2html . + .TP + .B \-\^p + Imposta '/' come separatore. +@@ -121,7 +121,7 @@ + Quando è attivo qualche demone http, lynx, o qualunque altro browser, + può essere usato per navigare le man page, usando il metodo http. + L'opzione \-l (per `lynxcgi') seleziona il comportamento precedente. +-Con esso, il valore predefinito di cgipath è \fI/home/httpd\fP. ++Con esso, il valore predefinito di cgipath è \fI/usr/lib/man2html\fP. + + In generale, uno script cgi può essere chiamato da + .IP diff --git a/SOURCES/man2html-macro-longnames.patch b/SOURCES/man2html-macro-longnames.patch new file mode 100644 index 0000000..e6ff217 --- /dev/null +++ b/SOURCES/man2html-macro-longnames.patch @@ -0,0 +1,146 @@ +Support macro names longer than two chars (closes: #408232). + +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/defs.h man-1.6e/man2html/defs.h +--- man-1.6e-old/man2html/defs.h 2005-08-21 01:26:06.000000000 +0200 ++++ man-1.6e/man2html/defs.h 2007-04-20 11:41:55.000000000 +0200 +@@ -8,6 +8,15 @@ + STRDEF *next; + }; + ++typedef struct LONGSTRDEF LONGSTRDEF; ++struct LONGSTRDEF { ++ int nr,slen; ++ char *longname; ++ char *st; ++ LONGSTRDEF *next; ++}; ++ ++ + typedef struct INTDEF INTDEF; + struct INTDEF { + int nr; +@@ -16,12 +25,14 @@ + INTDEF *next; + }; + +-extern STRDEF *chardef, *strdef, *defdef; ++extern STRDEF *chardef, *strdef; ++extern LONGSTRDEF *defdef; + extern INTDEF *intdef; + + #define V(A,B) ((A)*256+(B)) + + #include ++extern LONGSTRDEF *find_longstrdef(LONGSTRDEF* head, int nr, char * longname, char ** out_longname); + extern void stdinit(void); + extern void print_sig(void); + extern char *lookup_abbrev(char *); +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/man2html.c man-1.6e/man2html/man2html.c +--- man-1.6e-old/man2html/man2html.c 2007-04-20 11:40:27.000000000 +0200 ++++ man-1.6e/man2html/man2html.c 2007-04-20 11:43:40.000000000 +0200 +@@ -1676,7 +1676,7 @@ + char *wordlist[20]; + int words; + char *sl; +- STRDEF *owndef; ++ LONGSTRDEF *owndef; + + while (*c == ' ' || *c == '\t') + c++; +@@ -2378,11 +2378,13 @@ + /* .de xx yy : define or redefine macro xx; end at .yy (..) */ + /* define or handle as .ig yy */ + { +- STRDEF *de; ++ LONGSTRDEF *de; ++ char *longname; + int olen=0; + c=c+j; + sl=fill_words(c, wordlist, SIZE(wordlist), &words, '\n'); + i=V(c[0],c[1]);j=2; ++ longname = c; + if (words == 1) wordlist[1]=".."; else { + wordlist[1]--; + wordlist[1][0]='.'; +@@ -2391,8 +2393,7 @@ + c=sl+1; + sl=c; + while (*c && strncmp(c,wordlist[1],j)) c=skip_till_newline(c); +- de=defdef; +- while (de && de->nr!= i) de=de->next; ++ de = find_longstrdef(defdef, i, longname, &longname); + if (mode && de) olen=strlen(de->st); + j=olen+c-sl; + h= (char*) xmalloc((j*2+4)*sizeof(char)); +@@ -2413,8 +2414,9 @@ + if (de->st) free(de->st); + de->st=h; + } else { +- de = (STRDEF*) xmalloc(sizeof(STRDEF)); ++ de = (LONGSTRDEF*) xmalloc(sizeof(LONGSTRDEF)); + de->nr=i; ++ de->longname=longname; + de->next=defdef; + de->st=h; + defdef=de; +@@ -2893,13 +2895,12 @@ + + default: + /* search macro database of self-defined macros */ +- owndef = defdef; +- while (owndef && owndef->nr!=i) owndef=owndef->next; ++ owndef = find_longstrdef(defdef, i, c, NULL); + if (owndef) { + char **oldargument; + int deflen; + int onff; +- sl=fill_words(c+j, wordlist, SIZE(wordlist), &words, '\n'); ++ sl=fill_words(c+strlen(owndef->longname), wordlist, SIZE(wordlist), &words, '\n'); + c=sl+1; + *sl=0; + for (i=1; i ++#include + + #ifndef NULL + #define NULL ((void *) 0) +@@ -9,7 +11,8 @@ + #define NROFF (-666) + #define TROFF (-667) + +-STRDEF *chardef, *strdef, *defdef; ++STRDEF *chardef, *strdef; ++LONGSTRDEF *defdef; + INTDEF *intdef; + + static INTDEF standardint[] = { +@@ -178,3 +181,24 @@ + intdef = &standardint[0]; + defdef = NULL; + } ++ ++ ++LONGSTRDEF* find_longstrdef(LONGSTRDEF * head, int nr, char * longname, char ** out_longname) ++{ ++ char *p, c; ++ LONGSTRDEF *de; ++ ++ p = longname; ++ while (p && !isspace(*p)) p++; ++ c = *p; ++ *p = 0; ++ ++ de = head; ++ while (de && (de->nr != nr || (de->longname && strcmp(longname, de->longname)))) ++ de = de->next; ++ ++ if (out_longname) ++ *out_longname = de ? de->longname : xstrdup(longname); ++ *p = c; ++ return de; ++} diff --git a/SOURCES/man2html-macro-priority.patch b/SOURCES/man2html-macro-priority.patch new file mode 100644 index 0000000..40c7cf1 --- /dev/null +++ b/SOURCES/man2html-macro-priority.patch @@ -0,0 +1,94 @@ +Parse user-defined macros before the global ones (closes: #5587). + +Index: man-1.6g/man2html/man2html.c +=================================================================== +--- man-1.6g.orig/man2html/man2html.c 2011-01-09 11:20:58.000000000 +0100 ++++ man-1.6g/man2html/man2html.c 2011-01-09 11:21:22.000000000 +0100 +@@ -1697,7 +1697,42 @@ + c = scan_escape(c+1); + } else { + i=V(c[0],c[1]); +- switch (i) { ++ /* search macro database of self-defined macros */ ++ owndef = find_longstrdef(defdef, i, c, NULL); ++ if (owndef) { ++ char **oldargument; ++ int deflen; ++ int onff; ++ sl=fill_words(c+strlen(owndef->longname), wordlist, SIZE(wordlist), &words, '\n'); ++ c=sl+1; ++ *sl=0; ++ for (i=1; ist); ++ owndef->st[deflen+1]='a'; ++ for (i=0; (owndef->st[deflen+2+i] = owndef->st[i]); i++); ++ oldargument=argument; ++ argument=wordlist; ++ onff=newline_for_fun; ++ if (mandoc_command) ++ scan_troff_mandoc(owndef->st+deflen+2, 0, NULL); ++ else ++ scan_troff(owndef->st+deflen+2, 0, NULL); ++ newline_for_fun=onff; ++ argument=oldargument; ++ for (i=0; ilongname), wordlist, SIZE(wordlist), &words, '\n'); +- c=sl+1; +- *sl=0; +- for (i=1; ist); +- owndef->st[deflen+1]='a'; +- for (i=0; (owndef->st[deflen+2+i] = owndef->st[i]); i++); +- oldargument=argument; +- argument=wordlist; +- onff=newline_for_fun; +- if (mandoc_command) +- scan_troff_mandoc(owndef->st+deflen+2, 0, NULL); +- else +- scan_troff(owndef->st+deflen+2, 0, NULL); +- newline_for_fun=onff; +- argument=oldargument; +- for (i=0; i"); + break; ++ case V('P',' '): ++ case V('P','\n'): + case V('L','P'): + case V('P','P'): + dl_end(); +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/strdefs.c man-1.6e/man2html/strdefs.c +--- man-1.6e-old/man2html/strdefs.c 2007-04-24 22:19:45.000000000 +0200 ++++ man-1.6e/man2html/strdefs.c 2007-04-25 00:42:09.000000000 +0200 +@@ -28,119 +28,265 @@ + { 0, 0, 0, NULL } }; + + static STRDEF standardstring[] = { ++ { V('<','='), 2, "<=", NULL }, /* less equal */ ++ { V('>','='), 2, ">=;", NULL }, /* greather equal */ ++ { V('A','m'), 1, "&", NULL }, /* infinity */ ++ { V('B','a'), 1, "|", NULL }, /* vartical bar */ ++ { V('G','e'), 2, ">=;", NULL }, /* greather equal */ ++ { V('G','t'), 1, ">", NULL }, /* greather than */ ++ { V('I','f'), 1, "∞", NULL }, /* infinity */ ++ { V('L','e'), 2, "<=", NULL }, /* less equal */ ++ { V('L','q'), 1, "“", NULL }, /* left double quote */ ++ { V('L','t'), 1, "<", NULL }, /* less than */ ++ { V('N','a'), 3, "NaN", NULL }, /* not a number */ ++ { V('N','e'), 2, "!=", NULL }, /* not equal */ ++ { V('P','i'), 2, "Pi", NULL }, /* pi */ ++ { V('P','m'), 1, "±", NULL }, /* plus minus */ + { V('R',' '), 1, "®", NULL }, ++ { V('R','q'), 1, "”", NULL }, /* right double quote */ ++ { V('a','a'), 1, "'", NULL }, /* accute accent */ ++ { V('g','a'), 1, "`", NULL }, /* grave accent */ + { V('l','q'), 2, "``", NULL }, ++ { V('q',' '), 1, """, NULL }, /* straight double quote */ + { V('r','q'), 2, "''", NULL }, ++ { V('u','a'), 1, "^", NULL }, /* upwards arrow */ + { 0, 0, NULL, NULL} + }; + +- + static STRDEF standardchar[] = { + { V('*','*'), 1, "*", NULL }, /* math star */ +- { V('*','A'), 1, "A", NULL }, +- { V('*','B'), 1, "B", NULL }, +- { V('*','C'), 2, "Xi", NULL }, +- { V('*','D'), 5, "Delta", NULL }, +- { V('*','E'), 1, "E", NULL }, +- { V('*','F'), 3, "Phi", NULL }, +- { V('*','G'), 5, "Gamma", NULL }, +- { V('*','H'), 5, "Theta", NULL }, +- { V('*','I'), 1, "I", NULL }, +- { V('*','K'), 1, "K", NULL }, +- { V('*','L'), 6, "Lambda", NULL }, +- { V('*','M'), 1, "M", NULL }, +- { V('*','N'), 1, "N", NULL }, +- { V('*','O'), 1, "O", NULL }, +- { V('*','P'), 2, "Pi", NULL }, +- { V('*','Q'), 3, "Psi", NULL }, +- { V('*','R'), 1, "P", NULL }, +- { V('*','S'), 5, "Sigma", NULL }, +- { V('*','T'), 1, "T", NULL }, +- { V('*','U'), 1, "Y", NULL }, +- { V('*','W'), 5, "Omega", NULL }, +- { V('*','X'), 1, "X", NULL }, +- { V('*','Y'), 1, "H", NULL }, +- { V('*','Z'), 1, "Z", NULL }, +- { V('*','a'), 5, "alpha", NULL }, +- { V('*','b'), 4, "beta", NULL }, +- { V('*','c'), 2, "xi", NULL }, +- { V('*','d'), 5, "delta", NULL }, +- { V('*','e'), 7, "epsilon", NULL }, +- { V('*','f'), 3, "phi", NULL }, +- { V('*','g'), 5, "gamma", NULL }, +- { V('*','h'), 5, "theta", NULL }, +- { V('*','i'), 4, "iota", NULL }, +- { V('*','k'), 5, "kappa", NULL }, +- { V('*','l'), 6, "lambda", NULL }, +- { V('*','m'), 1, "µ", NULL }, +- { V('*','n'), 2, "nu", NULL }, +- { V('*','o'), 1, "o", NULL }, +- { V('*','p'), 2, "pi", NULL }, +- { V('*','q'), 3, "psi", NULL }, +- { V('*','r'), 3, "rho", NULL }, +- { V('*','s'), 5, "sigma", NULL }, +- { V('*','t'), 3, "tau", NULL }, +- { V('*','u'), 7, "upsilon", NULL }, +- { V('*','w'), 5, "omega", NULL }, +- { V('*','x'), 3, "chi", NULL }, +- { V('*','y'), 3, "eta", NULL }, +- { V('*','z'), 4, "zeta", NULL }, +- { V('+','-'), 1, "±", NULL }, ++ { V('*','A'), 1, "Α", NULL }, ++ { V('*','B'), 1, "Β", NULL }, ++ { V('*','C'), 1, "Ξ", NULL }, ++ { V('*','D'), 1, "Δ", NULL }, ++ { V('*','E'), 1, "Ε", NULL }, ++ { V('*','F'), 1, "Φ", NULL }, ++ { V('*','G'), 1, "Γ", NULL }, ++ { V('*','H'), 1, "Θ", NULL }, ++ { V('*','I'), 1, "Ι", NULL }, ++ { V('*','K'), 1, "Κ", NULL }, ++ { V('*','L'), 1, "Λ", NULL }, ++ { V('*','M'), 1, "Μ", NULL }, ++ { V('*','N'), 1, "Ν", NULL }, ++ { V('*','O'), 1, "Ο", NULL }, ++ { V('*','P'), 1, "Π", NULL }, ++ { V('*','Q'), 1, "Ψ", NULL }, ++ { V('*','R'), 1, "Ρ", NULL }, ++ { V('*','S'), 1, "Σ", NULL }, ++ { V('*','T'), 1, "Τ", NULL }, ++ { V('*','U'), 1, "Υ", NULL }, ++ { V('*','W'), 1, "Ω", NULL }, ++ { V('*','X'), 1, "Χ", NULL }, ++ { V('*','Y'), 1, "Η", NULL }, ++ { V('*','Z'), 1, "Ζ", NULL }, ++ { V('*','a'), 1, "α", NULL }, ++ { V('*','b'), 1, "β", NULL }, ++ { V('*','c'), 1, "ξ", NULL }, ++ { V('*','d'), 1, "δ", NULL }, ++ { V('*','e'), 1, "ε", NULL }, ++ { V('*','f'), 1, "φ", NULL }, ++ { V('*','g'), 1, "γ", NULL }, ++ { V('*','h'), 1, "θ", NULL }, ++ { V('*','i'), 1, "ι", NULL }, ++ { V('*','k'), 1, "κ", NULL }, ++ { V('*','l'), 1, "λ", NULL }, ++ { V('*','m'), 1, "μ", NULL }, ++ { V('*','n'), 1, "ν", NULL }, ++ { V('*','o'), 1, "ο", NULL }, ++ { V('*','p'), 1, "π", NULL }, ++ { V('*','q'), 1, "ψ", NULL }, ++ { V('*','r'), 1, "ρ", NULL }, ++ { V('*','s'), 1, "σ", NULL }, ++ { V('*','t'), 1, "τ", NULL }, ++ { V('*','u'), 1, "υ", NULL }, ++ { V('*','w'), 1, "ω", NULL }, ++ { V('*','x'), 1, "χ", NULL }, ++ { V('*','y'), 1, "η", NULL }, ++ { V('*','z'), 1, "ζ", NULL }, ++ { V('\'','A'), 1, "Á", NULL }, ++ { V('\'','E'), 1, "É", NULL }, ++ { V('\'','I'), 1, "Í", NULL }, ++ { V('\'','O'), 1, "Ó", NULL }, ++ { V('\'','U'), 1, "Ú", NULL }, ++ { V('\'','Y'), 1, "Ý", NULL }, ++ { V('\'','a'), 1, "á", NULL }, ++ { V('\'','e'), 1, "é", NULL }, ++ { V('\'','i'), 1, "í", NULL }, ++ { V('\'','o'), 1, "ó", NULL }, ++ { V('\'','u'), 1, "ú", NULL }, ++ { V('\'','y'), 1, "ý", NULL }, ++ { V('!','='), 1, "≠", NULL }, ++ { V('%','0'), 1, "‰", NULL }, ++ { V('+','-'), 1, "±", NULL }, ++ { V(',','C'), 1, "Ç", NULL }, ++ { V(',','c'), 1, "ç", NULL }, ++ { V('-','>'), 1, "→", NULL }, ++ { V('-','D'), 1, "Ð", NULL }, ++ { V('.','i'), 1, "ı", NULL }, ++ { V('/','L'), 1, "Ł", NULL }, ++ { V('/','O'), 1, "Ø", NULL }, ++ { V('/','l'), 1, "ł", NULL }, ++ { V('/','o'), 1, "ø", NULL }, + { V('1','2'), 1, "½", NULL }, + { V('1','4'), 1, "¼", NULL }, + { V('3','4'), 1, "¾", NULL }, ++ { V(':','A'), 1, "Ä", NULL }, ++ { V(':','E'), 1, "Ë", NULL }, ++ { V(':','I'), 1, "Ï", NULL }, ++ { V(':','O'), 1, "Ö", NULL }, ++ { V(':','U'), 1, "Ü", NULL }, ++ { V(':','a'), 1, "ä", NULL }, ++ { V(':','e'), 1, "ë", NULL }, ++ { V(':','i'), 1, "ï", NULL }, ++ { V(':','o'), 1, "ö", NULL }, ++ { V(':','u'), 1, "ü", NULL }, ++ { V(':','y'), 1, "ÿ", NULL }, ++ { V('<','-'), 1, "←", NULL }, ++ { V('<','='), 1, "≤", NULL }, ++ { V('<','>'), 1, "↔", NULL }, ++ { V('=','='), 1, "≡", NULL }, ++ { V('=','~'), 1, "≅", NULL }, ++ { V('>','='), 1, "≥", NULL }, ++ { V('A','E'), 1, "Æ", NULL }, ++ { V('A','h'), 1, "&alepfsym;", NULL }, ++ { V('C','R'), 1, "␍", NULL }, ++ { V('C','s'), 1, "¤", NULL }, ++ { V('D','o'), 1, "$", NULL }, ++ { V('E','u'), 1, "€", NULL }, ++ { V('F','c'), 1, "»", NULL }, + { V('F','i'), 3, "ffi", NULL }, + { V('F','l'), 3, "ffl", NULL }, +- { V('a','a'), 1, "´", NULL }, +- { V('a','p'), 1, "~", NULL }, ++ { V('F','o'), 1, "«", NULL }, ++ { V('O','E'), 1, "Œ", NULL }, ++ { V('P','o'), 1, "£", NULL }, ++ { V('S','1'), 1, "¹", NULL }, ++ { V('S','2'), 1, "²", NULL }, ++ { V('S','3'), 1, "³", NULL }, ++ { V('S','d'), 1, "ð", NULL }, ++ { V('T','P'), 1, "Þ", NULL }, ++ { V('T','p'), 1, "þ", NULL }, ++ { V('Y','e'), 1, "¥", NULL }, ++ { V('^','A'), 1, "Â", NULL }, ++ { V('^','E'), 1, "Ê", NULL }, ++ { V('^','I'), 1, "Î", NULL }, ++ { V('^','O'), 1, "Ô", NULL }, ++ { V('^','U'), 1, "Û", NULL }, ++ { V('^','a'), 1, "â", NULL }, ++ { V('^','e'), 1, "ê", NULL }, ++ { V('^','i'), 1, "î", NULL }, ++ { V('^','o'), 1, "ô", NULL }, ++ { V('^','u'), 1, "û", NULL }, ++ { V('`','A'), 1, "À", NULL }, ++ { V('`','E'), 1, "È", NULL }, ++ { V('`','I'), 1, "Ì", NULL }, ++ { V('`','O'), 1, "Ò", NULL }, ++ { V('`','U'), 1, "Ù", NULL }, ++ { V('`','a'), 1, "à", NULL }, ++ { V('`','e'), 1, "è", NULL }, ++ { V('`','i'), 1, "ì", NULL }, ++ { V('`','o'), 1, "ò", NULL }, ++ { V('`','u'), 1, "ù", NULL }, ++ { V('a','a'), 1, "´", NULL }, ++ { V('a','e'), 1, "æ", NULL }, ++ { V('a','p'), 1, "≈", NULL }, ++ { V('a','q'), 1, "'", NULL }, ++ { V('a','t'), 1, "@", NULL }, ++ { V('a','~'), 1, "~", NULL }, ++ { V('b','a'), 1, "|", NULL }, ++ { V('b','b'), 1, "|", NULL }, + { V('b','r'), 1, "|", NULL }, +- { V('b','u'), 1, "*", NULL }, /* bullet */ ++ { V('b','r'), 1, "|", NULL }, ++ { V('b','u'), 1, "•", NULL }, + { V('b','v'), 1, "|", NULL }, +- { V('c','i'), 1, "o", NULL }, /* circle */ ++ { V('c','*'), 1, "⊗", NULL }, ++ { V('c','+'), 1, "⊕", NULL }, ++ { V('c','i'), 1, "○", NULL }, + { V('c','o'), 1, "©", NULL }, + { V('c','q'), 1, "'", NULL }, + { V('c','t'), 1, "¢", NULL }, ++ { V('d','A'), 1, "⇓", NULL }, ++ { V('d','a'), 1, "↓", NULL }, ++ { V('d','d'), 1, "=", NULL }, + { V('d','e'), 1, "°", NULL }, +- { V('d','g'), 1, "+", NULL }, /* dagger */ ++ { V('d','g'), 1, "-", NULL }, + { V('d','i'), 1, "÷", NULL }, ++ { V('d','q'), 1, """, NULL }, + { V('e','m'), 3, "---", NULL }, /* em dash */ + { V('e','n'), 1, "-", NULL }, /* en dash */ +- { V('e','q'), 1, "=", NULL }, ++ { V('e','q'), 1, "=", NULL }, + { V('e','s'), 1, "Ø", NULL }, ++ { V('e','u'), 1, "€", NULL }, ++ { V('f','/'), 1, "⁄", NULL }, ++ { V('f','c'), 1, "›", NULL }, + { V('f','f'), 2, "ff", NULL }, + { V('f','i'), 2, "fi", NULL }, + { V('f','l'), 2, "fl", NULL }, + { V('f','m'), 1, "´", NULL }, ++ { V('f','o'), 1, "‹", NULL }, + { V('g','a'), 1, "`", NULL }, ++ { V('h','A'), 1, "⇔", NULL }, + { V('h','y'), 1, "-", NULL }, +- { V('l','c'), 2, "|¯", NULL }, +- { V('i','f'), 8, "Infinity", NULL }, /* infinity sign */ ++ { V('i','f'), 1, "∞", NULL }, + { V('i','s'), 8, "Integral", NULL }, /* integral sign */ ++ { V('l','A'), 1, "⇐", NULL }, ++ { V('l','B'), 1, "[", NULL }, ++ { V('l','C'), 1, "{", NULL }, ++ { V('l','a'), 1, "<", NULL }, ++ { V('l','b'), 1, "[", NULL }, ++ { V('l','c'), 2, "|¯", NULL }, + { V('l','f'), 2, "|_", NULL }, ++ { V('l','h'), 1, "☚", NULL }, + { V('l','k'), 1, "{", NULL }, + { V('l','q'), 1, "\"", NULL }, ++ { V('l','z'), 1, "◊", NULL }, ++ { V('m','c'), 1, "µ", NULL }, + { V('m','i'), 1, "-", NULL }, + { V('m','u'), 1, "×", NULL }, + { V('n','o'), 1, "¬", NULL }, ++ { V('o','A'), 1, "Å", NULL }, ++ { V('o','a'), 1, "å", NULL }, ++ { V('o','e'), 1, "œ", NULL }, + { V('o','q'), 1, "'", NULL }, +- { V('o','r'), 1, "|", NULL }, ++ { V('o','r'), 1, "|", NULL }, + { V('p','d'), 1, "d", NULL }, /* partial derivative */ +- { V('p','l'), 1, "+", NULL }, ++ { V('p','l'), 1, "+", NULL }, ++ { V('p','s'), 1, "¶", NULL }, ++ { V('r','!'), 1, "¡", NULL }, ++ { V('r','?'), 1, "¿", NULL }, ++ { V('r','A'), 1, "⇒", NULL }, ++ { V('r','B'), 1, "]", NULL }, ++ { V('r','C'), 1, "}", NULL }, ++ { V('r','a'), 1, ">", NULL }, + { V('r','c'), 2, "¯|", NULL }, + { V('r','f'), 2, "_|", NULL }, + { V('r','g'), 1, "®", NULL }, ++ { V('r','h'), 1, "☛", NULL }, + { V('r','k'), 1, "}", NULL }, + { V('r','n'), 1, "¯", NULL }, + { V('r','q'), 1, "\"", NULL }, +- { V('r','u'), 1, "_", NULL }, ++ { V('r','s'), 1, "\\", NULL }, ++ { V('r','u'), 1, "_", NULL }, + { V('s','c'), 1, "§", NULL }, +- { V('s','l'), 1, "/", NULL }, +- { V('s','q'), 2, "[]", NULL }, ++ { V('s','h'), 1, "#", NULL }, ++ { V('s','l'), 1, "/", NULL }, ++ { V('s','q'), 1, "□", NULL }, ++ { V('s','s'), 1, "ß", NULL }, ++ { V('t','f'), 1, "∴", NULL }, ++ { V('t','i'), 1, "~", NULL }, ++ { V('t','m'), 1, "™", NULL }, + { V('t','s'), 1, "s", NULL }, /* should be terminal sigma */ +- { V('u','l'), 1, "_", NULL }, +- { V('>','='), 1, ">", NULL }, +- { V('<','='), 1, "<", NULL }, ++ { V('u','A'), 1, "⇑", NULL }, ++ { V('u','a'), 1, "↑", NULL }, ++ { V('u','l'), 1, "_", NULL }, ++ { V('~','A'), 1, "Ã", NULL }, ++ { V('~','N'), 1, "Ñ", NULL }, ++ { V('~','O'), 1, "Õ", NULL }, ++ { V('~','a'), 1, "ã", NULL }, ++ { V('~','n'), 1, "ñ", NULL }, ++ { V('~','o'), 1, "õ", NULL }, + { 0, 0, NULL, NULL } ++ ++ + }; + + void stdinit(void) { diff --git a/SOURCES/man2html-noindex-segfault.patch b/SOURCES/man2html-noindex-segfault.patch new file mode 100644 index 0000000..9689d19 --- /dev/null +++ b/SOURCES/man2html-noindex-segfault.patch @@ -0,0 +1,24 @@ +Fix segfault on man pages with no sections (see bug #349907). + +diff -ruN -x config.guess -x config.sub man-1.6e-old/man2html/man2html.c man-1.6e/man2html/man2html.c +--- man-1.6e-old/man2html/man2html.c 2007-01-31 01:30:17.000000000 +0100 ++++ man-1.6e/man2html/man2html.c 2007-01-31 01:30:18.000000000 +0100 +@@ -3256,11 +3256,13 @@ + out_html(NEWLINE); + if (output_possible) { + /*   for mosaic users */ +- printf("
\n 

Index

\n
\n"); +- manidx[mip]=0; +- printf("%s", manidx); +- if (subs) printf("
\n"); +- printf("\n"); ++ if (manidx) { ++ printf("
\n 

Index

\n
\n"); ++ manidx[mip]=0; ++ printf("%s", manidx); ++ if (subs) printf("
\n"); ++ printf("\n"); ++ } + print_sig(); + printf("\n\n"); + } else { diff --git a/SOURCES/man2html-paths.patch b/SOURCES/man2html-paths.patch new file mode 100644 index 0000000..c377eb5 --- /dev/null +++ b/SOURCES/man2html-paths.patch @@ -0,0 +1,28 @@ +diff -ur ../man-1.6g-orig/man2html/cgibase.c ./man2html/cgibase.c +--- ../man-1.6g-orig/man2html/cgibase.c 2005-08-20 16:26:06.000000000 -0700 ++++ ./man2html/cgibase.c 2012-05-11 16:44:18.842807125 -0700 +@@ -18,10 +18,10 @@ + /* + * Either the user is non-local (or local, but using httpd), + * in which case we use http:/cgi-bin, or the user is local +- * and uses lynx, and we use lynxcgi:/home/httpd/cgi-bin. ++ * and uses lynx, and we use lynxcgi:/usr/lib/man2html/cgi-bin. + */ + +-static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */ ++static char *man2htmlpath = "/man/man2html"; /* default */ + static char *cgibase_format = "http://%s"; /* host.domain:port */ + static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */ + static char *cgibase = "http://localhost"; /* default */ +diff -ur ../man-1.6g-orig/man2html/man2html.c ./man2html/man2html.c +--- ../man-1.6g-orig/man2html/man2html.c 2007-08-05 12:15:23.000000000 -0700 ++++ ./man2html/man2html.c 2012-05-11 16:47:46.057231585 -0700 +@@ -3109,7 +3109,7 @@ + case 'H': + set_cgibase(optarg); break; + case 'l': +- set_lynxcgibase("/home/httpd"); break; ++ set_lynxcgibase("/usr/lib/man2html"); break; + case 'L': + set_lynxcgibase(optarg); break; + case 'M': diff --git a/SOURCES/man2html-quotes.patch b/SOURCES/man2html-quotes.patch new file mode 100644 index 0000000..587bba4 --- /dev/null +++ b/SOURCES/man2html-quotes.patch @@ -0,0 +1,33 @@ +Add support for \(lq and \(rq escape sequences (closes: #338339). + +diff -Nru3 man-1.6c/man2html/strdefs.c man-1.6c/man2html/strdefs.c +--- man-1.6c/man2html/strdefs.c 2005-06-21 03:29:59.000000000 +0200 ++++ man-1.6/cman2html/strdefs.c 2005-11-09 12:34:28.000000000 +0100 +@@ -95,6 +95,7 @@ + { V('b','v'), 1, "|", NULL }, + { V('c','i'), 1, "o", NULL }, /* circle */ + { V('c','o'), 1, "©", NULL }, ++ { V('c','q'), 1, "'", NULL }, + { V('c','t'), 1, "¢", NULL }, + { V('d','e'), 1, "°", NULL }, + { V('d','g'), 1, "+", NULL }, /* dagger */ +@@ -114,9 +115,11 @@ + { V('i','s'), 8, "Integral", NULL }, /* integral sign */ + { V('l','f'), 2, "|_", NULL }, + { V('l','k'), 1, "{", NULL }, ++ { V('l','q'), 1, "\"", NULL }, + { V('m','i'), 1, "-", NULL }, + { V('m','u'), 1, "×", NULL }, + { V('n','o'), 1, "¬", NULL }, ++ { V('o','q'), 1, "'", NULL }, + { V('o','r'), 1, "|", NULL }, + { V('p','d'), 1, "d", NULL }, /* partial derivative */ + { V('p','l'), 1, "+", NULL }, +@@ -125,6 +128,7 @@ + { V('r','g'), 1, "®", NULL }, + { V('r','k'), 1, "}", NULL }, + { V('r','n'), 1, "¯", NULL }, ++ { V('r','q'), 1, "\"", NULL }, + { V('r','u'), 1, "_", NULL }, + { V('s','c'), 1, "§", NULL }, + { V('s','l'), 1, "/", NULL }, diff --git a/SOURCES/man2html-relative-links.patch b/SOURCES/man2html-relative-links.patch new file mode 100644 index 0000000..e2745dc --- /dev/null +++ b/SOURCES/man2html-relative-links.patch @@ -0,0 +1,28 @@ +Set default cgibase for man2html to an empty string, so hyperlinks +will be like `href="/cgi-bin/..."' + +diff -ruN man-1.6c-old/man2html/cgibase.c man-1.6c/man2html/cgibase.c +--- man-1.6c-old/man2html/cgibase.c 2003-03-11 16:53:29.000000000 +0100 ++++ man-1.6c/man2html/cgibase.c 2004-07-27 22:17:28.000000000 +0200 +@@ -24,7 +24,7 @@ + static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */ + static char *cgibase_format = "http://%s"; /* host.domain:port */ + static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */ +-static char *cgibase = "http://localhost"; /* default */ ++static char *cgibase = ""; /* default */ + + /* + * Separator between URL and argument string. +diff -ruN man-1.6c-old/man2html/man2html.1 man-1.6c/man2html/man2html.1 +--- man-1.6c-old/man2html/man2html.1 2003-03-11 16:53:30.000000000 +0100 ++++ man-1.6c/man2html/man2html.1 2004-07-27 22:17:28.000000000 +0200 +@@ -79,7 +79,8 @@ + are set using the various options. + .TP + .B \-\^h +-Set method:cgipath to http://localhost. This is the default. ++Set method:cgipath to http://localhost. ++.\" This is the default. + .TP + .BI \-\^H " host[.domain][:port]" + Set method:cgipath to diff --git a/SOURCES/man2html-see-also-hman.patch b/SOURCES/man2html-see-also-hman.patch new file mode 100644 index 0000000..8ed6ede --- /dev/null +++ b/SOURCES/man2html-see-also-hman.patch @@ -0,0 +1,31 @@ +Add SEE ALSO hman to man2html man page (closes: #285401). + +diff -ruN -x '*.rej' -x '*.orig' man-1.6e-old/man2html/man2html.1 man-1.6e/man2html/man2html.1 +--- man-1.6e-old/man2html/man2html.1 2007-04-24 22:07:56.000000000 +0200 ++++ man-1.6e/man2html/man2html.1 2007-04-24 22:08:39.000000000 +0200 +@@ -25,12 +25,12 @@ + .BR xmosaic (1) + or + .BR netscape (1). +-./" (See +-./" .BR man (1) +-./" for info on how to browse man pages via +-./" .BR man2html . +-./" Usually it would suffice to put "MANHTMLPAGER=/usr/bin/lynx" +-./" in the environment.) ++.\" (See ++.\" .BR man (1) ++.\" for info on how to browse man pages via ++.\" .BR man2html . ++.\" Usually it would suffice to put "MANHTMLPAGER=/usr/bin/lynx" ++.\" in the environment.) + + The main part of + .B man2html +@@ -149,4 +149,5 @@ + + .SH "SEE ALSO" + .BR lynx (1), +-.BR man (1) ++.BR man (1), ++.BR hman (1) diff --git a/SOURCES/man2html-suffixes.patch b/SOURCES/man2html-suffixes.patch new file mode 100644 index 0000000..9fa6d56 --- /dev/null +++ b/SOURCES/man2html-suffixes.patch @@ -0,0 +1,17 @@ +diff -up man-1.6f/man2html/man2html.c.pom man-1.6f/man2html/man2html.c +--- man-1.6f/man2html/man2html.c.pom 2009-10-12 09:56:00.000000000 +0200 ++++ man-1.6f/man2html/man2html.c 2009-10-12 09:59:35.000000000 +0200 +@@ -171,7 +171,12 @@ add_links(char *c) + /* section is n or l or starts with a digit */ + && strchr("123456789nl", f[1]) + && (g-f == 2 || (g-f == 3 && isdigit(f[1]) && isalpha(f[2])) +- || (f[2] == 'X' && isdigit(f[1]))) ++ || (g-f == 4 && isdigit(f[1]) && isalpha(f[2]) && ++ isalpha(f[3])) ++ || (g-f == 5 && isdigit(f[1]) && isalpha(f[2]) && ++ isalpha(f[3]) && isalpha(f[4])) ++ || (g-f == 6 && isdigit(f[1]) && isalpha(f[2]) && ++ isalpha(f[3]) && isalpha(f[4]) && isalpha(f[5]))) + ) { + /* this might be a link */ + h=f-1; diff --git a/SOURCES/man2html-ungzip-makefile.patch b/SOURCES/man2html-ungzip-makefile.patch new file mode 100644 index 0000000..2183c8a --- /dev/null +++ b/SOURCES/man2html-ungzip-makefile.patch @@ -0,0 +1,9 @@ +--- ../man-1.6g-orig/man2html/Makefile.in 2010-12-31 13:28:46.000000000 -0700 ++++ ./man2html/Makefile.in 2012-05-11 16:53:03.947983881 -0700 +@@ -1,5 +1,5 @@ + CC = @CC@ +-CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes ++CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes -DGUNZIP='"@gunzip@"' + OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o + EXEEXT = @EXEEXT@ + bindir = $(DESTDIR)$(PREFIX)/usr/bin diff --git a/SOURCES/man2html-ungzip.patch b/SOURCES/man2html-ungzip.patch new file mode 100644 index 0000000..12dc6f2 --- /dev/null +++ b/SOURCES/man2html-ungzip.patch @@ -0,0 +1,257 @@ +diff -ur ../man-1.6g.orig/man2html/man2html.c ./man2html/man2html.c +--- ../man-1.6g.orig/man2html/man2html.c 2007-08-05 12:15:23.000000000 -0700 ++++ ./man2html/man2html.c 2011-12-15 03:28:57.605162107 -0700 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -55,6 +56,108 @@ + + static char charb[3]; + ++#ifdef GUNZIP ++/* from src/utils.c */ ++static int ++is_shell_safe(const char *ss, int quoted) { ++ char *bad = " ;'\\\"<>|"; ++ char *p; ++ ++ if (quoted) ++ bad++; /* allow a space inside quotes */ ++ for (p = bad; *p; p++) ++ if (strchr(ss, *p)) ++ return 0; ++ return 1; ++} ++#endif ++ ++/* reads the entire manpage into buffer *buf and returns number of chars read */ ++static int ++read_manpage_into_buffer(char *path, char **buf) { ++ int compressed = 0; ++ FILE * f = NULL; ++ char * ext; ++ int l = 0; ++ struct stat stbuf; ++ ++ *buf = NULL; ++ if (!path) ++ return -1; ++ ++ if (!strcmp(path, "-")) ++ f = stdin; ++ else /* strcmp(path, "-") */ ++ { ++ char * tmp = NULL; ++ char * command = NULL; ++ char * openpath = path; ++#ifdef GUNZIP ++ ++ if (is_shell_safe(openpath, 1)) { ++ ext = strrchr(openpath, '.'); ++ compressed = (ext && !strcmp(ext, ".gz")); ++ ++ if (!compressed && stat(openpath, &stbuf)) { ++ tmp = (char*) xmalloc(strlen(path) + 4); ++ sprintf(tmp, "%s.gz", path); ++ if ((compressed = !stat(tmp, &stbuf))) ++ openpath = tmp; ++ } ++ } ++ ++ if (compressed) { ++ command = (char*) xmalloc(strlen(openpath) + sizeof(GUNZIP) + 4); ++ sprintf(command, GUNZIP " '%s'", openpath); ++ f = popen(command, "r"); ++ } else ++#endif ++ f = fopen(openpath, "r"); ++ ++ if (tmp) free(tmp); ++ if (command) free(command); ++ ++ if (!f) ++ return -1; ++ ++ } /* strcmp(path, "-") */ ++ ++ ++ /* Read entire file into buf[1..l] */ ++#define XTRA 5 ++ /* buf has 1 extra byte at the start, and XTRA extra bytes at the end */ ++ if (compressed || f == stdin) { ++ int sz = 1024; ++ int ct = 1, tot = 0; ++ char *p = NULL; ++ ++ clearerr(f); ++ while (ct > 0) { ++ tot += ct; ++ if (feof(f)) ++ break; ++ sz = 2*sz+tot; ++ p = xrealloc(p, sz); ++ ct = fread(p+tot,1,sz-tot-XTRA,f); ++ } ++ ++ *buf = p; ++ l = tot-1; ++ } else { ++ int ct; ++ ++ l = 0; ++ if (fstat(fileno(f), &stbuf) != -1) ++ l = stbuf.st_size; ++ *buf = (char *) xmalloc((l+1+XTRA)*sizeof(char)); ++ ct = fread(*buf+1,1,l,f); ++ if (ct < l) ++ l = ct; ++ } ++ fclose(f); ++ return l; ++} ++ + static char * + expand_char(int nr) + { +@@ -1817,8 +1920,6 @@ + break; + case V('s','o'): + { +- FILE *f; +- struct stat stbuf; + int l; char *buf; + char *name = NULL; + +@@ -1826,21 +1927,21 @@ + c += j; /* skip .so part and whitespace */ + if (*c == '/') { + h = c; +- } else { /* .so man3/cpow.3 -> ../man3/cpow.3 */ +- h = c-3; +- h[0] = '.'; +- h[1] = '.'; +- h[2] = '/'; +- } ++ } else { /* .so man3/cpow.3 -> ../man3/cpow.3 */ ++/* h = c-3; ++ h[0] = '.'; ++ h[1] = '.'; ++ h[2] = '/'; ++*/ ++ h = c; ++ } ++ + while (*c != '\n') c++; + while (c[-1] == ' ') c--; + while (*c != '\n') *c++ = 0; + *c = 0; + scan_troff(h,1, &name); + if (name[3] == '/') h=name+3; else h=name; +- l = 0; +- if (stat(h, &stbuf)!=-1) l=stbuf.st_size; +- buf = (char*) xmalloc((l+4)*sizeof(char)); + #if NOCGI + if (!out_length) { + char *t,*s; +@@ -1857,7 +1958,7 @@ + #endif + { + /* this works alright, except for section 3 */ +- if (!l || !(f = fopen(h,"r"))) { ++ if ((l = read_manpage_into_buffer(h, &buf)) < 0) { + fprintf(stderr, + "man2html: unable to open or read file %s\n", h); + out_html("
" +@@ -1865,13 +1966,11 @@ + out_html(h); + out_html("
\n"); + } else { +- i=fread(buf+1,1,l,f); +- fclose(f); + buf[0]=buf[l]='\n'; + buf[l+1]=buf[l+2]=0; + scan_troff(buf+1,0,NULL); ++ if (buf) free(buf); + } +- if (buf) free(buf); + } + *c++='\n'; + break; +@@ -3073,6 +3172,8 @@ + } + } + ++ ++ + /* + * Call: man2html [-l] [filename] + * +@@ -3083,8 +3184,6 @@ + */ + int + main(int argc, char **argv) { +- FILE *f; +- struct stat stbuf; + int l, c; + char *buf, *filename, *fnam = NULL; + +@@ -3146,50 +3245,16 @@ + + /* Open input file */ + if (!fnam || !strcmp(fnam, "-")) { +- f = stdin; ++ fnam = "-"; + fname = "(stdin)"; + } else { + /* do a chdir() first, to get .so expansion right */ + goto_dir(fnam, &directory, &fnam); +- +- f = fopen(fnam, "r"); +- if (f == NULL) +- error_page("File not found", "Could not open %s\n", filename); +- fname = fnam; + } + +- /* Read entire file into buf[1..l] */ +-#define XTRA 5 +- /* buf has 1 extra byte at the start, and XTRA extra bytes at the end */ +- if (f == stdin) { +- int sz = 1024; +- int ct = 1, tot = 0; +- char *p = NULL; +- +- clearerr(stdin); +- while (ct > 0) { +- tot += ct; +- if (feof(stdin)) +- break; +- sz = 2*sz+tot; +- p = xrealloc(p, sz); +- ct = fread(p+tot,1,sz-tot-XTRA,stdin); +- } +- +- buf = p; +- l = tot-1; +- } else { +- int ct; +- +- l = 0; +- if (fstat(fileno(f), &stbuf) != -1) +- l = stbuf.st_size; +- buf = (char *) xmalloc((l+1+XTRA)*sizeof(char)); +- ct = fread(buf+1,1,l,f); +- if (ct < l) +- l = ct; +- fclose(f); +- } ++ l = read_manpage_into_buffer(fnam, &buf); ++ if (l < 0) ++ error_page("File not found", "Could not open %s\n", fname); + + buf[0] = '\n'; + buf[l+1] = '\n'; diff --git a/SOURCES/man2html.conf b/SOURCES/man2html.conf new file mode 100644 index 0000000..8c6a37a --- /dev/null +++ b/SOURCES/man2html.conf @@ -0,0 +1,14 @@ +ScriptAlias /man/ "/usr/lib/man2html/cgi-bin/man/" + + Options None + + # Apache 2.4 + Require local + + + # Apache 2.2 + AllowOverride None + Order allow,deny + Allow from 127.0.0.1 + + diff --git a/SPECS/man2html.spec b/SPECS/man2html.spec new file mode 100644 index 0000000..5e7f750 --- /dev/null +++ b/SPECS/man2html.spec @@ -0,0 +1,327 @@ +%global posttag g +%global debian_release 6 + +Name: man2html +Version: 1.6 +Release: 36.%{posttag}%{?dist} +Summary: Convert man pages to HTML - CGI scripts + +# man2html.c and debian/sources/man2html.cgi.c are Copyright Only +# utils.c is GPL+ +# everything else is GPLv2 +License: GPLv2+ and GPL+ and Copyright only + +URL: http://www.kapiti.co.nz/michael/vhman2html.html +Source0: http://primates.ximian.com/~flucifredi/man/man-%{version}%{posttag}.tar.gz + +# Debian CGI scripts +Source1: http://ftp.de.debian.org/debian/pool/main/m/man2html/man2html_%{version}%{posttag}-%{debian_release}.debian.tar.gz + +# Apache configuration file +Source2: man2html.conf + +# Patch1XXX are from Debian, XXX matches their patch number +# Copyright (C) Christoph Lameter , Nicolás Lichtmaier +# , and Robert Luberda . GPLv2+ + +# fix a bashism in %%{_bindir}/hman, allows it to work on other shells +Patch1001: man2html-hman-bashism.patch + +# use relative links instead of http://localhost/ +Patch1002: man2html-relative-links.patch + +# use file:/// links instead of file:/ (per RFC 1738) +Patch1013: man2html-file-link.patch + +# show hman(1) in man2html(1) see also section +Patch1017: man2html-see-also-hman.patch + +# *roff parser fix: add support for \(lq and \(rq escape sequences +Patch1018: man2html-quotes.patch + +# fix SEGFAULT on manpages with no sections +Patch1019: man2html-noindex-segfault.patch + +# *roff parser fix: convert \N'123' to { +Patch1020: man2html-escape-N.patch + +# fix typo in Italian man page +Patch1022: man2html-it-typo.patch + +# *roff parser: properly decode quotes inside quoted text +Patch1023: man2html-double-quotes.patch + +# *roff parser: handle \$* and \$@ escapes. +Patch1025: man2html-all-args.patch + +# *roff parser: support macro names longer than two characters +Patch1026: man2html-macro-longnames.patch + +# *roff parser: parse user defined macros before global ones +Patch1027: man2html-macro-priority.patch + +# fix a segfault that only happens on groff(1) [lol] +Patch1028: man2html-groff-segfault.patch + +# *roff parser: support "\[xx]" +Patch1029: man2html-new-macros.patch + +# ignore font change requests that aren't followed by any words +Patch1031: man2html-BR-empty-line.patch + +# fix some GCC warnings +Patch1033: man2html-gcc-warnings.patch + +# Fedora patches + +# use /usr/lib/man2html for CGI +# originally based on Debian patches 000 and 005 +Patch1: man2html-paths.patch + +# support gunzipping manpages +# modified version of Debian patch 024 +Patch2: man2html-ungzip.patch +Patch3: man2html-ungzip-makefile.patch + +# fix up CGI scripts/Makefile with Fedora paths +Patch4: man2html-cgi.patch + +# hman cleanup: use xdg-open instead of lynxcgi by default and use correct path +# for lynxcgi when manually requested +Patch5: man2html-hman.patch + +# manpage cleanup: mention Fedora paths as default, use modern browser examples, +# and describe LYNXCGI issues as runtime, not compile-time +Patch6: man2html-doc.patch + +# fix format string warnings +# fixed in Debian now too: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672821 +Patch7: man2html-format.patch + +# fix a bug in hman that linked to the wrong URL for mansec and manwhatis +# (e.g. when just invoking `hman 1`) +Patch8: man2html-hman-section.patch + +# fix the paths in localized manpages +Patch9: man2html-localized-manpage-paths.patch + +# permit autolinking manual pages with textual suffixes (e.g. "3p" for perl) +# (resolves RHBZ#1077297) +Patch10: man2html-suffixes.patch + +Patch11: man2html-configure-c99.patch +Patch12: man2html-c99.patch + +BuildRequires: make +BuildRequires: gcc +BuildRequires: recode + +Requires: %{name}-core%{?_isa} = %{version}-%{release} +Requires: httpd + +%description +man2html is a man page to HTML converter. + +This package contains CGI scripts that allow you to view, browse, and search +man pages using a web server. + + +%package core +Summary: Convert man pages to HTML + +%description core +man2html is a man page to HTML converter. + +This package contains the man2html executable. + + +%prep +%setup -q -n man-%{version}%{posttag} -a1 + +for p in %{patches}; do + patch -p1 -i $p +done + + +%build +CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; + +# Configure and make man2html binary +# (not autoconf so don't use %%configure) +./configure -d +fhs +make %{?_smp_mflags} + +# make cgi scripts from debian +cd debian/sources +make %{?_smp_mflags} + + +%install +#install man2html binary +make -C man2html DESTDIR=%{buildroot} install install-hman + +#install CGI scripts +make -C debian/sources PREFIX=%{buildroot} install + +#install localized manpages +install -Dpm0644 man2html/locales/fr/man2html.1 %{buildroot}%{_mandir}/fr/man1/man2html.1 +install -Dpm0644 man2html/locales/it/man2html.1 %{buildroot}%{_mandir}/it/man1/man2html.1 +install -Dpm0644 man2html/locales/it/hman.1 %{buildroot}%{_mandir}/it/man1/hman.1 + +#convert localized manpages to UTF-8 +recode latin1..utf8 \ + %{buildroot}%{_mandir}/fr/man1/man2html.1 \ + %{buildroot}%{_mandir}/it/man1/man2html.1 \ + %{buildroot}%{_mandir}/it/man1/hman.1 + +#install httpd configuration +install -Dpm0644 %SOURCE2 %{buildroot}%{_sysconfdir}/httpd/conf.d/man2html.conf + +#create cache directory for cgi scripts +mkdir -p %{buildroot}%{_localstatedir}/cache/man2html + + +%post +#clear out the cache directory so all future pages are regenerated with the new build +rm -f %{_localstatedir}/cache/man2html/* || : + + +%files +%attr(0755,-,-) %{_bindir}/hman +%{_prefix}/lib/man2html/ +%attr(0775,root,apache) %{_localstatedir}/cache/man2html +%config(noreplace) %{_sysconfdir}/httpd/conf.d/man2html.conf +%{_mandir}/man1/hman.1.* + + +%files core +%{_bindir}/man2html +%{_mandir}/man1/man2html.1.* +%{_mandir}/*/man1/*.1.* +%doc COPYING HISTORY man2html/README man2html/TODO + + +%changelog +* Thu Dec 26 2024 Dmitriy Samoylik - 1.6-36.g +- Rebuilt for MSVSphere 10 + +* Thu Jul 18 2024 Fedora Release Engineering - 1.6-36.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 1.6-35.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1.6-34.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 1.6-33.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Feb 07 2023 Florian Weimer - 1.6-32.g +- C99 compatibility fixes (#2167940) + +* Thu Jan 19 2023 Fedora Release Engineering - 1.6-31.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 1.6-30.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 1.6-29.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 1.6-28.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 1.6-27.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.6-26.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 1.6-25.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 1.6-24.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 1.6-23.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.6-22.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild +- https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot + +* Thu Feb 08 2018 Fedora Release Engineering - 1.6-21.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 1.6-20.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.6-19.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.6-18.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.6-17.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.6-16.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 1.6-15.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.6-14.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Mar 18 2014 T.C. Hollingsworth - 1.6-13.g +- fix autolinking manual pages with textual suffixes (RHBZ#1077297) + +* Sat Aug 03 2013 T.C. Hollingsworth - 1.6-12.g +- Fix stray trailing slash in files list + +* Sat Aug 03 2013 Fedora Release Engineering - 1.6-12.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.6-11.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 7 2013 Remi Collet - 1.6-10.g +- fix configuration file for httpd 2.4, #871417 + +* Thu Jul 19 2012 Fedora Release Engineering - 1.6-9.g +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 16 2012 T.C. Hollingsworth - 1.6-8.g +- remove SELinux hack; now supported in selinux-policy + +* Mon Jul 16 2012 T.C. Hollingsworth - 1.6-7.g +- restore Italian manpages +- fix paths in localized manpages + +* Thu May 24 2012 T.C. Hollingsworth - 1.6-6.g +- fix hman bug that caused linked to wrong URLs for sections (e.g. `hman 1`) +- don't ship Italian man pages; they're provided by man-pages-it + +* Fri May 18 2012 T.C. Hollingsworth - 1.6-5.g +- fix accidental use of wrong macro in %%post + +* Sun May 13 2012 T.C. Hollingsworth - 1.6-4.g +- clean up old cruft from patches and split them out more logically +- hman: use xdg-open and proper paths +- improve manpages +- temporarily fix SELinux until selinux-policy is patched +- clarify licensing + +* Wed May 09 2012 T.C. Hollingsworth - 1.6-3.g +- convert localized man page encoding properly + +* Mon May 07 2012 T.C. Hollingsworth - 1.6-2.g +- respect OPTFLAGS +- fix entries in file list +- fix links in man2html CGI output + +* Fri Dec 15 2011 T.C. Hollingsworth - 1.6-1.g +- initial RPM package +