Bug 172866 - [PATCH] games/icebreaker: update to 1.9.5, take maintainership, Makefile changed, OptionsNG
Summary: [PATCH] games/icebreaker: update to 1.9.5, take maintainership, Makefile chan...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Marcus von Appen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-19 04:00 UTC by nemysis
Modified: 2013-01-13 22:20 UTC (History)
0 users

See Also:


Attachments
icebreaker-1.9.5.patch (17.05 KB, patch)
2012-10-19 04:00 UTC, nemysis
no flags Details | Diff
icebreaker.diff (15.77 KB, patch)
2013-01-13 19:33 UTC, nemysis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nemysis 2012-10-19 04:00:00 UTC
- Update to 1.9.5
- Take maintainership

Added file(s):
- files/patch-dialog.c
- files/patch-hiscore.c
- files/patch-line.c
- files/patch-options.c
- files/patch-penguin.c
- files/patch-themes.c

Removed file(s):
- files/patch-aa
- files/patch-options_c
- pkg-plist

Makefile changed:

+LICENSE=	GPLv2
+BUILD_DEPENDS=	pnmtopng:${PORTSDIR}/graphics/netpbm
+PLIST_FILES=
+PLIST_DIRSTRY=
+PORTDATA=	*
+PORTDOCS=

+.include <bsd.port.options.mk>

+post-patch:
+		${WRKSRC}/Makefile
+		${WRKSRC}/icebreaker.desktop

+post-build:
+post-install:

Generated and tested manually, tested with port test and with RedPorts (all RELEASES, CLANG), sent with FreeBSD Port Tools 0.99_6 (mode: update, diff: ports)

How-To-Repeat: 
portlint -A
WARN: Makefile: [40]: use ${VARIABLE}, instead of $(VARIABLE).
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
WARN: Makefile: only one MASTER_SITE configured.  Consider adding additional mirrors.
0 fatal errors and 3 warnings found.

WARN: Makefile: [40]: because is used

+	-e 's|mandir=$$(prefix)/share/man|mandir=$$(prefix)/man|' \

port test: clean


Build log

https://redports.org/buildarchive/20121019020651-45485/
Comment 1 Marcus von Appen freebsd_committer freebsd_triage 2013-01-13 18:10:12 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mva

I'll take it.
Comment 2 Marcus von Appen freebsd_committer freebsd_triage 2013-01-13 18:11:25 UTC
State Changed
From-To: open->feedback

A newer version, 1.9.7, is available for that port. Is it possible to 
use that version instead of 1.9.5?
Comment 3 nemysis 2013-01-13 19:33:52 UTC
Changed to newest version 1.9.7
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-01-13 22:14:28 UTC
Author: mva
Date: Sun Jan 13 22:14:17 2013
New Revision: 310341
URL: http://svnweb.freebsd.org/changeset/ports/310341

Log:
  - Update to 1.9.7
  - Pass maintainership to submitter
  - Add LICENSE
  
  PR:		ports/172866
  Submitted by:	nemysis <nemysis@gmx.ch>

Added:
  head/games/icebreaker/files/patch-dialog.c   (contents, props changed)
  head/games/icebreaker/files/patch-hiscore.c   (contents, props changed)
  head/games/icebreaker/files/patch-line.c   (contents, props changed)
  head/games/icebreaker/files/patch-options.c   (contents, props changed)
  head/games/icebreaker/files/patch-penguin.c   (contents, props changed)
  head/games/icebreaker/files/patch-themes.c   (contents, props changed)
Deleted:
  head/games/icebreaker/files/patch-aa
  head/games/icebreaker/files/patch-options_c
  head/games/icebreaker/pkg-plist
Modified:
  head/games/icebreaker/Makefile   (contents, props changed)
  head/games/icebreaker/distinfo   (contents, props changed)

Modified: head/games/icebreaker/Makefile
==============================================================================
--- head/games/icebreaker/Makefile	Sun Jan 13 21:35:06 2013	(r310340)
+++ head/games/icebreaker/Makefile	Sun Jan 13 22:14:17 2013	(r310341)
@@ -1,29 +1,65 @@
-# New ports collection makefile for:	icebreaker
-# Date created:				19 October 2000
-# Whom:					Maxim Sobolev <sobomax@FreeBSD.org>
-#
+# Created by: Maxim Sobolev <sobomax@FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	icebreaker
-PORTVERSION=	1.2.1
-PORTREVISION=	9
+PORTVERSION=	1.9.7
 CATEGORIES=	games
