From serge@quenix1.dyndns.org  Mon Sep  6 21:23:35 2004
Return-Path: <serge@quenix1.dyndns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 974D816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Sep 2004 21:23:35 +0000 (GMT)
Received: from simmts12-srv.bellnexxia.net (simmts12.bellnexxia.net [206.47.199.141])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 10F4B43D58
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Sep 2004 21:23:35 +0000 (GMT)
	(envelope-from serge@quenix1.dyndns.org)
Received: from quenix1.dyndns.org ([69.159.145.194])
          by simmts12-srv.bellnexxia.net
          (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP
          id <20040906212235.OLOH1580.simmts12-srv.bellnexxia.net@quenix1.dyndns.org>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Mon, 6 Sep 2004 17:22:35 -0400
Received: from serge by quenix1.dyndns.org with local (Exim 4.42 (FreeBSD))
	id 1C4Qxr-000JEE-KL
	for FreeBSD-gnats-submit@freebsd.org; Mon, 06 Sep 2004 17:23:51 -0400
Message-Id: <E1C4Qxr-000JEE-KL@quenix1.dyndns.org>
Date: Mon, 06 Sep 2004 17:23:51 -0400
From: Serge Gagnon <ser_gagnon@sympatico.ca>
Sender: Serge Gagnon <serge@quenix1.dyndns.org>
Reply-To: Serge Gagnon <ser_gagnon@sympatico.ca>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Update ports: misc/gman add dependency & fix netbrowse option
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71438
>Category:       ports
>Synopsis:       Update ports: misc/gman add dependency & fix netbrowse option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 06 21:30:23 GMT 2004
>Closed-Date:    Mon Dec 13 21:52:18 GMT 2004
>Last-Modified:  Mon Dec 13 21:52:18 GMT 2004
>Originator:     Serge Gagnon
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
me
>Environment:
System: FreeBSD quenix1.dyndns.org 4.10-STABLE FreeBSD 4.10-STABLE #0: Sat Aug 14 15:29:18 EDT 2004 root@quenix.dnsalias.org:/usr/obj/usr/src/sys/OCEAN i386


>Description:

	o gman start "xterm" instead of "x-terminal-emulator"
	o same as above for "mozilla" "dillo"
	o I have added a RUN_DEPEND to dillo
	o fix gman.pl so localbrowse and netbrowse now work
	(I know absolutely nothing at perl. If you think that is
	not correct, tell me

	Fix include a patch for misc/gman/Makefile.
	The three other files have to be put in gman/files

>How-To-Repeat:
>Fix:


--- patch-Makefile.diff begins here ---
--- misc/gman/Makefile.orig	Sun Aug 29 09:01:44 2004
+++ misc/gman/Makefile	Mon Sep  6 17:05:00 2004
@@ -24,6 +24,7 @@
 
 LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg
 RUN_DEPENDS=	ghostview:${PORTSDIR}/print/ghostview
+RUN_DEPENDS=    dillo:${PORTSDIR}/www/dillo
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
 
--- patch-Makefile.diff ends here ---

--- patch-gman.c begins here ---
--- gman.c.orig	Sun Aug 29 09:05:32 2004
+++ gman.c	Sun Aug 29 09:06:27 2004
@@ -89,9 +89,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("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*)"dillo"); // 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
--- patch-gman.c ends here ---

--- patch-gman.pl begins here ---
--- 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;
+
--- patch-gman.pl ends here ---

--- patch-mandata.c begins here ---
--- 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," ");
--- patch-mandata.c ends here ---


>Release-Note:
>Audit-Trail:

From: Adam Weinberger <adamw@FreeBSD.org>
To: Serge Gagnon <ser_gagnon@sympatico.ca>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/71438: Update ports: misc/gman add dependency & fix netbrowse option
Date: Mon, 6 Sep 2004 17:35:50 -0400

 >> (09.06.2004 @ 1723 PST): Serge Gagnon said, in 6.2K: <<
 > 	o gman start "xterm" instead of "x-terminal-emulator"
 > 	o same as above for "mozilla" "dillo"
 > 	o I have added a RUN_DEPEND to dillo
 >> end of "ports/71438: Update ports: misc/gman add dependency & fix netbrowse option" from Serge Gagnon <<
 
 It feels weird to move from the most popular browser to one of the least
 popular browsers. Perhaps a build-time configuration option would be the
 most widely applicable solution?
 
 # Adam
 
 
 --
 Adam Weinberger
 adamw@magnesium.net || adamw@FreeBSD.org
 adamw@vectors.cx    ||   adamw@gnome.org
 http://www.vectors.cx

From: Serge Gagnon <ser_gagnon@sympatico.ca>
To: Adam Weinberger <adamw@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/71438: Update ports: misc/gman add dependency & fix netbrowse option 
Date: Mon, 06 Sep 2004 17:55:58 -0400

 >>>>> On Mon Sep 6 17:50:36, Adam wrote:
 
   > It feels weird to move from the most popular browser to one of the
   > least popular browsers. Perhaps a build-time configuration option
   > would be the most widely applicable solution?
 
 I don't know how to do it, but I'll take a look at other ports for some 
 brainwave.
 
 -- 
 Serge Gagnon <ser_gagnon@sympatico.ca>
 Quebec, Qc, Canada
 
 

From: Serge Gagnon <ser_gagnon@sympatico.ca>
To: Adam Weinberger <adamw@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/71438: Update ports: misc/gman add dependency & fix netbrowse option 
Date: Mon, 06 Sep 2004 20:39:51 -0400

 This is a multipart MIME message.
 
 --==_Exmh_15586771310
 Content-Type: text/plain; charset=us-ascii
 
 Ok.
 
 This one remove the RUN_DEPEND to dillo and use your favorite browser. 
 The one you put in your BROWSER variable.
 
 Additional file: pkg-message
 
 
 
 --==_Exmh_15586771310
 Content-Type: text/plain ; name="patch-mandata.c"; charset=us-ascii
 Content-Description: patch-mandata.c
 Content-Disposition: attachment; filename="patch-mandata.c"
 
 --- 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," ");
 
 --==_Exmh_15586771310
 Content-Type: text/plain ; name="patch-gman.pl"; charset=us-ascii
 Content-Description: patch-gman.pl
 Content-Disposition: attachment; filename="patch-gman.pl"
 
 --- 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;
 +
 
 --==_Exmh_15586771310
 Content-Type: text/plain ; name="patch-gman.c"; charset=us-ascii
 Content-Description: patch-gman.c
 Content-Disposition: attachment; filename="patch-gman.c"
 
 --- gman.c.orig	Mon Sep  6 20:13:04 2004
 +++ gman.c	Mon Sep  6 20:13:04 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("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*)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
 
 --==_Exmh_15586771310
 Content-Type: text/plain ; name="pkg-message"; charset=us-ascii
 Content-Description: pkg-message
 Content-Disposition: attachment; filename="pkg-message"
 
 
 --------------------------------------------------------------------------------
 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.
 --------------------------------------------------------------------------------
 
 
 --==_Exmh_15586771310
 Content-Type: text/plain ; name="patch-pkg-plist.diff"; charset=us-ascii
 Content-Description: patch-pkg-plist.diff
 Content-Disposition: attachment; filename="patch-pkg-plist.diff"
 
 --- pkg-plist.orig	Mon Sep  6 20:28:02 2004
 +++ pkg-plist	Mon Sep  6 20:28:10 2004
 @@ -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
 
 --==_Exmh_15586771310
 Content-Type: text/plain ; name="patch-Makefile.diff"; charset=us-ascii
 Content-Description: patch-Makefile.diff
 Content-Disposition: attachment; filename="patch-Makefile.diff"
 
 --- Makefile.orig	Sun Aug 29 09:01:44 2004
 +++ Makefile	Mon Sep  6 20:29:07 2004
 @@ -47,5 +47,5 @@
  	@${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>
 
 --==_Exmh_15586771310--
 
 
State-Changed-From-To: open->closed 
State-Changed-By: thierry 
State-Changed-When: Mon Dec 13 21:51:47 GMT 2004 
State-Changed-Why:  

Committed, thanks! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=71438 
>Unformatted:
