View | Details | Raw Unified | Return to bug 172866 | Differences between
and this patch

Collapse All | Expand All

(-)./Makefile (-12 / +53 lines)
Lines 2-29 Link Here
2
# Date created:				19 October 2000
2
# Date created:				19 October 2000
3
# Whom:					Maxim Sobolev <sobomax@FreeBSD.org>
3
# Whom:					Maxim Sobolev <sobomax@FreeBSD.org>
4
#
4
#
5
# $FreeBSD: head/games/icebreaker/Makefile 300896 2012-07-14 13:54:48Z beat $
5
# $FreeBSD: ports/games/icebreaker/Makefile,v 1.17 2012/02/18 10:17:54 mva Exp $
6
#
6
#
7
7
8
PORTNAME=	icebreaker
8
PORTNAME=	icebreaker
9
PORTVERSION=	1.2.1
9
PORTVERSION=	1.9.7
10
PORTREVISION=	9
11
CATEGORIES=	games
10
CATEGORIES=	games
12
MASTER_SITES=	http://mattdm.org/icebreaker/1.2.x/
11
MASTER_SITES=	http://mattdm.org/icebreaker/1.9.x/
13
EXTRACT_SUFX=	.tgz
12
EXTRACT_SUFX=	.tgz
13
# http://mattdm.org/icebreaker/1.9.x/icebreaker-1.9.7.tgz
14
14
15
MAINTAINER=	ports@FreeBSD.org
15
MAINTAINER=	nemysis@gmx.ch
16
COMMENT=	A game similar to Jezzball or Barrack
16
COMMENT=	Game similar to Jezzball or Barrack
17
18
LICENSE=	GPLv2
19
20
BUILD_DEPENDS=	pnmtopng:${PORTSDIR}/graphics/netpbm
17
21
18
USE_SDL=	mixer sdl
22
USE_SDL=	mixer sdl
19
USE_GMAKE=	yes
23
USE_GMAKE=	yes
20
MAKE_ENV+=	prefix="${PREFIX}" \
24
21
		highscoredir="${PREFIX}/share/icebreaker/scores" \
25
PLIST_FILES=	bin/${PORTNAME} \
22
		mandir="${MANPREFIX}/man" \
26
		share/pixmaps/${PORTNAME}.png \
23
		CHMOD="${CHMOD}" \
27
		share/applications/${PORTNAME}.desktop
24
		CHOWN="${CHOWN}" \
28
PLIST_DIRSTRY=	share/applications
25
		MKDIR="${MKDIR}"
29
30
PORTDATA=	*
31
PORTDOCS=	ChangeLog README README.SDL README.ifyoumakechanges README.themes TODO
26
32
27
MAN6=		${PORTNAME}.6
33
MAN6=		${PORTNAME}.6
28
34
35
.include <bsd.port.options.mk>
36
37
post-patch:
38
	@${REINPLACE_CMD} \
39
	-e 's|CC=gcc|CC?=g++|' \
40
	-e 's|sdl-config|$(SDL_CONFIG)|' \
41
	-e 's|prefix=/usr/local|prefix=${PREFIX}|' \
42
	-e 's|mandir=$$(prefix)/share/man|mandir=$$(prefix)/man|' \
43
	-e 's|highscoredir=/var/local/lib/games|highscoredir=/var/games|' \
44
	-e 's|CFLAGS=|CFLAGS+=|' \
45
	-e 's|OPTIMIZE=-O3|OPTIMIZE=|' \
46
	-e 's|$$(CC) $$(CFLAGS) $$^ -o icebreaker $$(SDL_LIB)|$$(CC) $$(LDFLAGS) $$(CFLAGS) $$^ -o icebreaker $$(SDL_LIB)|' \
47
	-e 's|install -s -g games -m 2755 icebreaker $(bindir)|install -g games -m 2755 icebreaker $(bindir)|' \
48
	-e 's|install -s -m 755 icebreaker $(bindir)|install -m 755 icebreaker $(bindir)|' \
49
	-e 's|chown -f games:games|chown -f root:games|' \
50
		${WRKSRC}/Makefile
51
	@${REINPLACE_CMD} \
52
	-e 's|%{Summary}|Game similar to Jezzball or Barrack|' \
53
	-e 's|/usr/share/icebreaker/icebreaker_48.bmp|icebreaker|' \
54
		${WRKSRC}/icebreaker.desktop