-MASTER_SITES=	http://mattdm.org/icebreaker/1.2.x/
+MASTER_SITES=	http://mattdm.org/icebreaker/1.9.x/
 EXTRACT_SUFX=	.tgz
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	A game similar to Jezzball or Barrack
+MAINTAINER=	nemysis@gmx.ch
+COMMENT=	Game similar to Jezzball or Barrack
+
+LICENSE=	GPLv2
+
+BUILD_DEPENDS=	pnmtopng:${PORTSDIR}/graphics/netpbm
 
 USE_SDL=	mixer sdl
 USE_GMAKE=	yes
-MAKE_ENV+=	prefix="${PREFIX}" \
-		highscoredir="${PREFIX}/share/icebreaker/scores" \
-		mandir="${MANPREFIX}/man" \
-		CHMOD="${CHMOD}" \
-		CHOWN="${CHOWN}" \
-		MKDIR="${MKDIR}"
+
+PLIST_FILES=	bin/${PORTNAME} \
+		share/pixmaps/${PORTNAME}.png \
+		share/applications/${PORTNAME}.desktop
+PLIST_DIRSTRY=	share/applications
+
+PORTDATA=	*
+PORTDOCS=	ChangeLog README README.SDL README.ifyoumakechanges README.themes TODO
 
 MAN6=		${PORTNAME}.6
 
+.include <bsd.port.options.mk>
+
+post-patch:
+	@${REINPLACE_CMD} \
+	-e 's|CC=gcc|CC?=g++|' \
+	-e 's|sdl-config|$(SDL_CONFIG)|' \
+	-e 's|prefix=/usr/local|prefix=${PREFIX}|' \
+	-e 's|mandir=$$(prefix)/share/man|mandir=$$(prefix)/man|' \
+	-e 's|highscoredir=/var/local/lib/games|highscoredir=/var/games|' \
+	-e 's|CFLAGS=|CFLAGS+=|' \
+	-e 's|OPTIMIZE=-O3|OPTIMIZE=|' \
+	-e 's|$$(CC) $$(CFLAGS) $$^ -o icebreaker $$(SDL_LIB)|$$(CC) $$(LDFLAGS) $$(CFLAGS) $$^ -o icebreaker $$(SDL_LIB)|' \
+	-e 's|install -s -g games -m 2755 icebreaker $(bindir)|install -g games -m 2755 icebreaker $(bindir)|' \
+	-e 's|install -s -m 755 icebreaker $(bindir)|install -m 755 icebreaker $(bindir)|' \
+	-e 's|chown -f games:games|chown -f root:games|' \
+		${WRKSRC}/Makefile
+	@${REINPLACE_CMD} \
+	-e 's|%{Summary}|Game similar to Jezzball or Barrack|' \
+	-e 's|/usr/share/icebreaker/icebreaker_48.bmp|icebreaker|' \
+		${WRKSRC}/icebreaker.desktop
+
+post-build:
+	@(cd ${WRKSRC} && ${LOCALBASE}/bin/winicontoppm -bestqual icebreaker_32.ico | \
+		${LOCALBASE}/bin/pnmtopng > icebreaker.png)
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.png ${PREFIX}/share/pixmaps
+	${MKDIR} ${PREFIX}/share/applications
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop ${PREFIX}/share/applications
+
+.if ${PORT_OPTIONS:MDOCS}
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
+.endif
+
 .include <bsd.port.mk>

Modified: head/games/icebreaker/distinfo
==============================================================================
--- head/games/icebreaker/distinfo	Sun Jan 13 21:35:06 2013	(r310340)
+++ head/games/icebreaker/distinfo	Sun Jan 13 22:14:17 2013	(r310341)
@@ -1,2 +1,2 @@
-SHA256 (icebreaker-1.2.1.tgz) = 95c6d70756f90facc92012549c25740d7432b31da7eafef9bf8fef208fa0ab58
-SIZE (icebreaker-1.2.1.tgz) = 56622
+SHA256 (icebreaker-1.9.7.tgz) = ca8b344a6a37b2041fba83271ae5e7566cbc8dc4c3367addd46f2a2f3573017e
+SIZE (icebreaker-1.9.7.tgz) = 189167

