ports/165244: [PATCH] Fix port: net/v6eval on 9+

Chris Rees crees at FreeBSD.org
Fri Feb 17 18:10:13 UTC 2012


>Number:         165244
>Category:       ports
>Synopsis:       [PATCH] Fix port: net/v6eval on 9+
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 17 18:10:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD pegasus.bayofrum.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sat Jan 28 15:45:27 GMT 2012 root at pegasus.bayofrum.net:/usr/obj/usr/src/sys/PEGASUS amd64


	
>Description:
	Use utmpx.h, thus fixing on 9+ (Patch written by Ed Schouten ed at FreeBSD.org)

	Remove obsolete perl workaround; 5.8 is lowest version in the tree
>How-To-Repeat:
	
>Fix:

	

--- v6eval-ed.diff begins here ---
? work
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/net/v6eval/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- Makefile	21 Sep 2010 16:08:09 -0000	1.23
+++ Makefile	17 Feb 2012 18:01:08 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	v6eval
 PORTVERSION=	3.0.1
-PORTREVISION=	3
+PORTREVISION=	4
 PORTEPOCH=	1
 CATEGORIES=	net ipv6
 MASTER_SITES=	http://www.tahi.org/release/v6eval/
@@ -27,17 +27,7 @@
 MAKE_JOBS_UNSAFE=	yes
 SUB_FILES=	pkg-message
 
-.include <bsd.port.pre.mk>
-
-.if ${PERL_LEVEL} < 500703
-RUN_DEPENDS+=	p5-Digest-MD5>=2.16:${PORTSDIR}/security/p5-Digest-MD5
-.endif
-
-.if ${OSVERSION} > 900007
-BROKEN=		fails to build with new utmpx
-.endif
-
 post-install:
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: files/patch-lib_Cm_CmMain.cc
===================================================================
RCS file: files/patch-lib_Cm_CmMain.cc
diff -N files/patch-lib_Cm_CmMain.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-lib_Cm_CmMain.cc	17 Feb 2012 18:01:08 -0000
@@ -0,0 +1,66 @@
+$FreeBSD$
+
+Utmpx implementation by ed at FreeBSD.org; utmp was removed for 9-RELEASE
+
+--- lib/Cm/CmMain.cc.orig	2003-10-23 05:37:30.000000000 +0100
++++ lib/Cm/CmMain.cc	2012-02-16 15:55:58.878522227 +0000
+@@ -47,7 +47,14 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#if (defined(__unix__) || defined(unix)) && !defined(USG)
++#include <sys/param.h>
++#endif
++#if __FreeBSD_version < 900007
+ #include <utmp.h>
++#else
++#include <utmpx.h>
++#endif
+ #include <time.h>
+ #include <pwd.h>
+ #include <sys/time.h>
+@@ -128,6 +135,7 @@
+ 
+ //----------------------------------------------------------------------
+ // ¾ã³²²òÀϾðÊóºîÀ®
++#if __FreeBSD_version < 900007
+ static struct utmp *myUtmpEnt(FILE *in,struct utmp *u) {
+ 	int s=ttyslot();
+ 	if(s<0||fseek(in,sizeof(struct utmp)*s,0)<0||
+@@ -140,9 +148,36 @@
+ 	u=myUtmpEnt(in,ux); fclose(in);
+ 	if(!u) {return;}
+ #define A(a)sizeof(a),sizeof(a),a
+ 	sprintf(p,catch2,A(u->ut_line),A(u->ut_name),A(u->ut_host));
+ #undef A
+ 	return;}
++#else /* No utmp */
++void CmMain::makeCatch2Eye(STR p) {
++static char catch2[]=" on %*.*s:%-*.*s from %*.*s";
++	struct utmpx ul, *u;
++	const char *tty;
++
++	tty = ttyname(0);
++	if (tty == NULL)
++		tty = ttyname(1);
++	if (tty == NULL)
++		tty = ttyname(2);
++	if (tty == NULL)
++		return;
++	if (strncmp(tty, "/dev/", 5) == 0)
++		tty += 5;
++	strncpy(ul.ut_line, tty, sizeof(ul.ut_line));
++	setutxent();
++	u = getutxline(&ul);
++	endutxent();
++	if (u == NULL || u->ut_type != USER_PROCESS)
++		return;
++#define A(a)sizeof(a),sizeof(a),a
++	sprintf(p,catch2,A(u->ut_line),A(u->ut_user),A(u->ut_host));
++#undef A
++	return;}
++#endif
++
+ void CmMain::makeCatchEye(const STR pgmName) {
+ static char catch1[]="@(#) %02d/%02d/%02d %02d:%02d:%02d %s STARTED by %s@%s";
+ 	time_t now=time(0); struct tm *m=localtime(&now);
--- v6eval-ed.diff ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list