Accepting request 665371 from home:mnhauke:games
Initial package for vitetris OBS-URL: https://build.opensuse.org/request/show/665371 OBS-URL: https://build.opensuse.org/package/show/games/vitetris?expand=0&rev=1
This commit is contained in:
commit
aef4cc9b18
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
29
0001-fix-extraneous-licence.patch
Normal file
29
0001-fix-extraneous-licence.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From: Baptiste BEAUPLAT <lyknode@cilg.org>
|
||||
Date: Mon, 15 Oct 2018 20:57:40 +0200
|
||||
Subject: fix-extraneous-licence
|
||||
|
||||
Remove licence.txt file from the Makefile
|
||||
---
|
||||
Makefile | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 05ef506..5df6982 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -56,7 +56,6 @@ src/src-conf.mk: config.mk Makefile src-conf.sh
|
||||
install: $(PROGNAME)
|
||||
$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(docdir)
|
||||
$(INSTALL) -m755 $(PROGNAME) $(DESTDIR)$(bindir)
|
||||
- $(INSTALL) -m644 README licence.txt $(DESTDIR)$(docdir)
|
||||
if [ -n "$(pixmapdir)" ]; then \
|
||||
$(INSTALL) -d $(DESTDIR)$(pixmapdir) && \
|
||||
$(INSTALL) -m644 vitetris.xpm $(DESTDIR)$(pixmapdir); fi
|
||||
@@ -82,7 +81,6 @@ install-hiscores:
|
||||
uninstall:
|
||||
rm -f $(bindir)/$(PROGNAME)
|
||||
rm -f $(docdir)/README
|
||||
- rm -f $(docdir)/licence.txt
|
||||
rmdir $(docdir)
|
||||
test -z "$(pixmapdir)" || rm -f $(pixmapdir)/vitetris.xpm
|
||||
-rmdir "$(pixmapdir)"
|
45
0002-fix-insecure-printf.patch
Normal file
45
0002-fix-insecure-printf.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From: Baptiste BEAUPLAT <lyknode@cilg.org>
|
||||
Date: Mon, 15 Oct 2018 20:57:40 +0200
|
||||
Subject: fix-insecure-printf
|
||||
|
||||
Fix insecure printf
|
||||
---
|
||||
src/cfgfile.c | 4 ++--
|
||||
src/cmdline.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/cfgfile.c b/src/cfgfile.c
|
||||
index 53210a6..b74083b 100644
|
||||
--- a/src/cfgfile.c
|
||||
+++ b/src/cfgfile.c
|
||||
@@ -300,7 +300,7 @@ static void printbtnmapping(FILE *fp, int n, int keypress, int i)
|
||||
return;
|
||||
fprintf(fp, "%s=", input_keynames[i]);
|
||||
if (b < 10)
|
||||
- fprintf(fp, input_chr9[b-1]);
|
||||
+ fprintf(fp, "%s", input_chr9[b-1]);
|
||||
else
|
||||
fprintf(fp, "%d", b-'0');
|
||||
putc('\n', fp);
|
||||
@@ -337,7 +337,7 @@ static void printkeymapping(FILE *fp, int keypress, int i)
|
||||
if (s[0] > ' ')
|
||||
putc(s[0], fp);
|
||||
else if (s[0] < 10)
|
||||
- fprintf(fp, input_chr9[s[0]-1]);
|
||||
+ fprintf(fp, "%s", input_chr9[s[0]-1]);
|
||||
else
|
||||
fprintf(fp, "%d", s[0]);
|
||||
putc('\n', fp);
|
||||
diff --git a/src/cmdline.c b/src/cmdline.c
|
||||
index ec9ba73..32929c6 100644
|
||||
--- a/src/cmdline.c
|
||||
+++ b/src/cmdline.c
|
||||
@@ -357,7 +357,7 @@ static void print_hiscorelist()
|
||||
else {
|
||||
printf(" Name Score Lvl Lines\n");
|
||||
gethiscorelist(buf);
|
||||
- printf(buf);
|
||||
+ printf("%s", buf);
|
||||
}
|
||||
}
|
||||
|
86
0003-rename-program-to-vitetris.patch
Normal file
86
0003-rename-program-to-vitetris.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From: Baptiste BEAUPLAT <lyknode@cilg.org>
|
||||
Date: Mon, 15 Oct 2018 21:03:33 +0200
|
||||
Subject: Rename program from tetris to vitetris to avoid using a registered
|
||||
name
|
||||
|
||||
---
|
||||
INSTALL | 2 +-
|
||||
Makefile | 2 +-
|
||||
README | 8 ++++----
|
||||
vitetris.desktop | 2 +-
|
||||
4 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/INSTALL b/INSTALL
|
||||
index b951d22..36aa9b5 100644
|
||||
--- a/INSTALL
|
||||
+++ b/INSTALL
|
||||
@@ -7,7 +7,7 @@ Linux, *BSD, Mac OS X, etc.
|
||||
|
||||
./configure && make
|
||||
|
||||
- A single executable "tetris" should then have been created, which may be
|
||||
+ A single executable "vitetris" should then have been created, which may be
|
||||
moved anywhere. You can also run "make install" to install the program
|
||||
along with documentation and desktop integration files in /usr/local.
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 5df6982..3a03ed2 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
include config.mk
|
||||
|
||||
-PROGNAME = tetris$(EXE)
|
||||
+PROGNAME = vitetris$(EXE)
|
||||
|
||||
# Uncomment to change the default. (Only used in Unix-like systems.)
|
||||
#HISCORE_FILENAME = /var/games/vitetris-hiscores
|
||||
diff --git a/README b/README
|
||||
index ee4f6f4..3d48abf 100644
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -77,7 +77,7 @@ The Command Line Is Your Friend
|
||||
(since version 0.54) if you only want to connect to a server. But still,
|
||||
you will always get a little more from the command line.
|
||||
|
||||
- Use "tetris -help" (or whatever the command name is) to get a help message
|
||||
+ Use "vitetris -help" (or whatever the command name is) to get a help message
|
||||
with a list of command-line options. If you're on Windows, you need to
|
||||
run this from a cmd window, or a "DOS window".
|
||||
|
||||
@@ -104,11 +104,11 @@ Network Play: The Traditional Way
|
||||
|
||||
To play against someone on the internet, one needs to listen with
|
||||
|
||||
- tetris listen PORT
|
||||
+ vitetris listen PORT
|
||||
|
||||
(where PORT is a number, e.g. 34034); the other connects with
|
||||
|
||||
- tetris connect HOSTNAME:PORT
|
||||
+ vitetris connect HOSTNAME:PORT
|
||||
|
||||
HOSTNAME may be an IP address or a hostname. If it is omitted, localhost
|
||||
is used.
|
||||
@@ -118,7 +118,7 @@ Network Play: The Traditional Way
|
||||
|
||||
It is also possible to play using Unix domain sockets, which means that
|
||||
filenames on the local system are used as addresses. The most convenient
|
||||
- way to set up such a connection is as follows. Start tetris on two
|
||||
+ way to set up such a connection is as follows. Start vitetris on two
|
||||
different terminals. Then one player enters "2-Player Game", which will
|
||||
bring up a list of ttys. When the tty of the other player is selected, an
|
||||
invitation will appear on his screen.
|
||||
diff --git a/vitetris.desktop b/vitetris.desktop
|
||||
index 34daf7b..d26e132 100644
|
||||
--- a/vitetris.desktop
|
||||
+++ b/vitetris.desktop
|
||||
@@ -3,7 +3,7 @@ Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=vitetris
|
||||
GenericName=Text-mode Tetris
|
||||
-Exec=tetris -w 80
|
||||
+Exec=vitetris -w 80
|
||||
Icon=vitetris
|
||||
Categories=Game;BlocksGame;
|
||||
Terminal=true
|
23
0004-add-comment-desktop.patch
Normal file
23
0004-add-comment-desktop.patch
Normal file
@ -0,0 +1,23 @@
|
||||
From: Baptiste BEAUPLAT <lyknode@cilg.org>
|
||||
Date: Mon, 15 Oct 2018 21:26:30 +0200
|
||||
Subject: add-comment-desktop
|
||||
|
||||
---
|
||||
vitetris.desktop | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/vitetris.desktop b/vitetris.desktop
|
||||
index d26e132..1fa6333 100644
|
||||
--- a/vitetris.desktop
|
||||
+++ b/vitetris.desktop
|
||||
@@ -1,9 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
-Encoding=UTF-8
|
||||
Name=vitetris
|
||||
GenericName=Text-mode Tetris
|
||||
Exec=vitetris -w 80
|
||||
Icon=vitetris
|
||||
Categories=Game;BlocksGame;
|
||||
Terminal=true
|
||||
+Comment=Terminal-based Tetris game
|
27
0005-fix-implicit-declaration.patch
Normal file
27
0005-fix-implicit-declaration.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From: Baptiste BEAUPLAT <lyknode@cilg.org>
|
||||
Date: Mon, 15 Oct 2018 21:40:48 +0200
|
||||
Subject: fix-implicit-declaration
|
||||
|
||||
---
|
||||
src/menu/netplay.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/menu/netplay.c b/src/menu/netplay.c
|
||||
index 4814a89..0b03ec7 100644
|
||||
--- a/src/menu/netplay.c
|
||||
+++ b/src/menu/netplay.c
|
||||
@@ -1,11 +1,14 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <ctype.h>
|
||||
#include "menu.h"
|
||||
#include "menuext.h"
|
||||
#include "../input/input.h"
|
||||
#include "../textgfx/textgfx.h"
|
||||
#include "../netw/sock.h"
|
||||
#include "../options.h"
|
||||
+#include "../draw/draw.h"
|
||||
|
||||
extern FILE *inet_out;
|
||||
|
3
vitetris-0.57.2.tar.gz
Normal file
3
vitetris-0.57.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c023b33f663a7a47418652b520e83cdcf8d395584e30ec4bcb5e2b3563d4372b
|
||||
size 99880
|
30
vitetris-fix-font-path.patch
Normal file
30
vitetris-fix-font-path.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff --git a/configure b/configure
|
||||
index 442b0d0..0b359f4 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -742,8 +742,7 @@ echo "pixmapdir = $PIXMAPDIR" >> configmk.tmp
|
||||
echo "desktopdir = $DESKTOPDIR" >> configmk.tmp
|
||||
if [ $OS = unix ]; then
|
||||
echo >> configmk.tmp
|
||||
- echo 'datadir = $(datarootdir)/allegro' >> configmk.tmp
|
||||
- echo '#datadir = $(datarootdir)/allegro/vitetris' >> configmk.tmp
|
||||
+ echo 'datadir = $(datarootdir)/vitetris' >> configmk.tmp
|
||||
else
|
||||
echo 'datadir = $(prefix)' >> configmk.tmp
|
||||
fi
|
||||
diff --git a/src/textgfx/allegro.c b/src/textgfx/allegro.c
|
||||
index 68066bc..9dd75ed 100644
|
||||
--- a/src/textgfx/allegro.c
|
||||
+++ b/src/textgfx/allegro.c
|
||||
@@ -105,10 +105,7 @@ static void load_pc8x16_font()
|
||||
set_allegro_resource_path(5, fname);
|
||||
}
|
||||
#ifdef UNIX
|
||||
- set_allegro_resource_path(4, "/usr/share/allegro/vitetris");
|
||||
- set_allegro_resource_path(3, "/usr/share/allegro");
|
||||
- set_allegro_resource_path(2, "/usr/local/share/allegro/vitetris");
|
||||
- set_allegro_resource_path(1, "/usr/local/share/allegro");
|
||||
+ set_allegro_resource_path(1, "/usr/share/vitetris");
|
||||
#endif
|
||||
if (find_allegro_resource(fname, "pc8x16.fnt", 0,0,0,0,0,
|
||||
sizeof(fname)) == 0)
|
13
vitetris-no-need-for-root-to-install.patch
Normal file
13
vitetris-no-need-for-root-to-install.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 05ef506..164e69e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -5,7 +5,7 @@ PROGNAME = tetris$(EXE)
|
||||
# Uncomment to change the default. (Only used in Unix-like systems.)
|
||||
#HISCORE_FILENAME = /var/games/vitetris-hiscores
|
||||
|
||||
-INSTALL = install -oroot -groot
|
||||
+INSTALL = install
|
||||
|
||||
default: build
|
||||
@echo Done.
|
52
vitetris.6
Normal file
52
vitetris.6
Normal file
@ -0,0 +1,52 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4.
|
||||
.TH VITETRIS "6" "September 2018" "vitetris 0.57.2 (20180628)" "Vitetris Game Manual"
|
||||
.SH NAME
|
||||
vitetris \- The game of tetris
|
||||
.SH DESCRIPTION
|
||||
vitetris 0.57.2 (20180628)
|
||||
.TP
|
||||
\fB\-nomenu\fR
|
||||
Skip menus.
|
||||
.TP
|
||||
\fB\-hiscores\fR
|
||||
Print highscore list and exit.
|
||||
.TP
|
||||
\fB\-hiscores\fR FILE
|
||||
Read and add highscore entries from FILE.
|
||||
.TP
|
||||
\fB\-js0\fR DEVNAME
|
||||
Joystick device name (e.g. \fI\,/dev/js0\/\fP).
|
||||
.TP
|
||||
\fB\-js1\fR DEVNAME
|
||||
Second joystick device name.
|
||||
.TP
|
||||
\fB\-listen\fR PORT
|
||||
Listen for connections on port PORT.
|
||||
.HP
|
||||
\fB\-connect\fR HOSTNAME:PORT
|
||||
.TP
|
||||
Connect to HOSTNAME on PORT.
|
||||
HOSTNAME may be an IP address.
|
||||
.TP
|
||||
\fB\-connect\fR PORT
|
||||
Connect to localhost on PORT.
|
||||
.TP
|
||||
\fB\-name\fR NAME
|
||||
Identify yourself as NAME when connecting to other players.
|
||||
.TP
|
||||
\fB\-help\fR
|
||||
Print this help and exit.
|
||||
.TP
|
||||
\fB\-help\fR game
|
||||
List game options and exit.
|
||||
.TP
|
||||
\fB\-help\fR term
|
||||
List terminal options and exit.
|
||||
.TP
|
||||
\-?, \fB\-h\fR [ARG]
|
||||
Same as \fB\-help\fR ARG (if ARG isn't a number).
|
||||
.PP
|
||||
Options may also be given as option=ARG, \fB\-\-option\fR=\fI\,ARG\/\fR etc.
|
||||
.PP
|
||||
Highscores are saved in /home/local/.vitetris,
|
||||
and in \fI\,/var/games/vitetris\-hiscores\/\fP if it exists and is writable.
|
4
vitetris.changes
Normal file
4
vitetris.changes
Normal file
@ -0,0 +1,4 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 13 08:59:11 UTC 2019 - mardnh@gmx.de
|
||||
|
||||
- Initial package, version 0.57.2
|
111
vitetris.spec
Normal file
111
vitetris.spec
Normal file
@ -0,0 +1,111 @@
|
||||
#
|
||||
# spec file for package vitetris
|
||||
#
|
||||
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
%bcond_without ncurses
|
||||
# build with support for allegro - disabled by default
|
||||
%bcond_with allegro
|
||||
|
||||
Name: vitetris
|
||||
Version: 0.57.2
|
||||
Release: 0
|
||||
Summary: Terminal-based Tetris clone
|
||||
License: BSD-2-Clause
|
||||
Group: Amusements/Games/Action/Arcade
|
||||
URL: http://victornils.net/tetris/
|
||||
#Git-Clone: https://github.com/vicgeralds/vitetris.git
|
||||
Source: https://github.com/vicgeralds/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: vitetris.6
|
||||
Patch0: 0001-fix-extraneous-licence.patch
|
||||
Patch1: 0002-fix-insecure-printf.patch
|
||||
Patch2: 0003-rename-program-to-vitetris.patch
|
||||
Patch3: 0004-add-comment-desktop.patch
|
||||
Patch4: 0005-fix-implicit-declaration.patch
|
||||
Patch5: vitetris-no-need-for-root-to-install.patch
|
||||
Patch6: vitetris-fix-font-path.patch
|
||||
%if 0%{with allegro}
|
||||
BuildRequires: liballeg-devel
|
||||
%endif
|
||||
%if 0%{with ncurses}
|
||||
BuildRequires: ncurses-devel
|
||||
%endif
|
||||
|
||||
%description
|
||||
Vitetris is a terminal-based Tetris game. It can be played by one or
|
||||
two players, over the network or on the same keyboard.
|
||||
|
||||
Vitetris comes with more features and options than might be expected
|
||||
from a simple text mode game. Full input control, customizable
|
||||
appearance, netplay where both players can choose difficulty (level
|
||||
and height) -- unless you must have sound (or just don't like Tetris),
|
||||
you won't be disappointed.
|
||||
|
||||
Rotation, scoring, levels and speed should resemble the early Tetris
|
||||
games by Nintendo, with the addition of a short lock delay which
|
||||
makes it possible to play at higher levels. (It does not make it
|
||||
possible to prevent the piece from ever locking by abusing lock delay
|
||||
resets.)
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
|
||||
%build
|
||||
./configure \
|
||||
--prefix=%{_prefix} \
|
||||
--datarootdir=%{_datadir} \
|
||||
%if 0%{with allegro}
|
||||
--with-allegro \
|
||||
%else
|
||||
--without-allegro \
|
||||
%endif
|
||||
%if 0%{with ncurses}
|
||||
--with-ncurses \
|
||||
%else
|
||||
--without-ncurses \
|
||||
%endif
|
||||
--with-2player \
|
||||
--with-network \
|
||||
--with-term_resizing \
|
||||
--with-menu \
|
||||
--with-blockstyles \
|
||||
--with-pctimer
|
||||
|
||||
make CFLAGS='%{optflags} -Wno-return-type' %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install
|
||||
install -Dm 0644 %{SOURCE1} %{buildroot}%{_mandir}/man6/vitetris.6
|
||||
|
||||
%files
|
||||
%doc README changes.txt
|
||||
%license licence.txt
|
||||
%{_bindir}/vitetris
|
||||
%{_mandir}/man6/%{name}.6%{?ext_man}
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
%{_datadir}/pixmaps/%{name}.xpm
|
||||
%if 0%{with allegro}
|
||||
%dir %{_datadir}/%{name}
|
||||
%{_datadir}/%{name}/pc8x16.fnt
|
||||
%endif
|
||||
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user