Added: head/games/icebreaker/files/patch-dialog.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/icebreaker/files/patch-dialog.c	Sun Jan 13 22:14:17 2013	(r310341)
@@ -0,0 +1,24 @@
+--- dialog.c.orig	2002-06-02 16:25:51.000000000 +0200
++++ dialog.c	2013-01-13 19:29:58.000000000 +0100
+@@ -287,10 +287,10 @@
+ 
+ 	for (i=0;i<HISCORENUM;i++)
+ 	{
+-		snprintf(buf,4,"%d.",i+1);
++		snprintf(buf,sizeof(buf),"%d.",i+1);
+ 		puttext(scorelistrect.x+BLOCKWIDTH,scorelistrect.y+45+i*(CHARHEIGHT*2+5),2,color.normaltext,buf);		
+ 		puttext(scorelistrect.x+BLOCKWIDTH*4,scorelistrect.y+45+i*(CHARHEIGHT*2+5),2,color.normaltext,hiscorename[i]);		
+-		snprintf(buf,30,"%ld",hiscoreval[i]);		
++		snprintf(buf,sizeof(buf),"%ld",hiscoreval[i]);		
+ 		puttext(scorelistrect.x+scorelistrect.w-(BLOCKWIDTH*5),scorelistrect.y+45+i*(CHARHEIGHT*2+5),2,color.normaltext,buf);
+ 	}
+ 	
+@@ -372,7 +372,7 @@
+ 	{
+ 		puttext(helprect.x+BLOCKWIDTH/2,helprect.y+BLOCKHEIGHT/2+i*(CHARHEIGHT*2+4),2,color.normaltext,helptext[i]);		
+ 	}
+-	snprintf(buf,80,"v%d.%d.%d   %s",VERMAJOR,VERMINOR,VERSUB,"Copyright (c) 2000-2002 Matthew Miller. Released under the GPL.");
++	snprintf(buf,sizeof(buf),"v%d.%d.%d   %s",VERMAJOR,VERMINOR,VERSUB,"Copyright (c) 2000-2002 Matthew Miller. Released under the GPL.");
+ 	puttext(helprect.x+BLOCKWIDTH/2,helprect.y+helprect.h-CHARHEIGHT*3,1,color.copyrighttext,buf);		
+ 	puttext(helprect.x+BLOCKWIDTH/2,helprect.y+helprect.h-CHARHEIGHT*1-3,1,color.copyrighttext,"Thanks to my wonderful wife Karen for inspiration (and for patience)!");		
+ 	

Added: head/games/icebreaker/files/patch-hiscore.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/icebreaker/files/patch-hiscore.c	Sun Jan 13 22:14:17 2013	(r310341)
@@ -0,0 +1,38 @@
+--- hiscore.c.orig	2002-06-02 16:28:35.000000000 +0200
++++ hiscore.c	2013-01-13 20:24:43.000000000 +0100
+@@ -72,7 +72,7 @@
+ 	// make sure all entries are zeroed out to start.
+ 	for (i=0;i<HISCORENUM;i++)
+ 	{
+-		snprintf(temphiscorename[i],7,"Nobody");
++		strcpy(temphiscorename[i],"Nobody");
+ 		temphiscoreval[i]=100; //100 is better than 0. :)
+ 	}
+ 
+@@ -103,7 +103,7 @@
+ 	// ok, so now, we can copy things over in the proper sorted order
+ 	for (i=0;i<HISCORENUM;i++)
+ 	{
+-		snprintf(hiscorename[i],50,temphiscorename[arrayindex[i]]);
++		snprintf(hiscorename[i],50,"%s",temphiscorename[arrayindex[i]]);
+ 		hiscoreval[i]=temphiscoreval[arrayindex[i]];
+ 	}
+ 
+@@ -201,7 +201,7 @@
+ 	// make sure the temp array contains the right data
+ 	for (i=0;i<HISCORENUM;i++)
+ 	{
+-		snprintf(temphiscorename[i],50,hiname[i]);
++		snprintf(temphiscorename[i],50,"%s",hiname[i]);
+ 		temphiscoreval[i]=hival[i];
+ 	}
+ 	
+@@ -221,7 +221,7 @@
+ 	// and take the top ones back.
+ 	for (i=0;i<HISCORENUM;i++)
+ 	{
+-		snprintf(hiname[i],50,temphiscorename[arrayindex[i]]); 
++		snprintf(hiname[i],50,"%s",temphiscorename[arrayindex[i]]);
+ 		hival[i]=temphiscoreval[arrayindex[i]];
+ 	}
+ }

