aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorthierry <thierry@FreeBSD.org>2004-12-14 05:51:27 +0800
committerthierry <thierry@FreeBSD.org>2004-12-14 05:51:27 +0800
commit1fb9200f3defa08b47260c0ac52ba8ed2cb7d402 (patch)
tree4dd9b78afadeba333f629785a94c2e647945f0c5 /misc
parent4b40ff0a9fe4eb31ce0e736673ffc2f113c5110b (diff)
downloadfreebsd-ports-gnome-1fb9200f3defa08b47260c0ac52ba8ed2cb7d402.tar.gz
freebsd-ports-gnome-1fb9200f3defa08b47260c0ac52ba8ed2cb7d402.tar.zst
freebsd-ports-gnome-1fb9200f3defa08b47260c0ac52ba8ed2cb7d402.zip
Add dependency & fix netbrowse option.
PR: ports/71438 Submitted by: Serge Gagnon.
Diffstat (limited to 'misc')
-rw-r--r--misc/gman/Makefile9
-rw-r--r--misc/gman/files/patch-gman.c38
-rw-r--r--misc/gman/files/patch-gman.pl69
-rw-r--r--misc/gman/files/patch-mandata.c71
-rw-r--r--misc/gman/pkg-message4
-rw-r--r--misc/gman/pkg-plist2
6 files changed, 152 insertions, 41 deletions
diff --git a/misc/gman/Makefile b/misc/gman/Makefile
index cb7d87bd0337..cbe7e9996601 100644
--- a/misc/gman/Makefile
+++ b/misc/gman/Makefile
@@ -1,6 +1,6 @@
# ex:ts=8
# New ports collection makefile for: gman
-# Date created: Mar 30, 3001
+# Date created: Mar 30, 2001
# Whom: Ying-Chieh Liao <ijliao@FreeBSD.org>
#
# $FreeBSD$
@@ -8,7 +8,7 @@
PORTNAME= gman
PORTVERSION= 0.9.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_DEBIAN}
MASTER_SITE_SUBDIR= pool/main/g/gman
@@ -23,7 +23,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= A user-friendly graphical front end for the man system
LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg
-RUN_DEPENDS= ghostview:${PORTSDIR}/print/ghostview
+RUN_DEPENDS= ghostview:${PORTSDIR}/print/ghostview \
+ man2html:${PORTSDIR}/textproc/man2html
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
@@ -47,5 +48,5 @@ do-install:
@${MKDIR} ${PREFIX}/www/cgi-bin
${INSTALL_SCRIPT} ${WRKSRC}/gman.pl ${PREFIX}/www/cgi-bin
${INSTALL_MAN} ${WRKSRC}/gman.1x ${MANPREFIX}/man/man1
-
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/misc/gman/files/patch-gman.c b/misc/gman/files/patch-gman.c
index 8143e8866ac1..bd5c448d6a55 100644
--- a/misc/gman/files/patch-gman.c
+++ b/misc/gman/files/patch-gman.c
@@ -1,11 +1,39 @@
---- gman.c.dist Mon May 12 07:39:11 2003
-+++ gman.c Mon May 12 07:39:53 2003
-@@ -90,7 +90,7 @@
+--- gman.c.orig Mon Dec 13 22:25:03 2004
++++ gman.c Mon Dec 13 22:26:54 2004
+@@ -62,6 +62,8 @@
+
+ //gtk_main();
+
++
++
+ while(1){
+ pthread_mutex_lock(&gtk_lock);
+ while(gtk_events_pending()) {
+@@ -77,6 +79,14 @@
+ /******************* init_context() *****************/
+ void init_context()
+ {
++ static char *browser;
++ if ((browser = getenv("BROWSER")) == NULL)
++ {
++ fprintf(stderr,"A BROWSER variable that contains the name of your\n \
++favorite browser's executable file must be created\n \
++in order to use gman with localbrowse/netbrowse.\n");
++ exit(1);
++ }
+ FILE * fd;
+ char buffer[256];
+ context = new AppContext();
+@@ -89,9 +99,9 @@
+ context->set_default_value("show_status_bar","int",(void*)0);
context->set_default_value("show_warning","int",(void*)0);
context->set_default_value("show_mode","int",(void*)0); // 0 = xterm, 1 = ghostview
- context->set_default_value("xterm_command","char*",(void*)"x-terminal-emulator");
+- context->set_default_value("xterm_command","char*",(void*)"x-terminal-emulator");
- context->set_default_value("gv_command","char*",(void*)"gv");
+- context->set_default_value("browser_command","char*",(void*)"mozilla"); // kfm also works
++ context->set_default_value("xterm_command","char*",(void*)"xterm");
+ context->set_default_value("gv_command","char*",(void*)"ghostview");
- context->set_default_value("browser_command","char*",(void*)"mozilla"); // kfm also works
++ context->set_default_value("browser_command","char*",(void*)browser); // kfm also works
context->set_default_value("cgi_host","char*",(void*)"localhost");
context->set_default_value("cgi_location","char*",(void*)"/cgi-bin/gman.pl");
+ context->set_default_value("print_command","char*",(void*)"lpr"); // not in use
diff --git a/misc/gman/files/patch-gman.pl b/misc/gman/files/patch-gman.pl
new file mode 100644
index 000000000000..aa905c88bbf9
--- /dev/null
+++ b/misc/gman/files/patch-gman.pl
@@ -0,0 +1,69 @@
+ --- gman.pl.orig Mon Sep 6 16:55:42 2004
+ +++ gman.pl Mon Sep 6 16:55:45 2004
+ @@ -1,10 +1,10 @@
+ #!/usr/bin/perl -w
+ -use strict;
+
+ if (@ARGV != 2) {
+ print <<_EOF_;
+ Content-type: text/html
+
+ +<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
+ <html><head><title>gman.pl: invalid use</title></head>
+ <body>
+ <h1>gman.pl cannot be used without arguments.</h1>
+ @@ -14,35 +14,43 @@
+ }
+
+ my $section = $ARGV[0]; # should also have some sanity check
+ +my $cut = "/usr/bin/cut -f 1 -d \" \" ";
+ my $name = $ARGV[1];
+ -my $man2html = "/usr/lib/cgi-bin/man2html";
+ -my $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//;
+ +my $man = "/usr/bin/man";
+ +my $man2html = "/usr/local/bin/man2html -nodepage ";
+ +my $path = `$man -w $section $name |$cut`; chomp $path; $path =~ s/\s*$//;
+
+ unless (-s "$path") {
+ warn "not -s $path\n";
+ $name = lc $name;
+ - $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//;
+ + $path = `$man -w $section $name |$cut`; chomp $path; $path =~ s/\s*$//;
+ }
+ unless (-s "$path") {
+ warn "not -s $path\n";
+ print <<end_of_line;
+ Content-type: text/html
+
+ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+ -<HTML><HEAD>
+ -<TITLE>404 Not Found</TITLE>
+ -</HEAD><BODY>
+ +<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
+ +<html><head>
+ +<title>404 Not Found</title>
+ +</head><body>
+ <H1>Not Found</H1>
+ The requested man page $name($section) was not found on this server.
+ -</BODY></HTML>
+ +</body></html>
+ end_of_line
+ - die;
+ +;
+ }
+
+ -my $page = `$man2html $path`;
+ +my $page = `$man $section $name |$man2html`;
+
+ # $page =~ s/^Content-type: text\/html\n\n// if (not run as cgi...);
+
+ -$page =~ s/(This document was created by\n<a HREF=\".*\">man2html<\/a>)(,\nusing the manual pages.<br>)/$1 for <a href=\"\/cgi-bin\/gman.pl?1+gman\">gman<\/a>$2/io;
+ +print <<eof;
+ +Content-type: text/html
+ +
+ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN">
+ +eof
+ +;
+
+ print $page;
+ +
diff --git a/misc/gman/files/patch-mandata.c b/misc/gman/files/patch-mandata.c
index b7500892f5b3..2e09479b23e2 100644
--- a/misc/gman/files/patch-mandata.c
+++ b/misc/gman/files/patch-mandata.c
@@ -1,31 +1,40 @@
---- mandata.c.orig Sat Mar 31 19:16:19 2001
-+++ mandata.c Sat Apr 14 05:12:49 2001
-@@ -243,11 +243,11 @@
- char buffer2[BUFFER_SIZE];
- switch ((int)context->get_value("show_mode")) {
- case 0:
-- sprintf(buffer,"%s -T '%s manual page' -n GMan -e man ",
-+ sprintf(buffer,"%s -T '%s manual page' -n GMan -e man %s",
- (char*)context->get_value("xterm_command"),
-- get_display_name(buffer1));
-- len = strlen(buffer);
-- attach(buffer+len,man_path->GetPath(),file_name);
-+ get_display_name(buffer1), get_display_name(buffer1));
-+/* len = strlen(buffer);
-+ attach(buffer+len,man_path->GetPath(),file_name); */
- //g_warning(buffer);
- if(!fork())
- {
-@@ -258,9 +258,9 @@
- break;
- case 1:
- sprintf(loc_name," ~/.gman.%s.ps ",get_display_name(buffer1));
-- sprintf(buffer,"man -t ");
-- len = strlen(buffer);
-- attach(buffer+len,man_path->GetPath(),file_name);
-+ sprintf(buffer,"man -t %s", get_display_name(buffer1));
-+/* len = strlen(buffer);
-+ attach(buffer+len,man_path->GetPath(),file_name); */
- strcat(buffer," >> ");
- strcat(buffer,loc_name);
- strcat(buffer," ; ");
+ --- mandata.c.orig Sun Aug 29 09:29:38 2004
+ +++ mandata.c Sun Aug 29 09:33:45 2004
+ @@ -241,11 +241,11 @@
+ char buffer2[BUFFER_SIZE];
+ switch ((int)context->get_value("show_mode")) {
+ case 0:
+ - sprintf(buffer,"%s -T '%s manual page' -n GMan -e man ",
+ + sprintf(buffer,"%s -T '%s manual page' -n GMan -e man %s",
+ (char*)context->get_value("xterm_command"),
+ - get_display_name(buffer1));
+ - len = strlen(buffer);
+ - attach(buffer+len,man_path->GetPath(),file_name);
+ + get_display_name(buffer1), get_display_name(buffer1));
+ +/* len = strlen(buffer);
+ + attach(buffer+len,man_path->GetPath(),file_name); */
+ //g_warning(buffer);
+ if(!fork())
+ {
+ @@ -256,9 +256,9 @@
+ break;
+ case 1:
+ sprintf(loc_name," ~/.gman.%s.ps ",get_display_name(buffer1));
+ - sprintf(buffer,"man -t ");
+ - len = strlen(buffer);
+ - attach(buffer+len,man_path->GetPath(),file_name);
+ + sprintf(buffer,"man -t %s", get_display_name(buffer1));
+ +/* len = strlen(buffer);
+ + attach(buffer+len,man_path->GetPath(),file_name); */
+ strcat(buffer," >> ");
+ strcat(buffer,loc_name);
+ strcat(buffer," ; ");
+ @@ -306,7 +306,7 @@
+ case 2:
+ sprintf(loc_name," ~/.gman.%s.html ",get_display_name(buffer1));
+ //g_warning(loc_name);
+ - strcpy(buffer,"/usr/lib/cgi-bin/gman.pl ");
+ + strcpy(buffer,"/usr/local/www/cgi-bin/gman.pl ");
+ strcat(buffer," ");
+ strcat(buffer,get_section_name(buffer2));
+ strcat(buffer," ");
diff --git a/misc/gman/pkg-message b/misc/gman/pkg-message
new file mode 100644
index 000000000000..720c17e3a2ea
--- /dev/null
+++ b/misc/gman/pkg-message
@@ -0,0 +1,4 @@
+ --------------------------------------------------------------------------------
+ You must have a BROWSER variable that contains the name of your favorite
+ browser's executable file in order to use gman with localbrowse/netbrowse.
+ --------------------------------------------------------------------------------
diff --git a/misc/gman/pkg-plist b/misc/gman/pkg-plist
index ffee331cb478..98fc1f23c910 100644
--- a/misc/gman/pkg-plist
+++ b/misc/gman/pkg-plist
@@ -1,4 +1,4 @@
bin/gman
bin/gman.cgi
www/cgi-bin/gman.pl
-@unexec rmdir %D/www/cgi-bin 2>/dev/null || true \ No newline at end of file
+@unexec rmdir %D/www/cgi-bin 2>/dev/null || true