SHA256
1
0
forked from pool/aop

Accepting request 347236 from home:nemysis

Please accept this new RPM.

OBS-URL: https://build.opensuse.org/request/show/347236
OBS-URL: https://build.opensuse.org/package/show/games/aop?expand=0&rev=1
This commit is contained in:
Ferdinand Thiessen 2015-12-02 22:37:10 +00:00 committed by Git OBS Bridge
commit f10c548774
9 changed files with 205 additions and 0 deletions

23
.gitattributes vendored Normal file
View 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
View File

@ -0,0 +1 @@
.osc

3
aop-0.6.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68a8b6b8f08216b31895d536f7dc4beb137a787fd17096da2d46fd863497f65a
size 11811

26
aop-Makefile.patch Normal file
View File

@ -0,0 +1,26 @@
--- Makefile.orig 2015-12-02 20:24:06.948137032 +0100
+++ Makefile 2015-12-02 20:27:39.028599460 +0100
@@ -1,13 +1,18 @@
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DATADIR = $(PREFIX)/share
+DESTDIR =
-LDFLAGS = -lncurses
+LIBS = $(shell ncurses6-config --libs)
aop: aop.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
install: aop
- install -d /usr/local/bin
- install -d /usr/local/share/aop
- install -m 755 aop /usr/local/bin/aop
- install -m 644 aop-level-*.txt /usr/local/share/aop/
+ install -d $(DESTDIR)$(BINDIR)
+ install -d $(DESTDIR)$(DATADIR)/aop
+ install -m 755 aop $(DESTDIR)$(BINDIR)/aop
+ install -m 644 aop-level-*.txt $(DESTDIR)$(DATADIR)/aop/
clean:
rm -f aop core* *~

44
aop-aop.c.patch Normal file
View File

@ -0,0 +1,44 @@
--- aop.c.orig 2004-04-06 15:13:28.000000000 +0200
+++ aop.c 2015-12-02 15:56:44.337361654 +0100
@@ -8,7 +8,7 @@
int main(int argc, char *argv[]) {
int px, py, opx, opy, ipx, ipy, x, y, c=0, p=0, op, dir;
- int last_lv = argc>=2 ? argc-1 : 11, level=1, lifes=5; FILE *f;
+ int last_lv = argc>=2 ? argc-1 : 11, level=1, lives=5; FILE *f;
char ch, field[25][81], tmp[96], *lastword = "Bye.";
if ( argc > 1 && *argv[1] == '-' ) {
@@ -21,7 +21,7 @@
init_pair(1, COLOR_RED, COLOR_BLACK);
start: memset(field, ' ', 25*81);
- snprintf(tmp, 96, "/usr/local/share/aop/aop-level-%02d.txt", level);
+ snprintf(tmp, 96, "/usr/share/aop/aop-level-%02d.txt", level);
f = fopen(argc>=2 ? argv[level] : tmp, "r");
if (!f) { endwin(); printf("Can't open level file.\n"); return 1; }
opx=ipx=px=3, opy=ipy=py=2; op=p; p += 700000 + level*373737;
@@ -41,10 +41,10 @@
if (field[py][px] == '@') {
if(level++ != last_lv) goto start;
lastword="Well done!"; break;
- } else if (field[py][px] == '0') lifes++;
+ } else if (field[py][px] == '0') lives++;
else if (field[py][px] != ' ' && dir) {
field[opy][opx] = '0'; sleep(1); flushinp();
- if(--lifes == 0) { p=op; lastword="Sucker!"; break; }
+ if(--lives == 0) { p=op; lastword="Sucker!"; break; }
opx=px=ipx; opy=py=ipy; c=dir=0; continue;
}
field[opy][opx] = ' '; field[opy=py][opx=px] = 'O';
@@ -53,8 +53,8 @@
mvaddch(y, x, field[y][x]); attroff(COLOR_PAIR(1));
}
attron(COLOR_PAIR(1));
- mvprintw(0, 0, "Lifes: %d, Points: %d ",
- lifes, p=p-(dir < 5 ? 1 : 2));
+ mvprintw(0, 0, "lives: %d, Points: %d ",
+ lives, p=p-(dir < 5 ? 1 : 2));
refresh(); usleep(dir < 5 ? 50000 : 100000);
} while( (c=getch()) != 'q' );
endwin(); printf("%s (%d points)\n", lastword, p);

5
aop.changes Normal file
View File

@ -0,0 +1,5 @@
-------------------------------------------------------------------
Wed Dec 2 20:46:39 UTC 2015 - nemysis@openSUSE.org
- Initial package creation

9
aop.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Ambassador of Pain
GenericName=Ambassador of Pain game
Comment=Ncurses based arcade game with only 64 lines of code
Exec=aop
Icon=aop
Categories=Game;ArcadeGame;
Type=Application
Terminal=true

3
aop.png Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:190add7be596e6ed2f77be9c87fd182d2d3bf941599cdbf762452df0805a3401
size 2470

91
aop.spec Normal file
View File

@ -0,0 +1,91 @@
#
# spec file for package aop
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
Name: aop
Version: 0.6
Release: 0
Summary: Ncurses based arcade game with only 64 lines of code
License: GPL-2.0+
Group: Amusements/Games/Action/Arcade
Url: http://raffi.at/view/code/aop
Source0: http://raffi.at/code/%{name}/%{name}-%{version}.tar.gz
Source1: %{name}.png
Source2: %{name}.desktop
# PATCH-FIX-OPENSUSE - aop-Makefile.patch -- Fix build and installation
Patch0: %{name}-Makefile.patch
# PATCH-FIX-OPENSUSE - aop-aop.c.patch-- Fix lifes and where are levels
Patch1: %{name}-aop.c.patch
%if 0%{?suse_version}
BuildRequires: hicolor-icon-theme
BuildRequires: update-desktop-files
%endif
%if 0%{?suse_version} < 1320
BuildRequires: ncurses-devel
%else
BuildRequires: pkgconfig
BuildRequires: pkgconfig(ncurses)
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Ambassador of Pain is a curses based arcade game for Linux/UNIX
with only 64 lines of sourcecode.
The goal is to drive the hoovercraft (O) trough the level into
the 'at' sign (@) and reach as much points as possible by reducing
the number of moves and don't losing any time.
Lost lifes (0) can easily be picked up by simply drive over them.
%prep
%setup -q
%patch0
%patch1
%build
%if 0%{?suse_version} < 1320
CFLAGS="%optflags $(ncursesw6-config --cflags)"
LIBS="$(ncursesw6-config --libs)"
%else
CFLAGS="%optflags $(pkg-config ncurses --cflags)"
LIBS="$(pkg-config ncurses --libs)"
%endif
make %{?_smp_mflags} CFLAGS="$CFLAGS" LIBS="$LIBS"
%install
%make_install
# install icon
install -Dm 0644 %{S:1} %{buildroot}%{_datadir}/pixmaps/%{name}.png
# install Desktop file
install -Dm 0644 %{S:2} %{buildroot}%{_datadir}/applications/%{name}.desktop
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%endif
%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%changelog