Added: head/games/icebreaker/files/patch-line.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/icebreaker/files/patch-line.c	Sun Jan 13 22:14:17 2013	(r310341)
@@ -0,0 +1,13 @@
+--- line.c.orig	2002-05-31 05:15:45.000000000 +0200
++++ line.c	2013-01-13 19:49:19.000000000 +0100
+@@ -30,8 +30,9 @@
+ 
+ Line createline(int linenum)
+ {
+-	Line l;
++	static Line l;
+ 
++	memset(&l, 0, sizeof(l));
+ 	switch (linenum)
+ 	{
+ 		case 1: 

Added: head/games/icebreaker/files/patch-options.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/icebreaker/files/patch-options.c	Sun Jan 13 22:14:17 2013	(r310341)
@@ -0,0 +1,65 @@
+--- options.c.orig	2002-05-31 05:15:46.000000000 +0200
++++ options.c	2013-01-13 19:54:42.000000000 +0100
+@@ -66,7 +66,7 @@
+ 	options.autopause=AUTOPAUSEOFF;	
+ 	options.difficulty=NORMAL;
+ 	options.fullscreen=FULLSCREENOFF;
+-	snprintf(options.theme,MAXTHEMENAMELENGTH+1,"linux");
++	strcpy(options.theme,"linux");
+ }
+ 
+ int readoptions(void)
+@@ -81,7 +81,7 @@
+ 
+ 	setdefaultoptions();
+ 	
+-	snprintf(filename,255,"%s/%s",homedir,OPTIONFILE);
++	snprintf(filename,sizeof(filename),"%s/%s",homedir,OPTIONFILE);
+ 	
+ 	optionfile=fopen(filename,"r");
+ 	if (optionfile==NULL)
+@@ -99,7 +99,7 @@
+ 		}
+ 		
+ 		sprintf(scanformat,"%%20s %%%ds",10+MAXTHEMENAMELENGTH);	
+-		if (sscanf(linebuf,"%20s %10s",optbuf,valbuf)==2)
++		if (sscanf(linebuf,"%19s %9s",optbuf,valbuf)==2)
+ 		{
+ 			if (!strcmp(optbuf,"sound"))
+ 			{
+@@ -135,7 +135,7 @@
+ 			}
+ 			else if (!strcmp(optbuf,"theme"))
+ 			{
+-				snprintf(options.theme,MAXTHEMENAMELENGTH+1,"%s",valbuf);
++				snprintf(options.theme,sizeof(options.theme),"%s",valbuf);
+ 			}
+ 			// FIX: add username
+ 		}
+@@ -150,7 +150,7 @@
+ {
+ 	FILE * optionfile;
+ 	char filename[255];
+-	snprintf(filename,255,"%s/%s",homedir,OPTIONFILE);
++	snprintf(filename,sizeof(filename),"%s/%s",homedir,OPTIONFILE);
+ 	
+ 	optionfile=fopen(filename,"w");
+ 	if (optionfile==NULL)
+@@ -292,7 +292,7 @@
+ 			else
+ 			{
+ 				// fix -- we should probably search for malicious characters here.
+-				snprintf(commandline.theme,MAXTHEMENAMELENGTH+1,"%s",argv[i]+strlen(FLAGTHEME));
++				snprintf(commandline.theme,sizeof(commandline.theme),"%s",argv[i]+strlen(FLAGTHEME));
+ 			}	
+ 		}
+ 		else if (strncmp(argv[i],FLAGTHEMELONG "=" ,strlen(FLAGTHEMELONG "=")) == 0)
+@@ -312,7 +312,7 @@
+ 			else
+ 			{
+ 				// fix -- we should probably search for malicious characters here.
+-				snprintf(commandline.theme,MAXTHEMENAMELENGTH+1,"%s",argv[i]+strlen(FLAGTHEMELONG "="));
++				snprintf(commandline.theme,sizeof(commandline.theme),"%s",argv[i]+strlen(FLAGTHEMELONG "="));
+ 			}	
+ 		}
+ 		else if (strncmp(argv[i],FLAGTHEMELONG,strlen(FLAGTHEMELONG)) == 0)