55
56
post-build:
57
	@(cd ${WRKSRC} && ${LOCALBASE}/bin/winicontoppm -bestqual icebreaker_32.ico | \
58
		${LOCALBASE}/bin/pnmtopng > icebreaker.png)
59
60
post-install:
61
	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.png ${PREFIX}/share/pixmaps
62
	${MKDIR} ${PREFIX}/share/applications
63
	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop ${PREFIX}/share/applications
64
65
.if ${PORT_OPTIONS:MDOCS}
66
	${MKDIR} ${DOCSDIR}
67
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
68
.endif
69
29
.include <bsd.port.mk>
70
.include <bsd.port.mk>
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (icebreaker-1.2.1.tgz) = 95c6d70756f90facc92012549c25740d7432b31da7eafef9bf8fef208fa0ab58
1
SHA256 (icebreaker-1.9.7.tgz) = ca8b344a6a37b2041fba83271ae5e7566cbc8dc4c3367addd46f2a2f3573017e
2
SIZE (icebreaker-1.2.1.tgz) = 56622
2
SIZE (icebreaker-1.9.7.tgz) = 189167
(-)./files/patch-aa (-59 lines)
Lines 1-59 Link Here
1
--- Makefile.orig	Wed Mar  8 15:04:42 2006
2
+++ Makefile	Wed Mar  8 15:04:46 2006
3
@@ -1,6 +1,6 @@
4
-CC=gcc
5
 
6
-SDLCONFIG=sdl-config
7
+SDLCONFIG=$(SDL_CONFIG)
8
+CC?=gcc
9
 
10
 ifndef prefix
11
   prefix=/usr/local
12
@@ -21,16 +21,16 @@
13
 endif
14
 
15
 ifndef OPTIMIZE
16
-  OPTIMIZE=-O3
17
+  OPTIMIZE=
18
 endif
19
 
20
-CFLAGS=-Wall $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\" -DHISCOREPREFIX=\"$(highscoredir)\"
21
+CFLAGS+=-Wall $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\" -DHISCOREPREFIX=\"$(highscoredir)\"
22
 
23
 SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
24
     level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
25
     options.c fullscreen.c
26
 
27
-SDL_MIXER=-lSDL_mixer
28
+SDL_MIXER=-lSDL_mixer -lsmpeg
29
 SDL_LIB=$(SDL_LDFLAGS) $(SDL_MIXER) 
30
 SDL_CFLAGS := $(shell $(SDLCONFIG) --cflags)
31
 SDL_LDFLAGS := $(shell $(SDLCONFIG) --libs)
32
@@ -103,17 +103,17 @@
33
 	   sed 's/\$$VERDATE/$(VERDATE)/' > $@
34
 
35
 install: all
36
-	mkdir -p $(prefix)/bin
37
-	mkdir -p $(prefix)/share/icebreaker
38
-	mkdir -p $(highscoredir)
39
-	mkdir -p $(mandir)/man6
40
-
41
-	install -m 644 *.wav *.bmp $(prefix)/share/icebreaker
42
-	install -g games -s -m 2755 icebreaker $(prefix)/bin
43
-	install -m 644 icebreaker.6 $(mandir)/man6
44
+	$(MKDIR) $(prefix)/share/icebreaker
45
+	$(MKDIR) $(highscoredir)
46
+
47
+	$(BSD_INSTALL_DATA) *.wav *.bmp $(prefix)/share/icebreaker
48
+	$(BSD_INSTALL_PROGRAM) icebreaker $(prefix)/bin
49
+	$(BSD_INSTALL_MAN) icebreaker.6 $(mandir)/man6
50
 	touch $(highscoredir)/icebreaker.scores
51
-	chown games:games $(highscoredir)/icebreaker.scores
52
-	chmod 664 $(highscoredir)/icebreaker.scores
53
+	$(CHOWN) root:games $(prefix)/bin/icebreaker
54
+	$(CHMOD) 2755 $(prefix)/bin/icebreaker
55
+	$(CHOWN) root:games $(highscoredir)/icebreaker.scores
56
+	$(CHMOD) 664 $(highscoredir)/icebreaker.scores
57
 
58
 
59
 include $(SRC:.c=.d)
(-)./files/patch-dialog.c (+24 lines)
Line 0 Link Here
1
--- dialog.c.orig	2002-06-02 16:25:51.000000000 +0200
2
+++ dialog.c	2013-01-13 19:29:58.000000000 +0100
3
@@ -287,10 +287,10 @@
4
 
5
 	for (i=0;i<HISCORENUM;i++)
