[30319] trunk/dports/games/fortune

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 24 11:26:45 PDT 2007


Revision: 30319
          http://trac.macosforge.org/projects/macports/changeset/30319
Author:   afb at macports.org
Date:     2007-10-24 11:26:45 -0700 (Wed, 24 Oct 2007)

Log Message:
-----------
port upgrade from 4.6.2 (2001) to 6.2.0 (2007)

Modified Paths:
--------------
    trunk/dports/games/fortune/Portfile
    trunk/dports/games/fortune/files/patch-fortune-Makefile
    trunk/dports/games/fortune/files/patch-fortune.c
    trunk/dports/games/fortune/files/patch-strfile-Makefile
    trunk/dports/games/fortune/files/patch-strfile.c
    trunk/dports/games/fortune/files/patch-unstr-Makefile

Added Paths:
-----------
    trunk/dports/games/fortune/files/patch-unstr.c

Modified: trunk/dports/games/fortune/Portfile
===================================================================
--- trunk/dports/games/fortune/Portfile	2007-10-24 16:05:05 UTC (rev 30318)
+++ trunk/dports/games/fortune/Portfile	2007-10-24 18:26:45 UTC (rev 30319)
@@ -3,29 +3,26 @@
 PortSystem 1.0
 
 name			fortune
-version			4.6.2-RELEASE
-revision		9
+version			6.2.0-RELEASE
 categories		games
-maintainers		nomaintainer
+maintainers		afb at macports.org openmaintainer
 description		Infamous electronic fortune-cookie generator
 long_description	${description}
-platforms		darwin
+platforms		darwin freebsd
 homepage		http://www.freebsd.org/
 use_bzip2		yes
 
 master_sites    macports
 
-checksums		md5 99166e1c47d4b60c865a31d59d359b16 \
+checksums		md5 6185fe31e512e8b23ac5cc58ede27919 \
 
 extract.only	${name}-${version}.tar.bz2
-depends_lib		lib:libcompat.1:libcompat
 worksrcdir		${name}
 dist_subdir		${name}
 
 patchfiles	\
 		patch-fortune-Makefile patch-strfile-Makefile \
-		patch-unstr-Makefile patch-datfiles-Makefile \
-		patch-fortune.c patch-strfile.c
+		patch-unstr-Makefile patch-datfiles-Makefile
 
 configure {
 	reinplace "s|/usr|${prefix}|" ${worksrcpath}/fortune/pathnames.h
@@ -36,8 +33,8 @@
 
 build.type		bsd
 
-set datfiles "fortunes fortunes.dat fortunes-o fortunes-o.dat fortunes2 \
-		fortunes2.dat fortunes2-o fortunes2-o.dat limerick \
+set datfiles "fortunes fortunes.dat fortunes-o fortunes-o.dat \
+		fortunes2-o fortunes2-o.dat limerick \
 		limerick.dat murphy murphy.dat murphy-o murphy-o.dat \
 		startrek startrek.dat zippy zippy.dat"
 
@@ -59,3 +56,6 @@
 	}
 }
 
+platform darwin {
+        patchfiles-append patch-fortune.c patch-strfile.c patch-unstr.c
+}

Modified: trunk/dports/games/fortune/files/patch-fortune-Makefile
===================================================================
--- trunk/dports/games/fortune/files/patch-fortune-Makefile	2007-10-24 16:05:05 UTC (rev 30318)
+++ trunk/dports/games/fortune/files/patch-fortune-Makefile	2007-10-24 18:26:45 UTC (rev 30319)
@@ -1,16 +1,14 @@
---- fortune/Makefile.orig	Sun Oct 13 13:49:19 2002
-+++ fortune/Makefile	Sun Oct 13 13:50:15 2002
-@@ -2,10 +2,9 @@
- # $FreeBSD: src/games/fortune/fortune/Makefile,v 1.3.8.1 2001/04/25 09:28:54 ru Exp $
+--- fortune/Makefile.orig	2007-09-27 12:17:07.000000000 +0200
++++ fortune/Makefile	2007-09-27 12:21:00.000000000 +0200
+@@ -2,9 +2,10 @@
+ # $FreeBSD: src/games/fortune/fortune/Makefile,v 1.8 2005/02/17 18:06:37 ru Exp $
  
  PROG=	fortune
 -MAN=	fortune.6