Added: head/games/icebreaker/files/patch-penguin.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/icebreaker/files/patch-penguin.c	Sun Jan 13 22:14:17 2013	(r310341)
@@ -0,0 +1,13 @@
+--- penguin.c.orig	2002-05-31 05:15:46.000000000 +0200
++++ penguin.c	2013-01-13 19:57:45.000000000 +0100
+@@ -40,8 +40,9 @@
+ 
+ Penguin createpenguinxy(int x, int y)
+ {
+-	Penguin p;
++	static Penguin p;
+ 
++	memset(&p, 0, sizeof(p));
+ 	switch (random() % 4)
+ 	{
+ 		case 0:

Added: head/games/icebreaker/files/patch-themes.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/icebreaker/files/patch-themes.c	Sun Jan 13 22:14:17 2013	(r310341)
@@ -0,0 +1,52 @@
+--- themes.c.orig	2002-05-31 05:49:53.000000000 +0200
++++ themes.c	2013-01-13 19:42:26.000000000 +0100
+@@ -192,7 +192,7 @@
+ 
+ 	foundcolor.spritetransparent = 0;
+ 	
+-	snprintf(themefilename, 256,"%s/%s%s",DATAPREFIX,themename,THEMEFILEEXTENSION);
++	snprintf(themefilename, sizeof(themefilename),"%s/%s%s",DATAPREFIX,themename,THEMEFILEEXTENSION);
+ 	
+ 	themefile=fopen(themefilename,"r");
+ 	if (themefile==NULL)
+@@ -338,7 +338,7 @@
+ 						               "We'll try to load it anyway, but don't be surpised if there's a problem.\n"
+ 						               "(Filename is %s)\n",themename,valbuf);
+ 					}
+-					snprintf(loadfilebuf, 256,"%s/%s",DATAPREFIX,valbuf);
++					snprintf(loadfilebuf, sizeof(loadfilebuf),"%s/%s",DATAPREFIX,valbuf);
+ 					spriteimage=loadsprite(themename,loadfilebuf);
+ 				}
+ 				else if (!strcmp(optbuf,"spritemirrorbitmap"))
+@@ -349,7 +349,7 @@
+ 						               "We'll try to load it anyway, but don't be surpised if there's a problem.\n"
+ 						               "(Filename is %s)\n",themename,valbuf);
+ 					}
+-					snprintf(loadfilebuf, 256,"%s/%s",DATAPREFIX,valbuf);
++					snprintf(loadfilebuf, sizeof(loadfilebuf),"%s/%s",DATAPREFIX,valbuf);
+ 					spritemirrorimage=loadsprite(themename,loadfilebuf);
+ 				}
+ 				else if (!strcmp(optbuf,"soundouch"))
+@@ -360,7 +360,7 @@
+ 						               "We'll try to load it anyway, but don't be surpised if there's a problem.\n"
+ 						               "(Filename is %s)\n",themename,valbuf);
+ 					}
+-					snprintf(loadfilebuf, 256,"%s/%s",DATAPREFIX,valbuf);
++					snprintf(loadfilebuf, sizeof(loadfilebuf),"%s/%s",DATAPREFIX,valbuf);
+ 					loadsounds(themename,loadfilebuf,NULL);
+ 				}
+ 				else if (!strcmp(optbuf,"soundcrash"))
+@@ -483,11 +483,11 @@
+ 	{
+ 		fprintf(stderr,"Hey! You can't have a theme named random! Please remove the random.ibt\n"
+ 		        "file from your themes directory.\n");
+-		snprintf(themename,MAXTHEMENAMELENGTH+1,"linux");
++		strcpy(themename,"linux");
+ 	}
+ 	else
+ 	{
+-		snprintf(themename,MAXTHEMENAMELENGTH+1,themelist[random() %themecount]);
++		snprintf(themename,sizeof(themename),"%s",themelist[random() %themecount]);
+ 	}
+ 	freethemenames(&themelist,themecount);
+ 	return settheme(themename);
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Marcus von Appen freebsd_committer freebsd_triage 2013-01-13 22:14:33 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!