6
 	{
7
-		snprintf(buf,4,"%d.",i+1);
8
+		snprintf(buf,sizeof(buf),"%d.",i+1);
9
 		puttext(scorelistrect.x+BLOCKWIDTH,scorelistrect.y+45+i*(CHARHEIGHT*2+5),2,color.normaltext,buf);		
10
 		puttext(scorelistrect.x+BLOCKWIDTH*4,scorelistrect.y+45+i*(CHARHEIGHT*2+5),2,color.normaltext,hiscorename[i]);		
11
-		snprintf(buf,30,"%ld",hiscoreval[i]);		
12
+		snprintf(buf,sizeof(buf),"%ld",hiscoreval[i]);		
13
 		puttext(scorelistrect.x+scorelistrect.w-(BLOCKWIDTH*5),scorelistrect.y+45+i*(CHARHEIGHT*2+5),2,color.normaltext,buf);
14
 	}
15
 	
16
@@ -372,7 +372,7 @@
17
 	{
18
 		puttext(helprect.x+BLOCKWIDTH/2,helprect.y+BLOCKHEIGHT/2+i*(CHARHEIGHT*2+4),2,color.normaltext,helptext[i]);		
19
 	}
20
-	snprintf(buf,80,"v%d.%d.%d   %s",VERMAJOR,VERMINOR,VERSUB,"Copyright (c) 2000-2002 Matthew Miller. Released under the GPL.");
21
+	snprintf(buf,sizeof(buf),"v%d.%d.%d   %s",VERMAJOR,VERMINOR,VERSUB,"Copyright (c) 2000-2002 Matthew Miller. Released under the GPL.");
22
 	puttext(helprect.x+BLOCKWIDTH/2,helprect.y+helprect.h-CHARHEIGHT*3,1,color.copyrighttext,buf);		
23
 	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)!");		
24
 	
(-)./files/patch-hiscore.c (+38 lines)
Line 0 Link Here
1
--- hiscore.c.orig	2002-06-02 16:28:35.000000000 +0200
2
+++ hiscore.c	2013-01-13 20:24:43.000000000 +0100
3
@@ -72,7 +72,7 @@
4
 	// make sure all entries are zeroed out to start.
5
 	for (i=0;i<HISCORENUM;i++)
6
 	{
7
-		snprintf(temphiscorename[i],7,"Nobody");
8
+		strcpy(temphiscorename[i],"Nobody");
9
 		temphiscoreval[i]=100; //100 is better than 0. :)
10
 	}
11
 
12
@@ -103,7 +103,7 @@
13
 	// ok, so now, we can copy things over in the proper sorted order
14
 	for (i=0;i<HISCORENUM;i++)
15
 	{
16
-		snprintf(hiscorename[i],50,temphiscorename[arrayindex[i]]);
17
+		snprintf(hiscorename[i],50,"%s",temphiscorename[arrayindex[i]]);
18
 		hiscoreval[i]=temphiscoreval[arrayindex[i]];
19
 	}
20
 
21
@@ -201,7 +201,7 @@
22
 	// make sure the temp array contains the right data
23
 	for (i=0;i<HISCORENUM;i++)
24
 	{
25
-		snprintf(temphiscorename[i],50,hiname[i]);
26
+		snprintf(temphiscorename[i],50,"%s",hiname[i]);
27
 		temphiscoreval[i]=hival[i];
28
 	}
29
 	
30
@@ -221,7 +221,7 @@
31
 	// and take the top ones back.
32
 	for (i=0;i<HISCORENUM;i++)
33
 	{
34
-		snprintf(hiname[i],50,temphiscorename[arrayindex[i]]); 
35
+		snprintf(hiname[i],50,"%s",temphiscorename[arrayindex[i]]);
36
 		hival[i]=temphiscoreval[arrayindex[i]];
37
 	}
38
 }
(-)./files/patch-line.c (+13 lines)
Line 0 Link Here
1
--- line.c.orig	2002-05-31 05:15:45.000000000 +0200
2
+++ line.c	2013-01-13 19:49:19.000000000 +0100
3
@@ -30,8 +30,9 @@
4
 
5
 Line createline(int linenum)
