updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / wok / patch_wok_1.0-1.diff
blob3042eccaf919fb9fb0f1d193271ce50785e292b7
1 --- wok-1.0.orig/debian/patches/03_sounds_dir.patch
2 +++ wok-1.0/debian/patches/03_sounds_dir.patch
3 @@ -0,0 +1,45 @@
4 +diff -ruN wok-1.0.orig/sound.c wok-1.0.new/sound.c
5 +--- wok-1.0.orig/sound.c 2001-11-10 06:28:18.000000000 +0100
6 ++++ wok-1.0.new/sound.c 2006-09-23 21:58:05.000000000 +0200
7 +@@ -17,9 +17,14 @@
8 + #include "SDL_mixer.h"
9 + #include "sound.h"
11 ++#ifndef SOUNDS_DIRECTORY
12 ++#define SOUNDS_DIRECTORY "sounds/"
13 ++#endif
15 + // Include music_ogg.h and define _Mix_Music to rewind the ogg audio.
16 + #include "music_ogg.h"
17 + struct _Mix_Music {
18 ++/* enum already defined in SDL_mixer.h - Miriam Ruiz, Jan 2005
19 + enum {
20 + MUS_CMD,
21 + MUS_WAV,
22 +@@ -28,6 +33,8 @@
23 + MUS_OGG,
24 + MUS_MP3
25 + } type;
26 ++*/
27 ++ Mix_MusicType type;
28 + union {
29 + #ifdef CMD_MUSIC
30 + MusicCMD *cmd;
31 +@@ -126,7 +133,7 @@
32 + char name[32];
34 + for ( i=0 ; i<MUSIC_NUM ; i++ ) {
35 +- strcpy(name, "sounds/");
36 ++ strcpy(name, SOUNDS_DIRECTORY);
37 + strcat(name, musicFileName[i]);
38 + if ( NULL == (music[i] = Mix_LoadMUS(name)) ) {
39 + fprintf(stderr, "Couldn't load: %s\n", name);
40 +@@ -135,7 +142,7 @@
41 + }
42 + }
43 + for ( i=0 ; i<CHUNK_NUM ; i++ ) {
44 +- strcpy(name, "sounds/");
45 ++ strcpy(name, SOUNDS_DIRECTORY);
46 + strcat(name, chunkFileName[i]);
47 + if ( NULL == (chunk[i] = Mix_LoadWAV(name)) ) {
48 + fprintf(stderr, "Couldn't load: %s\n", name);
49 --- wok-1.0.orig/debian/patches/04_home_dir.patch
50 +++ wok-1.0/debian/patches/04_home_dir.patch
51 @@ -0,0 +1,62 @@
52 +diff -ruN wok-1.0.orig/wok.c wok-1.0.new/wok.c
53 +--- wok-1.0.orig/wok.c 2001-11-10 06:28:18.000000000 +0100
54 ++++ wok-1.0.new/wok.c 2006-09-23 21:58:05.000000000 +0200
55 +@@ -12,6 +12,7 @@
56 + #include "SDL.h"
57 + #include <stdlib.h>
58 + #include <stdio.h>
59 ++#include <string.h>
61 + #include "wok.h"
62 + #include "screen.h"
63 +@@ -25,13 +26,23 @@
65 + static int noSound = 0;
67 +-#define WOK_PREF_FILE "wok.prf"
68 ++#define WOK_PREF_FILE "/.wok.prf"
69 + #define DEFAULT_HI_SCORE 1000000
71 + // Initialize and load preference.
72 + static void initWok() {
73 ++ char *tmpname;
74 ++ char name[256];
75 + FILE *fp;
76 +- if ( NULL == (fp = fopen(WOK_PREF_FILE,"rb")) ) {
77 ++ tmpname = getenv("HOME");
78 ++ if (strlen(tmpname)>=255-sizeof(WOK_PREF_FILE)) {
79 ++ fprintf(stderr,"Preferences filename is too long.");
80 ++ hiScore = DEFAULT_HI_SCORE;
81 ++ return;
82 ++ }
83 ++ strncpy(name, tmpname,256);
84 ++ strncat(name, WOK_PREF_FILE,256);
85 ++ if ( NULL == (fp = fopen(name,"rb")) ) {
86 + hiScore = DEFAULT_HI_SCORE;
87 + return;
88 + }
89 +@@ -42,11 +53,23 @@
91 + // Quit and save preference.
92 + void quitWok() {
93 ++ char *tmpname;
94 ++ char name[256];
95 + FILE *fp;
96 + if ( !noSound ) closeSound();
97 + closeSDL();
98 + SDL_Quit();
99 +- if ( NULL == (fp = fopen(WOK_PREF_FILE,"wb")) ) exit(1);
100 ++ tmpname = getenv("HOME");
101 ++ if (strlen(tmpname)>=255-sizeof(WOK_PREF_FILE)) {
102 ++ fprintf(stderr,"Preferences filename is too long.");
103 ++ exit(1);
104 ++ }
105 ++ strncpy(name, tmpname,256);
106 ++ strncat(name, WOK_PREF_FILE,256);
107 ++ if ( NULL == (fp = fopen(name,"wb")) ) {
108 ++ fprintf(stderr,"Cannot save preferences.");
109 ++ exit(1);
110 ++ }
111 + putw(hiScore, fp);
112 + fclose(fp);
113 + exit(1);
114 --- wok-1.0.orig/debian/patches/01_makefile.patch
115 +++ wok-1.0/debian/patches/01_makefile.patch
116 @@ -0,0 +1,29 @@
117 +diff -ruN wok-1.0.orig/Makefile wok-1.0.new/Makefile
118 +--- wok-1.0.orig/Makefile 2001-11-10 06:28:24.000000000 +0100
119 ++++ wok-1.0.new/Makefile 2006-09-23 21:58:05.000000000 +0200
120 +@@ -6,16 +6,23 @@
121 + RM = rm -f
122 + CC = gcc
124 ++IMAGES_DIR = images/
125 ++SOUNDS_DIR = sounds/
127 + SDL_LIB = -L/usr/lib -L/usr/local/lib
128 + SDL_INCLUDE = -I/usr/include/SDL -I/usr/local/include/SDL
130 + DEFAULT_CFLAGS = $(SDL_INCLUDE)
132 + PROG = $(NAME)
133 +-MORE_CFLAGS = -O3 -DOGG_MUSIC
134 ++MORE_CFLAGS = -O3
135 + LDFLAGS = $(SDL_LIB) -lSDL -lSDL_image -lSDL_mixer -lpthread
137 +-CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
138 ++DEFINES = -DOGG_MUSIC \
139 ++ -DSOUNDS_DIRECTORY=\"$(SOUNDS_DIR)\" \
140 ++ -DIMAGES_DIRECTORY=\"$(IMAGES_DIR)\"
142 ++CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS) $(DEFINES)
144 + OBJS = $(NAME).$(O) pan.$(O) ball.$(O) board.$(O) generator.$(O) attract.$(O)\
145 + screen.$(O) sound.$(O) vector.$(O)
146 --- wok-1.0.orig/debian/patches/02_images_dir.patch
147 +++ wok-1.0/debian/patches/02_images_dir.patch
148 @@ -0,0 +1,32 @@
149 +diff -ruN wok-1.0.orig/screen.c wok-1.0.new/screen.c
150 +--- wok-1.0.orig/screen.c 2001-11-10 06:28:18.000000000 +0100
151 ++++ wok-1.0.new/screen.c 2006-09-23 21:58:05.000000000 +0200
152 +@@ -16,6 +16,10 @@
154 + #include "screen.h"
156 ++#ifndef IMAGES_DIRECTORY
157 ++#define IMAGES_DIRECTORY "images/"
158 ++#endif
160 + #define SPRITE_NUM_RED_BACK 3
161 + #define SPRITE_NUM_BLUE_BACK (6+10+1+8+4+2+6+8)
162 + #define SPRITE_NUM (SPRITE_NUM_RED_BACK+SPRITE_NUM_BLUE_BACK)
163 +@@ -53,7 +57,7 @@
164 + color[0].r = 255; color[0].g = 0; color[0].b = 0;
165 + SDL_SetColors(video, color, 0, 1);
166 + for ( i=0 ; i<SPRITE_NUM_RED_BACK ; i++ ) {
167 +- strcpy(name, "images/");
168 ++ strcpy(name, IMAGES_DIRECTORY);
169 + strcat(name, spriteFile[i]);
170 + img = IMG_Load(name);
171 + if ( img == NULL ) {
172 +@@ -69,7 +73,7 @@
173 + color[0].r = 0; color[0].g = 0; color[0].b = 255;
174 + SDL_SetColors(video, color, 0, 1);
175 + for ( ; i<SPRITE_NUM ; i++ ) {
176 +- strcpy(name, "images/");
177 ++ strcpy(name, IMAGES_DIRECTORY);
178 + strcat(name, spriteFile[i]);
179 + img = IMG_Load(name);
180 + if ( img == NULL ) {
181 --- wok-1.0.orig/debian/patches/series
182 +++ wok-1.0/debian/patches/series
183 @@ -0,0 +1,4 @@
184 +01_makefile.patch -p1
185 +02_images_dir.patch -p1
186 +03_sounds_dir.patch -p1
187 +04_home_dir.patch -p1
188 --- wok-1.0.orig/debian/changelog
189 +++ wok-1.0/debian/changelog
190 @@ -0,0 +1,21 @@
191 +wok (1.0-1) unstable; urgency=low
193 + [ Miriam Ruiz ]
194 + * Initial package.
195 + * Patches:
196 + - Commented out and replaced enum defined in sound.c as it was already
197 + defined in SDL_mixer.h
198 + - Modified screen.c and sound.c to configure "images/" and "sounds/"
199 + directories through preprocessor definitions
200 + - Modified sound.c to load audio from the same directory as sounds, rather
201 + than a hard-coded path.
202 + - Modified wok.c to store preferences in $HOME.
204 + [ Jon Dowland ]
205 + * update menu section to "Games/Action" for menu policy transition.
206 + Thanks Linas Žvirblis.
208 + [ Cyril Brulebois ]
209 + * Added XS-Vcs-Svn and XS-Vcs-Browser fields in the control file.
211 + -- Miriam Ruiz <little_miry@yahoo.es> Tue, 04 Sep 2007 09:15:15 +0000
212 --- wok-1.0.orig/debian/control
213 +++ wok-1.0/debian/control
214 @@ -0,0 +1,38 @@
215 +Source: wok
216 +Section: games
217 +Priority: optional
218 +Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
219 +Uploaders: Miriam Ruiz <little_miry@yahoo.es>, Dafydd Harries <daf@debian.org>
220 +Build-Depends: debhelper (>= 4.0.0), quilt, libsdl1.2-dev, libsdl-image1.2-dev, libsdl-mixer1.2-dev, libogg-dev (>=1.0rc2-2), libvorbis-dev (>=1.0rc2-2)
221 +Standards-Version: 3.7.2
222 +XS-Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/wok/
223 +XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/wok/?op=log
225 +Package: wok
226 +Architecture: any
227 +Depends: ${shlibs:Depends}, wok-data (= ${source:Version})
228 +Description: oddly attractive ball tossing game
229 + The game objective is very simple. Catch the falling balls by the wok
230 + (a flying pan) and throw them to the right. You can control the wok by
231 + mouse.
232 + To earn more score, you should throw many balls continuously. Collect
233 + many balls on the wok, and throw them at the same time.
234 + If a ball falls to the lower end of the screen, the game is over.
236 + Wok was created by Kenta Cho.
238 + Homepage: http://www.asahi-net.or.jp/~cs8k-cyu/linux/wok_e.html
240 +Package: wok-data
241 +Architecture: all
242 +Depends: ${misc:Depends}
243 +Recommends: wok
244 +Description: oddly attractive ball tossing game - data files
245 + The game objective is very simple. Catch the falling balls by the wok
246 + (a flying pan) and throw them to the right. You can control the wok by
247 + mouse.
248 + To earn more score, you should throw many balls continuously. Collect
249 + many balls on the wok, and throw them at the same time.
250 + If a ball falls to the lower end of the screen, the game is over.
252 + This package contains data files for the wok game.
253 --- wok-1.0.orig/debian/wok-data.docs
254 +++ wok-1.0/debian/wok-data.docs
255 @@ -0,0 +1 @@
256 +README
257 --- wok-1.0.orig/debian/rules
258 +++ wok-1.0/debian/rules
259 @@ -0,0 +1,84 @@
260 +#!/usr/bin/make -f
262 +#export DH_VERBOSE=1
264 +CFLAGS = -DLINUX -Wall -g
266 +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
267 + CFLAGS += -O0
268 +else
269 + CFLAGS += -O3
270 +endif
272 +build: build-stamp
274 +build-stamp:
275 + dh_testdir
277 + $(MAKE) -f /usr/share/quilt/quilt.make patch
279 + $(MAKE) MORE_CFLAGS="$(CFLAGS)" \
280 + IMAGES_DIR="/usr/share/games/wok/images/" \
281 + SOUNDS_DIR="/usr/share/games/wok/sounds/"
283 + touch build-stamp
285 +clean:
286 + dh_testdir
287 + dh_testroot
288 + rm -f *-stamp
290 + $(MAKE) clean
292 + $(MAKE) -f /usr/share/quilt/quilt.make unpatch
294 + dh_clean
296 +install-indep:
297 + dh_installdirs -i usr/share/games/wok/images
298 + dh_installdirs -i usr/share/games/wok/sounds
299 + dh_install -i images/* usr/share/games/wok/images
300 + dh_install -i sounds/* usr/share/games/wok/sounds
302 +install-arch: build
303 + dh_testdir
304 + dh_testroot
305 + dh_installdirs -a usr/games
306 + dh_install -a wok usr/games
307 + dh_installdirs -a usr/share/pixmaps
308 + dh_install -a debian/wok.xpm usr/share/pixmaps
310 +install: install-arch install-indep
312 +binary-indep: install-indep
313 + dh_testdir
314 + dh_testroot
315 + dh_installchangelogs -i
316 + dh_installdocs -i
317 + dh_compress -i
318 + dh_fixperms -i
319 + dh_installdeb -i
320 + dh_gencontrol -i
321 + dh_md5sums -i
322 + dh_builddeb -i
324 +binary-arch: install-arch
325 + dh_testdir
326 + dh_testroot
327 + dh_installmenu -a
328 + dh_installman -a debian/wok.6
329 + dh_link -a usr/share/doc/wok-data usr/share/doc/wok
330 + dh_strip -a
331 + dh_compress -a
332 + dh_fixperms -a
333 + dh_installdeb -a
334 + dh_shlibdeps -a
335 + dh_gencontrol -a
336 + dh_md5sums -a
337 + dh_builddeb -a
339 +binary: binary-indep binary-arch
341 +.PHONY: build clean install-indep install-arch install binary-indep \
342 + binary-arch binary
344 --- wok-1.0.orig/debian/copyright
345 +++ wok-1.0/debian/copyright
346 @@ -0,0 +1,32 @@
347 +This package was debianized by Miriam Ruiz <little_miry@yahoo.es> on
348 +Mon, 24 Jan 2005 18:40:00 +0100.
350 +It was downloaded from http://www.asahi-net.or.jp/~cs8k-cyu/linux/wok_e.html
352 +Copyright: Kenta Cho, 2001.
354 +Author: Kenta Cho <cs8k-cyu@asahi-net.or.jp>
356 +License:
358 +Redistribution and use in source and binary forms,
359 +with or without modification, are permitted provided that
360 +the following conditions are met:
362 + 1. Redistributions of source code must retain the above copyright notice,
363 + this list of conditions and the following disclaimer.
365 + 2. Redistributions in binary form must reproduce the above copyright notice,
366 + this list of conditions and the following disclaimer in the documentation
367 + and/or other materials provided with the distribution.
369 +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
370 +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
371 +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
372 +THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
373 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
374 +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
375 +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
376 +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
377 +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
378 +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
379 --- wok-1.0.orig/debian/compat
380 +++ wok-1.0/debian/compat
381 @@ -0,0 +1 @@
383 --- wok-1.0.orig/debian/wok.xpm
384 +++ wok-1.0/debian/wok.xpm
385 @@ -0,0 +1,41 @@
386 +/* XPM */
387 +static char *wok[]={
388 +"32 32 6 1",
389 +". c None",
390 +"a c #0000ff",
391 +"c c #808080",
392 +"# c #ff0000",
393 +"d c #ffc0c0",
394 +"b c #ffff00",
395 +"..................##............",
396 +"..................##.........aa.",
397 +"............................aaaa",
398 +"...aaa......bbb.............aaaa",
399 +"..aaaaa....bbbbb.............aa.",
400 +"..aaaaa....bbbbb................",
401 +"..aaaaa....bbbbb................",
402 +"...aaa......bbb.................",
403 +"............................bb..",
404 +"....................###.....bb..",
405 +"...................#####........",
406 +"...................#####........",
407 +".............##....#####........",
408 +"............####....###.........",
409 +"....ccc.....####................",
410 +"....cdc......##.................",
411 +"....ccc.........................",
412 +".....................bb.........",
413 +"...ccc..............bbbb........",
414 +"...cdc.........aa...bbbb........",
415 +"...ccc.........aa....bb.....ccc.",
416 +"............................cdc.",
417 +"..ccc.......................ccc.",
418 +"..cdc.ccc.......................",
419 +"..ccc.cdc.ccc..............ccc..",
420 +"......ccc.cdc.ccc..........cdc..",
421 +"..........ccc.cdc.ccc......ccc..",
422 +"..............ccc.cdc.ccc.......",
423 +"..................ccc.cdc.ccc...",
424 +"......................ccc.cdc...",
425 +"..........................ccc...",
426 +"................................"};
427 --- wok-1.0.orig/debian/menu
428 +++ wok-1.0/debian/menu
429 @@ -0,0 +1,3 @@
430 +?package(wok):needs="X11" section="Games/Action"\
431 + title="Wok" command="/usr/games/wok" \
432 + icon="/usr/share/pixmaps/wok.xpm"
433 --- wok-1.0.orig/debian/wok.6
434 +++ wok-1.0/debian/wok.6
435 @@ -0,0 +1,65 @@
436 +.ig
437 +Wok manual page.
439 +Miriam Ruiz <little_miry@yahoo.es>, 2005.
440 +Dafydd Harries <daf@muse.19inch.net>, 2005.
442 +This next line loads the www macro package so that the .URL macro can be used.
444 +.mso www.tmac
445 +.TH Wok 6 "26 January 2005" Wok Games
446 +.SH NAME
448 +Wok \- ball-catching game
450 +.SH SYNOPSIS
452 +.B wok
453 +[\-nosound]
454 +[\-mousespeed \fInum\fR]
455 +[\-window]
457 +.SH DESCRIPTION
459 +Stop balls from hitting the floor.
461 +.SH USAGE
463 +FIXME.
465 +.SH OPTIONS
467 +These command line options are available:
468 +.TP
469 +.B \-nosound
470 +Disable sound.
471 +.TP
472 +.B \-window
473 +Launch the game in a window, rather than full\-screen.
474 +.TP
475 +.B \-mousespeed \fInum\fR
476 +Use \fInum\fR as the speed of the mouse movement. 10 is the default.
477 +.TP
478 +.B \-reverse
479 +Reverse the fire key and the special key.
481 +.SH FILES
483 +.TP
484 +.I ~/.wok.prf
485 +This is where Wok records your high score.
486 +.SH AUTHOR
487 +rRootage was written by Kenta Cho.
489 +This manual page was written for Debian by Miriam Ruiz <little_miry@yahoo.es>
490 +and Dafydd Harries <daf@muse.19inch.net>.
492 +.SH SEE ALSO
494 +.ig
495 +This is rather hacky -- the turn off line adjustment temporarily using .na/.ad
496 +since lines with very long words (like URLs) look ugly.
498 +.na
499 +.URL http://www.asahi-net.or.jp/~cs8k-cyu/linux/wok_e.html "Wok homepage" .
500 +.ad