--CFLAGS+=-DDEBUG -Wall -I${.CURDIR}/../strfile
 +MAN6=	fortune.6
-+CFLAGS+=-DDEBUG -DREGCOMP -Wall -I${.CURDIR}/../strfile
- DPADD=	${LIBCOMPAT}
--LDADD=	-lcompat
-+LDADD=	-LXXPREFIX/lib -lcompat
+ WARNS?=	2
+ CFLAGS+=-DDEBUG -I${.CURDIR}/../strfile
++CFLAGS+=-D__FBSDID=__RCSID
  
--.include "${.CURDIR}/../../Makefile.inc"
  .include <bsd.prog.mk>
+ 

Modified: trunk/dports/games/fortune/files/patch-fortune.c
===================================================================
--- trunk/dports/games/fortune/files/patch-fortune.c	2007-10-24 16:05:05 UTC (rev 30318)
+++ trunk/dports/games/fortune/files/patch-fortune.c	2007-10-24 18:26:45 UTC (rev 30319)
@@ -1,50 +1,39 @@
---- fortune/fortune.c.orig	2001-07-02 02:35:27.000000000 +0200
-+++ fortune/fortune.c	2007-09-15 12:21:05.000000000 +0200
-@@ -169,6 +169,14 @@
+--- fortune/fortune.c.orig	Tue Oct  8 17:16:06 2002
++++ fortune/fortune.c	Tue Oct  8 17:16:21 2002
+@@ -204,7 +204,7 @@
  #endif
  
- #ifndef NO_REGEX
-+#ifdef REGCOMP
-+#include <regex.h>
-+# define	RE_COMP(p)	(regcomp(&Re_pat, (p), REG_EXTENDED))
-+# define	BAD_COMP(f)	((f) != NULL)
-+# define	RE_EXEC(p)	(!regexec(&Re_pat, (p), NULL, NULL, NULL))
-+
-+regex_t  Re_pat;
-+#else
- #ifdef REGCMP
- # define	RE_COMP(p)	(Re_pat = regcmp(p, NULL))
- # define	BAD_COMP(f)	((f) == NULL)
-@@ -184,6 +192,7 @@
- 
- #endif
- #endif
-+#endif
- 
- int
- main(ac, av)
-@@ -204,7 +213,7 @@
- #endif
- 
  	init_prob();
 -	srandomdev();
 +	srandom(getpid());
  	do {
  		get_fort();
  	} while ((Short_only && fortlen() > SLEN) ||
-@@ -388,11 +397,15 @@
- 		if (ignore_case)
- 			pat = conv_pat(pat);
- 		if (BAD_COMP(RE_COMP(pat))) {
-+#ifdef REGCOMP
-+			fprintf(stderr, "bad pattern: %s\n", pat);
+--- fortune/fortune.c.orig	2007-09-27 12:17:07.000000000 +0200
++++ fortune/fortune.c	2007-09-27 12:42:58.000000000 +0200
+@@ -49,7 +49,15 @@
+ __FBSDID("$FreeBSD: src/games/fortune/fortune/fortune.c,v 1.27 2005/02/17 18:06:37 ru Exp $");
+ 
+ # include	<sys/stat.h>
++#if defined(__FreeBSD__)
+ # include	<sys/endian.h>
++#elif defined(__APPLE__) && defined(__MACH__)
++# include	<machine/endian.h>
++# define be32toh OSSwapBigToHostInt32
 +#else
- #ifndef REGCMP
- 			fprintf(stderr, "%s\n", pat);
- #else	/* REGCMP */
- 			fprintf(stderr, "bad pattern: %s\n", pat);
- #endif	/* REGCMP */
-+#endif	/* REGCOMP */
- 		}
- 	}
- # endif	/* NO_REGEX */
++# include	<netinet/in.h>
++# define be32toh ntohl
++#endif
+ 
+ # include	<dirent.h>
+ # include	<fcntl.h>
+@@ -979,6 +987,9 @@
+ 	(void) lseek(fp->datfd,
+ 		     (off_t) (sizeof fp->tbl + fp->pos * sizeof Seekpts[0]), 0);
+ 	read(fp->datfd, Seekpts, sizeof Seekpts);
++#ifndef __FreeBSD__
++    #define be64toh(x) (((u_int64_t)be32toh((x) & (u_int64_t)0x00000000FFFFFFFFULL)) << 32) | ((u_int64_t)be32toh(((x) & (u_int64_t)0xFFFFFFFF00000000ULL) >> 32))
++#endif
+ 	Seekpts[0] = be64toh(Seekpts[0]);
+ 	Seekpts[1] = be64toh(Seekpts[1]);
+ }