6
 {
7
-	Line l;
8
+	static Line l;
9
 
10
+	memset(&l, 0, sizeof(l));
11
 	switch (linenum)
12
 	{
13
 		case 1: 
(-)./files/patch-options.c (+65 lines)
Line 0 Link Here
1
--- options.c.orig	2002-05-31 05:15:46.000000000 +0200
2
+++ options.c	2013-01-13 19:54:42.000000000 +0100
3
@@ -66,7 +66,7 @@
4
 	options.autopause=AUTOPAUSEOFF;	
5
 	options.difficulty=NORMAL;
6
 	options.fullscreen=FULLSCREENOFF;
7
-	snprintf(options.theme,MAXTHEMENAMELENGTH+1,"linux");
8
+	strcpy(options.theme,"linux");
9
 }
10
 
11
 int readoptions(void)
12
@@ -81,7 +81,7 @@
13
 
14
 	setdefaultoptions();
15
 	
16
-	snprintf(filename,255,"%s/%s",homedir,OPTIONFILE);
17
+	snprintf(filename,sizeof(filename),"%s/%s",homedir,OPTIONFILE);
18
 	
19
 	optionfile=fopen(filename,"r");
20
 	if (optionfile==NULL)
21
@@ -99,7 +99,7 @@
22
 		}
23
 		
24
 		sprintf(scanformat,"%%20s %%%ds",10+MAXTHEMENAMELENGTH);	
25
-		if (sscanf(linebuf,"%20s %10s",optbuf,valbuf)==2)
26
+		if (sscanf(linebuf,"%19s %9s",optbuf,valbuf)==2)
27
 		{
28
 			if (!strcmp(optbuf,"sound"))
29
 			{
30
@@ -135,7 +135,7 @@
31
 			}
32
 			else if (!strcmp(optbuf,"theme"))
33
 			{
34
-				snprintf(options.theme,MAXTHEMENAMELENGTH+1,"%s",valbuf);
35
+				snprintf(options.theme,sizeof(options.theme),"%s",valbuf);
36
 			}
37
 			// FIX: add username
38
 		}
39
@@ -150,7 +150,7 @@
40
 {
41
 	FILE * optionfile;
42
 	char filename[255];
43
-	snprintf(filename,255,"%s/%s",homedir,OPTIONFILE);
44
+	snprintf(filename,sizeof(filename),"%s/%s",homedir,OPTIONFILE);
45
 	
46
 	optionfile=fopen(filename,"w");
47
 	if (optionfile==NULL)
48
@@ -292,7 +292,7 @@
49
 			else
50
 			{
51
 				// fix -- we should probably search for malicious characters here.
52
-				snprintf(commandline.theme,MAXTHEMENAMELENGTH+1,"%s",argv[i]+strlen(FLAGTHEME));
53
+				snprintf(commandline.theme,sizeof(commandline.theme),"%s",argv[i]+strlen(FLAGTHEME));
54
 			}	
55
 		}
56
 		else if (strncmp(argv[i],FLAGTHEMELONG "=" ,strlen(FLAGTHEMELONG "=")) == 0)
57
@@ -312,7 +312,7 @@
58
 			else
59
 			{
60
 				// fix -- we should probably search for malicious characters here.
61
-				snprintf(commandline.theme,MAXTHEMENAMELENGTH+1,"%s",argv[i]+strlen(FLAGTHEMELONG "="));
62
+				snprintf(commandline.theme,sizeof(commandline.theme),"%s",argv[i]+strlen(FLAGTHEMELONG "="));
63
 			}	
64
 		}
65
 		else if (strncmp(argv[i],FLAGTHEMELONG,strlen(FLAGTHEMELONG)) == 0)
(-)./files/patch-options_c (-12 lines)
Lines 1-12 Link Here
1
$OpenBSD: patch-options_c,v 1.1 2003/06/17 01:32:49 avsm Exp $
2
--- options.c.orig	Tue Jun 17 02:20:08 2003
3
+++ options.c	Tue Jun 17 02:21:20 2003
4
@@ -71,7 +71,7 @@ int readoptions(void)
5
 			linebuf[i]=tolower(linebuf[i]);
6
 		}
7
 			
