commit f10c5487743136a6f9bf78d8930656824c3721168d144645bd6d973674f5dbd6 Author: Ferdinand Thiessen Date: Wed Dec 2 22:37:10 2015 +0000 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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/aop-0.6.tar.gz b/aop-0.6.tar.gz new file mode 100644 index 0000000..855166a --- /dev/null +++ b/aop-0.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68a8b6b8f08216b31895d536f7dc4beb137a787fd17096da2d46fd863497f65a +size 11811 diff --git a/aop-Makefile.patch b/aop-Makefile.patch new file mode 100644 index 0000000..cf22f3e --- /dev/null +++ b/aop-Makefile.patch @@ -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* *~ diff --git a/aop-aop.c.patch b/aop-aop.c.patch new file mode 100644 index 0000000..1e4b841 --- /dev/null +++ b/aop-aop.c.patch @@ -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); diff --git a/aop.changes b/aop.changes new file mode 100644 index 0000000..f7e21d1 --- /dev/null +++ b/aop.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Wed Dec 2 20:46:39 UTC 2015 - nemysis@openSUSE.org + +- Initial package creation + diff --git a/aop.desktop b/aop.desktop new file mode 100644 index 0000000..def0d9b --- /dev/null +++ b/aop.desktop @@ -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 diff --git a/aop.png b/aop.png new file mode 100644 index 0000000..5b03932 --- /dev/null +++ b/aop.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:190add7be596e6ed2f77be9c87fd182d2d3bf941599cdbf762452df0805a3401 +size 2470 diff --git a/aop.spec b/aop.spec new file mode 100644 index 0000000..b538697 --- /dev/null +++ b/aop.spec @@ -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