Modified: trunk/dports/games/fortune/files/patch-strfile-Makefile
===================================================================
--- trunk/dports/games/fortune/files/patch-strfile-Makefile	2007-10-24 16:05:05 UTC (rev 30318)
+++ trunk/dports/games/fortune/files/patch-strfile-Makefile	2007-10-24 18:26:45 UTC (rev 30319)
@@ -1,13 +1,14 @@
---- strfile/Makefile.orig	Wed Oct  9 13:01:39 2002
-+++ strfile/Makefile	Wed Oct  9 13:02:42 2002
-@@ -2,9 +2,8 @@
- # $FreeBSD: src/games/fortune/strfile/Makefile,v 1.2.8.1 2001/04/25 09:28:54 ru Exp $
+--- strfile/Makefile.orig	2005-02-23 21:42:47.000000000 +0100
++++ strfile/Makefile	2007-09-27 12:21:48.000000000 +0200
+@@ -2,8 +2,9 @@
+ # $FreeBSD: src/games/fortune/strfile/Makefile,v 1.7 2005/02/23 20:42:47 ru Exp $
  
  PROG=	strfile
 -MAN=	strfile.8
 +MAN8=	strfile.8
  MLINKS= strfile.8 unstr.8
- CFLAGS+= -Wall
+-WARNS?=	6
++WARNS?=	2
++CFLAGS+=-D__FBSDID=__RCSID
  
--.include "${.CURDIR}/../../Makefile.inc"
  .include <bsd.prog.mk>

Modified: trunk/dports/games/fortune/files/patch-strfile.c
===================================================================
--- trunk/dports/games/fortune/files/patch-strfile.c	2007-10-24 16:05:05 UTC (rev 30318)
+++ trunk/dports/games/fortune/files/patch-strfile.c	2007-10-24 18:26:45 UTC (rev 30319)
@@ -9,3 +9,31 @@
  
  	Tbl.str_flags |= STR_RANDOM;
  	cnt = Tbl.str_numstr;