8
-		if (sscanf(linebuf,"%20s %10s",optbuf,valbuf)==2)
9
+		if (sscanf(linebuf,"%19s %9s",optbuf,valbuf)==2)
10
 		{
11
 			if (!strcmp(optbuf,"sound"))
12
 			{
(-)./files/patch-penguin.c (+13 lines)
Line 0 Link Here
1
--- penguin.c.orig	2002-05-31 05:15:46.000000000 +0200
2
+++ penguin.c	2013-01-13 19:57:45.000000000 +0100
3
@@ -40,8 +40,9 @@
4
 
5
 Penguin createpenguinxy(int x, int y)
6
 {
7
-	Penguin p;
8
+	static Penguin p;
9
 
10
+	memset(&p, 0, sizeof(p));
11
 	switch (random() % 4)
12
 	{
13
 		case 0:
(-)./files/patch-themes.c (+52 lines)
Line 0 Link Here
1
--- themes.c.orig	2002-05-31 05:49:53.000000000 +0200
2
+++ themes.c	2013-01-13 19:42:26.000000000 +0100
3
@@ -192,7 +192,7 @@
4
 
5
 	foundcolor.spritetransparent = 0;
6
 	
7
-	snprintf(themefilename, 256,"%s/%s%s",DATAPREFIX,themename,THEMEFILEEXTENSION);
8
+	snprintf(themefilename, sizeof(themefilename),"%s/%s%s",DATAPREFIX,themename,THEMEFILEEXTENSION);
9
 	
10
 	themefile=fopen(themefilename,"r");
11
 	if (themefile==NULL)
12
@@ -338,7 +338,7 @@
13
 						               "We'll try to load it anyway, but don't be surpised if there's a problem.\n"
14
 						               "(Filename is %s)\n",themename,valbuf);
15
 					}
16
-					snprintf(loadfilebuf, 256,"%s/%s",DATAPREFIX,valbuf);
17
+					snprintf(loadfilebuf, sizeof(loadfilebuf),"%s/%s",DATAPREFIX,valbuf);
18
 					spriteimage=loadsprite(themename,loadfilebuf);
19
 				}
20
 				else if (!strcmp(optbuf,"spritemirrorbitmap"))
21
@@ -349,7 +349,7 @@
22
 						               "We'll try to load it anyway, but don't be surpised if there's a problem.\n"
23
 						               "(Filename is %s)\n",themename,valbuf);
24
 					}
25
-					snprintf(loadfilebuf, 256,"%s/%s",DATAPREFIX,valbuf);
26
+					snprintf(loadfilebuf, sizeof(loadfilebuf),"%s/%s",DATAPREFIX,valbuf);
27
 					spritemirrorimage=loadsprite(themename,loadfilebuf);
28
 				}
29
 				else if (!strcmp(optbuf,"soundouch"))
30
@@ -360,7 +360,7 @@
31
 						               "We'll try to load it anyway, but don't be surpised if there's a problem.\n"
32
 						               "(Filename is %s)\n",themename,valbuf);
33
 					}
34
-					snprintf(loadfilebuf, 256,"%s/%s",DATAPREFIX,valbuf);
35
+					snprintf(loadfilebuf, sizeof(loadfilebuf),"%s/%s",DATAPREFIX,valbuf);
36
 					loadsounds(themename,loadfilebuf,NULL);
37
 				}
38
 				else if (!strcmp(optbuf,"soundcrash"))
39
@@ -483,11 +483,11 @@
40
 	{
41
 		fprintf(stderr,"Hey! You can't have a theme named random! Please remove the random.ibt\n"
42
 		        "file from your themes directory.\n");
43
-		snprintf(themename,MAXTHEMENAMELENGTH+1,"linux");
44
+		strcpy(themename,"linux");
45
 	}
46
 	else
47
 	{
48
-		snprintf(themename,MAXTHEMENAMELENGTH+1,themelist[random() %themecount]);
49
+		snprintf(themename,sizeof(themename),"%s",themelist[random() %themecount]);
50
 	}
51
 	freethemenames(&themelist,themecount);
52
 	return settheme(themename);
(-)./pkg-descr (-1 / +1 lines)
Lines 21-24 Link Here
21
life. This will continue until you lose, or until you exceed level one hundred
21
life. This will continue until you lose, or until you exceed level one hundred
22
or so, which Ain't Gonna Happen.
22
or so, which Ain't Gonna Happen.
23
23
24
WWW: http://www.mattdm.org/icebreaker/
24
WWW: http://mattdm.org/icebreaker/
(-)./pkg-plist (-9 lines)
Lines 1-9 Link Here
1
bin/icebreaker
2
%%DATADIR%%/crash.wav
3
%%DATADIR%%/icebreaker_48.bmp
4
%%DATADIR%%/ouch.wav
5
%%DATADIR%%/penguin.bmp
6
%%DATADIR%%/penguinicon_32.bmp
7
%%DATADIR%%/scores/icebreaker.scores
8
@dirrm %%DATADIR%%/scores
9
@dirrm %%DATADIR%%

Return to bug 172866