+--- strfile/strfile.c.orig	2007-09-27 12:48:32.000000000 +0200
++++ strfile/strfile.c	2007-09-27 12:54:12.000000000 +0200
+@@ -49,7 +49,15 @@
+ __FBSDID("$FreeBSD: src/games/fortune/strfile/strfile.c,v 1.28 2005/02/17 18:06:37 ru Exp $");
+ 
+ # include	<sys/param.h>
++#if defined(__FreeBSD__)
+ # include	<sys/endian.h>
++#elif defined(__APPLE__) && defined(__MACH__)
++# include	<machine/endian.h>
++# define htobe32 OSSwapHostToBigInt32
++#else
++# include	<netinet/in.h>
++# define htobe32 htonl
++#endif
+ # include	<stdio.h>
+ # include       <stdlib.h>
+ # include	<ctype.h>
+@@ -252,6 +261,9 @@
+ 	Tbl.str_shortlen = htobe32(Tbl.str_shortlen);
+ 	Tbl.str_flags = htobe32(Tbl.str_flags);
+ 	(void) fwrite((char *) &Tbl, sizeof Tbl, 1, outf);
++#ifndef __FreeBSD__
++    #define htobe64(x) (((u_int64_t)htobe32((x) & (u_int64_t)0x00000000FFFFFFFFULL)) << 32) | ((u_int64_t)htobe32(((x) & (u_int64_t)0xFFFFFFFF00000000ULL) >> 32))
++#endif
+ 	if (STORING_PTRS) {
+ 		for (p = Seekpts, cnt = Num_pts; cnt--; ++p)
+ 			*p = htobe64(*p);

Modified: trunk/dports/games/fortune/files/patch-unstr-Makefile
===================================================================
--- trunk/dports/games/fortune/files/patch-unstr-Makefile	2007-10-24 16:05:05 UTC (rev 30318)
+++ trunk/dports/games/fortune/files/patch-unstr-Makefile	2007-10-24 18:26:45 UTC (rev 30319)
@@ -1,8 +1,14 @@
---- unstr/Makefile.orig	Tue Oct  8 17:14:12 2002
-+++ unstr/Makefile	Tue Oct  8 17:14:16 2002
-@@ -4,5 +4,4 @@
- NOMAN=	noman
- CFLAGS+=-Wall -I${.CURDIR}/../strfile
+--- unstr/Makefile.orig	2007-09-27 13:14:30.000000000 +0200
++++ unstr/Makefile	2007-09-27 13:15:22.000000000 +0200
+@@ -2,9 +32,10 @@
+ # $FreeBSD: src/games/fortune/unstr/Makefile,v 1.7 2005/02/23 20:59:03 ru Exp $
  
--.include "${.CURDIR}/../../Makefile.inc"
+ PROG=	unstr
+-NO_MAN=
++NOMAN=
+-WARNS?=	6
++WARNS?=	2
+ CFLAGS+= -I${.CURDIR}/../strfile
++CFLAGS+= -D__FBSDID=__RCSID
+ 
  .include <bsd.prog.mk>

Added: trunk/dports/games/fortune/files/patch-unstr.c
===================================================================
--- trunk/dports/games/fortune/files/patch-unstr.c	                        (rev 0)
+++ trunk/dports/games/fortune/files/patch-unstr.c	2007-10-24 18:26:45 UTC (rev 30319)
@@ -0,0 +1,28 @@
+--- unstr/unstr.c.orig	2005-02-23 21:59:03.000000000 +0100
++++ unstr/unstr.c	2007-09-27 13:12:57.000000000 +0200
+@@ -62,7 +62,15 @@
+  */
+ 
+ # include	<sys/param.h>
++#if defined(__FreeBSD__)
+ # include	<sys/endian.h>
++#elif defined(__APPLE__) && defined(__MACH__)
++# include	<machine/endian.h>
++# define be32toh OSSwapBigToHostInt32
++#else
++# include	<netinet/in.h>
++# define be32toh ntohl
++#endif
+ # include	<stdio.h>
+ # include	<ctype.h>
+ # include	<err.h>
+@@ -117,6 +125,9 @@
+ 	off_t	pos;
+ 	char	buf[BUFSIZ];
+ 
++#ifndef __FreeBSD__
++    #define be64toh(x) (((u_int64_t)be32toh(x & (u_int64_t)0x00000000FFFFFFFFULL)) << 32) | ((u_int64_t)be32toh((x & (u_int64_t)0xFFFFFFFF00000000ULL) >> 32))
++#endif
+ 	for (i = 0; i < tbl->str_numstr; i++) {
+ 		(void) fread(&pos, 1, sizeof pos, Dataf);
+ 		(void) fseeko(Inf, be64toh(pos), 0);


Property changes on: trunk/dports/games/fortune/files/patch-unstr.c
___________________________________________________________________
Name: svn:eol-style
   + native

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071024/d75f21ce/attachment.html


More information about the macports-changes mailing list