summaryrefslogtreecommitdiff
path: root/games-roguelike/moria
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-roguelike/moria
reinit the tree, so we can have metadata
Diffstat (limited to 'games-roguelike/moria')
-rw-r--r--games-roguelike/moria/Manifest11
-rw-r--r--games-roguelike/moria/files/5.5.2-fbsd.patch268
-rw-r--r--games-roguelike/moria/files/5.5.2-gentoo-paths.patch58
-rw-r--r--games-roguelike/moria/files/5.5.2-glibc.patch356
-rw-r--r--games-roguelike/moria/files/5.5.2-hours.patch30
-rw-r--r--games-roguelike/moria/files/5.5.2-warnings.patch12
-rw-r--r--games-roguelike/moria/metadata.xml8
-rw-r--r--games-roguelike/moria/moria-5.5.2.ebuild70
8 files changed, 813 insertions, 0 deletions
diff --git a/games-roguelike/moria/Manifest b/games-roguelike/moria/Manifest
new file mode 100644
index 000000000000..fe1abbf22d41
--- /dev/null
+++ b/games-roguelike/moria/Manifest
@@ -0,0 +1,11 @@
+AUX 5.5.2-fbsd.patch 6904 SHA256 14d431275e60b320c33ee30a0fdf446a04d8786fa51080f9cad60f87b630894c SHA512 ec1c0428bd5223ee2bd5408b482941911fab6650cde1c49ff0c93262ea4203d09502a5bb5fda1ee66588935faccc9c1f0a738c337f8af92a63467238d91f6d8d WHIRLPOOL e051422e773698e449fd72fdf28d95c608536c9d41ed4dc35afccac808ea999e2ddf35c64cb49b5de29dd1a404a10e58c7ebff1d266071efe603ba361620529e
+AUX 5.5.2-gentoo-paths.patch 2363 SHA256 40a8402d7b49bb296eb13e5f3b76fec50a6b484c7ffde7943269e11e92829a35 SHA512 41789167d9e624e0ca2d800bb87851a5e9628b51cc80cc84ca15c974f394d99101ea9cc6bde361b1c2187a3983b5d2291ca15cdbae04499687fd9785e017c32c WHIRLPOOL 91e92fe7afa5797367836643ec6eb241394770261fe5d8a53f0b2f46e04dd7c9d041fd063a5c493a277fd07ffd123f2671aeb4dcb818e20889329f8e5d97f190
+AUX 5.5.2-glibc.patch 9796 SHA256 90ed9516a4acd57c70654f3b5817e694596c90caed10cc08c167ed05926601c8 SHA512 834e3b4521ac00e8367abd3c5e5eefe7859f36f0182794911936006224c9fac94b6e4beae1da73c228e1e434d02cf870fc69f6102b981c78916c204a6eea101d WHIRLPOOL cf5a61dcd1089cde0d55dd05f02d6c12962e0aaf8200d766414d1b0789d5f4855c2a638e9755fc91571f4b110d0f373f23fa740251df34225486e4ae81c2a809
+AUX 5.5.2-hours.patch 1343 SHA256 821d0085fc025419ae57aa4725f7084f6934bf07070d7463118aede4c414f3c4 SHA512 2b59e37741664dcfc095a5ae9ac482d6899d71f8221ca0f7d9d1caee594f05ac2ef043a6ff983e5266b904afa725876210d07b02352921066271f35e2efe7047 WHIRLPOOL f0be07932cb437bd08288924d04c561e7f20dae916022f23cfc39479fef3e15ea83af90852cb1fd4ec104f5ea4951b23fa3307f99dcec245313474d5e1a67853
+AUX 5.5.2-warnings.patch 386 SHA256 ad5ec6b509cf371ea0d367d4aea6f9874ae4083145dd9f0a015c12dbf79ec13d SHA512 64bd3e7a0c613ca3043ea0a4aa4aab83281132af16d73e9ed70f1d5ff979b48cf1f085a030c56f0c17be01bbabb2dd4d9dcbd02d4a204993adec3fd01f03ab5c WHIRLPOOL 2dea4ff1bc6e48d2e61da52f79fb4ff70207e2d07120d8097de2ae8e371595a83ec9ec46889e6d0647f984805719cd328688deb0f8c55214bdd0f418ca110aac
+DIST moria-extras.tar.bz2 57324 SHA256 60f2a7d7bf8615a090cacafd17cf6fae8f9f0af78700439022e25014384b5076 SHA512 39d04ffdbe779fc070ee72084df5c731f8db25116e9156898d4c78c86e02288cf3560849461f2081209a06a74274789a671b104dc806b63a0d955adad17fd85f WHIRLPOOL cb862713c26d18515bb4017a14a8b25943c2a692eaf17d672faa2c8fb34a612a68342c7d21c2bcca247959a4a1906aa5649fda175e7c281cc1d81ba2c6ac9f89
+DIST um5.5.2.tar.Z 910536 SHA256 fffab65703c77058a1aadd8647cc1f44bd4349065af0b334702986f36007b2ed SHA512 987bbccb9cb4870ec91704cd20cf19875320d1cfe62c4c5a0063bfc3827732a0e3334a4ea3712137f3262d7418db0ea7e803d724e2dec4d5eb41ebe741f326cc WHIRLPOOL 568ea63c647cc999267834a24ecf3792f55e83c2942f5bcfaa70ca089abebb4de4d827646d493d551447ed3cdc34e39f31d0cca18f40eb767daf586d38951ebe
+EBUILD moria-5.5.2.ebuild 1930 SHA256 fa8af2f70fb0f4a835ee32936f99bd5e47c6cf6b9d701187d38dae018ca18215 SHA512 c98c72d406ada7b67c85b0dbeaff9c3897efa61a5c5f0ddd5846d96545e8f083ac3b7fcf5ae5baa022366bf860994f49b482ff7da236ee44c1c697c4abd57103 WHIRLPOOL 1209ee78d82c8cff8062f4ba6aeb1eb27fdd98e60103eae346b72a2db33ba9df154cc8e66e00b972ba9db143838d3b9d5aad2a08cfdd81174ff28f16ff7d20e2
+MISC ChangeLog 2718 SHA256 be3eba26c3c7dfd83b22e64155fa772c311e1d26ed87376fd4f9cc3a55b78945 SHA512 8cdeb505cfbd7477f89cd8a59ea07a1283b34fc90445eb0daae1ca44710d8475266793a1bf5dbb151c0514fd67ae61775c227a2ea45c6e5e5cdafa8c97505758 WHIRLPOOL 853716ac93fdf604e187c91119d4f1dcb98e743b60e38967bfb5e09a463cd262d904b5ce8d67c863077a8c8aa5d3d1b7566e540987e1f376a1f33224ccebca08
+MISC ChangeLog-2015 1474 SHA256 d4036f0a296ecd9d469cbab6890c8fe6d1b721b668adc79918c7cdfbe5c83407 SHA512 55ae95054683642e987d2f10ec1a57d85d72f345a3454e307fbce50df5cbdb5b37b4585dea8d9388627b5ced02408b21d9dc104c51ea07b39b78f9aea222631b WHIRLPOOL fa6ce8b57eec5a9429be54c1c5c7fe12db38f9fbe751b1243d37bfdf0453a151d48ecdc7f1cd4b064829a01af6666d612327026241118537c14d79a6cef2c4d7
+MISC metadata.xml 249 SHA256 943b9ce0cd072229b43569ab668dd7ec741d9dfefd942c8921dabd4490b27b0c SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118 WHIRLPOOL b10e21575c78e201a652c8582cd16e3f7c86b13dd20a30f4cea44066fb139440b3c186147dbaae83478f11a20b6f457a99c8b29ee1239a4caaa21eee01250088
diff --git a/games-roguelike/moria/files/5.5.2-fbsd.patch b/games-roguelike/moria/files/5.5.2-fbsd.patch
new file mode 100644
index 000000000000..4f65b08f567d
--- /dev/null
+++ b/games-roguelike/moria/files/5.5.2-fbsd.patch
@@ -0,0 +1,268 @@
+Index: umoria/source/main.c
+===================================================================
+--- umoria.orig/source/main.c
++++ umoria/source/main.c
+@@ -88,6 +88,7 @@
+ #include <time.h>
+ #endif
+
++#ifndef __FreeBSD__
+ #ifndef VMS
+ #ifndef MAC
+ #ifndef GEMDOS
+@@ -98,6 +99,9 @@ long time();
+ char *getenv();
+ #endif
+ #endif
++#else
++#include <stdlib.h>
++#endif
+
+ #ifndef MAC
+ #ifndef AMIGA
+@@ -360,7 +364,7 @@ char *argv[];
+ else
+ { /* Create character */
+ create_character();
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ birth_date = time ((time_t *)0);
+ #else
+ birth_date = time ((long *)0);
+Index: umoria/source/death.c
+===================================================================
+--- umoria.orig/source/death.c
++++ umoria/source/death.c
+@@ -123,6 +123,7 @@ static void kingly(void);
+ #include <stdlib.h>
+ #endif
+
++#ifndef __FreeBSD__
+ #ifndef VMS
+ #ifndef MAC
+ #if !defined(ATARIST_MWC) && !defined(AMIGA)
+@@ -130,18 +131,19 @@ long time();
+ #endif
+ #endif
+ #endif
++#endif
+
+ static void date(day)
+ char *day;
+ {
+ register char *tmp;
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ time_t clockvar;
+ #else
+ long clockvar;
+ #endif
+
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ clockvar = time((time_t *) 0);
+ #else
+ clockvar = time((long *) 0);
+Index: umoria/source/io.c
+===================================================================
+--- umoria.orig/source/io.c
++++ umoria/source/io.c
+@@ -13,6 +13,11 @@
+
+ #include "config.h"
+
++#ifdef __FreeBSD__
++#include <sys/ioctl_compat.h>
++#include <time.h>
++#endif
++
+ #ifdef HPUX
+ #include <sys/bsdtty.h>
+ #endif
+@@ -245,7 +250,9 @@ int suspend()
+ struct ltchars lcbuf;
+ struct tchars cbuf;
+ int lbuf;
++#ifndef __FreeBSD__
+ long time();
++#endif
+
+ py.misc.male |= 2;
+ (void) ioctl(0, TIOCGETP, (char *)&tbuf);
+@@ -313,7 +320,7 @@ void init_curses()
+ #endif
+
+ /* PC curses returns ERR */
+-#if defined(USG) && !defined(PC_CURSES) && !defined(AMIGA)
++#if (defined(USG) && !defined(PC_CURSES) && !defined(AMIGA)) || defined(__FreeBSD__)
+ if (initscr() == NULL)
+ #else
+ if (initscr() == ERR)
+@@ -331,7 +338,7 @@ void init_curses()
+ #if defined(atarist) && defined(__GNUC__)
+ (void) signal (SIGTSTP, (__Sigfunc)suspend);
+ #else
+-#ifdef __386BSD__
++#if defined(__386BSD__) || defined(__FreeBSD__)
+ (void) signal (SIGTSTP, (sig_t)suspend);
+ #else
+ (void) signal (SIGTSTP, suspend);
+@@ -757,7 +764,7 @@ void shell_out()
+ msg_print("Fork failed. Try again.");
+ return;
+ }
+-#if defined(USG) || defined(__386BSD__)
++#if defined(USG) || defined(__386BSD__) || defined(__FreeBSD__)
+ (void) wait((int *) 0);
+ #else
+ (void) wait((union wait *) 0);
+Index: umoria/source/misc1.c
+===================================================================
+--- umoria.orig/source/misc1.c
++++ umoria/source/misc1.c
+@@ -28,7 +28,7 @@
+ #endif
+ #endif
+
+-#if !defined(ATARIST_MWC) && !defined(MAC) && !defined(VMS) && !defined(AMIGA)
++#if !defined(ATARIST_MWC) && !defined(MAC) && !defined(VMS) && !defined(AMIGA) && !defined(__FreeBSD__)
+ long time();
+ #endif
+ struct tm *localtime();
+@@ -45,7 +45,7 @@ int32u seed;
+ register int32u clock_var;
+
+ if (seed == 0)
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ clock_var = time((time_t *)0);
+ #else
+ clock_var = time((long *)0);
+@@ -89,10 +89,14 @@ void reset_seed()
+ int check_time()
+ {
+ #ifdef MORIA_HOU
++#if defined(MAC) || defined(__FreeBSD__)
++ time_t clock_var;
++#else
+ long clock_var;
++#endif
+ register struct tm *tp;
+
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ clock_var = time((time_t *)0);
+ #else
+ clock_var = time((long *)0);
+Index: umoria/source/save.c
+===================================================================
+--- umoria.orig/source/save.c
++++ umoria/source/save.c
+@@ -102,7 +102,7 @@ static void rd_monster();
+ #endif
+
+ #if !defined(ATARIST_MWC)
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ #include <time.h>
+ #else
+ long time();
+@@ -331,7 +331,7 @@ static int sv_write()
+ }
+
+ /* save the current time in the savefile */
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ l = time((time_t *)0);
+ #else
+ l = time((long *)0);
+@@ -1029,7 +1029,7 @@ int *generate;
+ || (version_min == 2 && patch_level >= 2))
+ rd_long ((int32u *)&birth_date);
+ else
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ birth_date = time((time_t *)0);
+ #else
+ birth_date = time((long *)0);
+@@ -1253,7 +1253,7 @@ scoreboard; it will not be scored again.
+ /* rotate store inventory, depending on how old the save file */
+ /* is foreach day old (rounded up), call store_maint */
+ /* calculate age in seconds */
+-#ifdef MAC
++#if defined(MAC) || defined(__FreeBSD__)
+ start_time = time((time_t *)0);
+ #else
+ start_time = time((long *)0);
+Index: umoria/source/signals.c
+===================================================================
+--- umoria.orig/source/signals.c
++++ umoria/source/signals.c
+@@ -89,7 +89,7 @@ static int signal_count = 0;
+
+ /*ARGSUSED*/
+ #ifndef USG
+-#ifdef __386BSD__
++#if defined(__386BSD__) || defined(__FreeBSD__)
+ static void signal_handler(sig, code, scp)
+ #else
+ static int signal_handler(sig, code, scp)
+@@ -217,7 +217,7 @@ void signals()
+ #if defined(atarist) && defined(__GNUC__)
+ (void) signal(SIGTSTP, (__Sigfunc)suspend);
+ #else
+-#ifdef __386BSD__
++#if defined(__386BSD__) || defined(__FreeBSD__)
+ (void) signal(SIGTSTP, (sig_t)suspend);
+ #else
+ (void) signal(SIGTSTP, suspend);
+Index: umoria/source/types.h
+===================================================================
+--- umoria.orig/source/types.h
++++ umoria/source/types.h
+@@ -6,11 +6,20 @@
+ not for profit purposes provided that this copyright and statement are
+ included in all such copies. */
+
++#ifdef __FreeBSD__
++#include <sys/types.h>
++typedef u_int32_t int32u;
++typedef int32_t int32;
++typedef u_int16_t int16u;
++typedef int16_t int16;
++typedef u_int8_t int8u;
++#else
+ typedef unsigned long int32u;
+ typedef long int32;
+ typedef unsigned short int16u;
+ typedef short int16;
+ typedef unsigned char int8u;
++#endif
+ /* some machines will not accept 'signed char' as a type, and some accept it
+ but still treat it like an unsigned character, let's just avoid it,
+ any variable which can ever hold a negative value must be 16 or 32 bits */
+Index: umoria/unix/unix.c
+===================================================================
+--- umoria.orig/unix/unix.c
++++ umoria/unix/unix.c
+@@ -14,6 +14,10 @@
+ /* defines TRUE and FALSE */
+ #include <curses.h>
+
++#ifdef __FreeBSD__
++#include <unistd.h>
++#endif
++
+ #include "config.h"
+ #include "constant.h"
+ #include "types.h"
+@@ -276,7 +280,9 @@ int getuid();
+ void user_name(buf)
+ char *buf;
+ {
++#ifndef __FreeBSD__
+ extern char *getlogin();
++#endif
+ struct passwd *pwline;
+ register char *p;
+
diff --git a/games-roguelike/moria/files/5.5.2-gentoo-paths.patch b/games-roguelike/moria/files/5.5.2-gentoo-paths.patch
new file mode 100644
index 000000000000..5ce4ce4d2b4d
--- /dev/null
+++ b/games-roguelike/moria/files/5.5.2-gentoo-paths.patch
@@ -0,0 +1,58 @@
+--- umoria/unix/Makefile.orig 2003-12-31 14:52:58.583335976 -0500
++++ umoria/unix/Makefile 2003-12-31 14:51:54.621059720 -0500
+@@ -3,6 +3,7 @@
+ # LIBDIR must be the same directory defined in config.h
+ # OWNER is who you want the game to be chown to.
+ # GROUP is who you wnat the game to be chgrp to.
++STATEDIR = /var/lib
+ BINDIR = /home/zariski/grabiner/moria
+ LIBDIR = /home/zariski/grabiner/moria/files
+ OWNER = grabiner
+@@ -65,12 +66,11 @@
+ chmod 4711 $(BINDIR)/moria
+ chmod 711 $(LIBDIR)
+ (cd files; cp $(LIBFILES) $(LIBDIR))
+- (cd $(LIBDIR); chmod 444 $(LIBFILES))
+- (cd $(LIBDIR); touch scores; chmod 644 scores)
++ (cd $(STATEDIR); touch moriascores; chmod 664 moriascores; chown $(OWNER) moriascores; chgrp $(GROUP) moriascores)
+ chown $(OWNER) $(BINDIR)/moria
+ chgrp $(GROUP) $(BINDIR)/moria
+- (cd $(LIBDIR); chown $(OWNER) $(LIBFILES) scores)
+- (cd $(LIBDIR); chgrp $(GROUP) $(LIBFILES) scores)
++ (cd $(LIBDIR); chown $(OWNER) $(LIBFILES))
++ (cd $(LIBDIR); chgrp $(GROUP) $(LIBFILES))
+ # If you are short on disk space, or aren't interested in debugging moria.
+ # strip $(BINDIR)/moria
+
+--- umoria/source/config.h.orig 2003-12-31 15:19:48.893531616 -0500
++++ umoria/source/config.h 2003-12-31 15:21:09.584264760 -0500
+@@ -199,17 +199,18 @@
+ #else
+
+ /* This must be unix; change MORIA_LIB as appropriate. */
+-#define MORIA_SAV "moria.save"
+-#define MORIA_LIB(xxx) "/home/math/grabiner/moria/files/xxx"
+-#define MORIA_HOU MORIA_LIB(hours)
+-#define MORIA_MOR MORIA_LIB(news)
+-#define MORIA_TOP MORIA_LIB(scores)
+-#define MORIA_HELP MORIA_LIB(roglcmds.hlp)
+-#define MORIA_ORIG_HELP MORIA_LIB(origcmds.hlp)
+-#define MORIA_WIZ_HELP MORIA_LIB(rwizcmds.hlp)
+-#define MORIA_OWIZ_HELP MORIA_LIB(owizcmds.hlp)
+-#define MORIA_WELCOME MORIA_LIB(welcome.hlp)
+-#define MORIA_VER MORIA_LIB(version.hlp)
++#define MORIA_SAV ".moria.save"
++#define MORIA_LIB(xxx) "GENTOO_DATADIR/" xxx
++#define MORIA_STATE(xxx) "GENTOO_STATEDIR/" xxx
++#define MORIA_HOU MORIA_LIB("hours")
++#define MORIA_MOR MORIA_LIB("news")
++#define MORIA_TOP MORIA_STATE("moriascores")
++#define MORIA_HELP MORIA_LIB("roglcmds.hlp")
++#define MORIA_ORIG_HELP MORIA_LIB("origcmds.hlp")
++#define MORIA_WIZ_HELP MORIA_LIB("rwizcmds.hlp")
++#define MORIA_OWIZ_HELP MORIA_LIB("owizcmds.hlp")
++#define MORIA_WELCOME MORIA_LIB("welcome.hlp")
++#define MORIA_VER MORIA_LIB("version.hlp")
+
+ #endif
+ #endif
diff --git a/games-roguelike/moria/files/5.5.2-glibc.patch b/games-roguelike/moria/files/5.5.2-glibc.patch
new file mode 100644
index 000000000000..55e4e5de2b14
--- /dev/null
+++ b/games-roguelike/moria/files/5.5.2-glibc.patch
@@ -0,0 +1,356 @@
+diff -Naur common-orig/Makefile umoria/unix/Makefile
+--- common-orig/Makefile 2003-12-09 10:06:19.000000000 -0500
++++ umoria/unix/Makefile 2003-12-09 10:07:12.000000000 -0500
+@@ -14,9 +14,9 @@
+ CFLAGS = -O
+
+ # For BSD Systems
+-CURSES = -lcurses -ltermcap
++# CURSES = -lcurses -ltermcap
+ # For SYS V Systems
+-# CURSES = -lcurses
++CURSES = `pkg-config ncurses --libs`
+ # For XENIX, some XENIX systems may need -ltinfo
+ # CURSES = -ltcap -ltermcap -lx
+
+diff -Naur common-orig/death.c umoria/source/death.c
+--- common-orig/death.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/source/death.c 2003-12-09 10:06:56.000000000 -0500
+@@ -175,10 +175,12 @@
+ /* The following code is provided especially for systems which -CJS-
+ have no flock system call. It has never been tested. */
+
++#ifndef LOCK_EX
+ #define LOCK_EX 1
+ #define LOCK_SH 2
+ #define LOCK_NB 4
+ #define LOCK_UN 8
++#endif
+
+ /* An flock HACK. LOCK_SH and LOCK_EX are not distinguished. DO NOT release
+ a lock which you failed to set! ALWAYS release a lock you set! */
+diff -Naur common-orig/io.c umoria/source/io.c
+--- common-orig/io.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/source/io.c 2003-12-09 10:06:56.000000000 -0500
+@@ -62,6 +62,7 @@
+
+
+ #include <ctype.h>
++#include <termios.h>
+
+ #if defined(SYS_V) && defined(lint)
+ /* for AIX, prevent hundreds of unnecessary lint errors, must define before
+@@ -334,7 +335,9 @@
+ #ifdef __386BSD__
+ (void) signal (SIGTSTP, (sig_t)suspend);
+ #else
+- (void) signal (SIGTSTP, suspend);
++ /* (void) signal (SIGTSTP, suspend); */
++ /* libc6 defaults to BSD, this expects SYSV */
++ (void) sysv_signal (SIGTSTP, suspend);
+ #endif
+ #endif
+ #endif
+diff -Naur common-orig/misc3.c umoria/source/misc3.c
+--- common-orig/misc3.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/source/misc3.c 2003-12-09 10:06:56.000000000 -0500
+@@ -1249,8 +1249,7 @@
+ {
+ int i;
+ register inven_type *i_ptr;
+- vtype prt2;
+- bigvtype prt1;
++ bigvtype prt1, prt2;
+ #ifdef ATARIST_MWC
+ int32u holder;
+ #endif
+diff -Naur common-orig/misc4.c umoria/source/misc4.c
+--- common-orig/misc4.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/source/misc4.c 2003-12-09 10:06:56.000000000 -0500
+@@ -33,7 +33,7 @@
+ void scribe_object()
+ {
+ int item_val, j;
+- vtype out_val, tmp_str;
++ bigvtype out_val, tmp_str;
+
+ if (inven_ctr > 0 || equip_ctr > 0)
+ {
+diff -Naur common-orig/moria1.c umoria/source/moria1.c
+--- common-orig/moria1.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/source/moria1.c 2003-12-09 10:06:56.000000000 -0500
+@@ -332,8 +332,8 @@
+ {
+ objdes(tmp_val, &inventory[i], TRUE);
+ tmp_val[lim] = 0; /* Truncate if too long. */
+- (void) sprintf(out_val[i], " %c) %s", 'a'+i, tmp_val);
+- l = strlen(out_val[i]);
++ (void) sprintf(out_val[i], "%c) %s", 'a'+i, tmp_val);
++ l = strlen(out_val[i]) + 2;
+ if (weight)
+ l += 9;
+ if (l > len)
+@@ -352,9 +352,12 @@
+ {
+ /* don't need first two spaces if in first column */
+ if (col == 0)
+- prt(&out_val[i][2], current_line, col);
+- else
+ prt(out_val[i], current_line, col);
++ else
++ {
++ put_buffer(" ", current_line, col);
++ prt(out_val[i], current_line, col+2);
++ }
+ if (weight)
+ {
+ total_weight = inventory[i].weight*inventory[i].number;
+@@ -466,9 +469,9 @@
+ }
+ objdes(prt2, &inventory[i], TRUE);
+ prt2[lim] = 0; /* Truncate if necessary */
+- (void) sprintf(out_val[line], " %c) %-14s: %s", line+'a',
+- prt1, prt2);
+- l = strlen(out_val[line]);
++ (void) sprintf(out_val[line], "%c) %-14s: %s", line+'a',
++ prt1, prt2);
++ l = strlen(out_val[line]) + 2;
+ if (weight)
+ l += 9;
+ if (l > len)
+@@ -488,9 +491,12 @@
+ {
+ /* don't need first two spaces when using whole screen */
+ if (col == 0)
+- prt(&out_val[line][2], line+1, col);
+- else
+ prt(out_val[line], line+1, col);
++ else
++ {
++ put_buffer(" ", line+1, col);
++ prt(out_val[line], line+1, col+2);
++ }
+ if (weight)
+ {
+ total_weight = i_ptr->weight*i_ptr->number;
+diff -Naur common-orig/signals.c umoria/source/signals.c
+--- common-orig/signals.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/source/signals.c 2003-12-09 10:06:56.000000000 -0500
+@@ -113,7 +113,11 @@
+ if(error_sig >= 0) /* Ignore all second signals. */
+ {
+ if(++signal_count > 10) /* Be safe. We will die if persistent enough. */
++#ifdef __FreeBSD__
+ (void) signal(sig, SIG_DFL);
++#else
++ (void) sysv_signal(sig, SIG_DFL);
++#endif
+ return;
+ }
+ error_sig = sig;
+@@ -126,7 +126,11 @@
+ )
+ {
+ if (death)
++#ifdef __FreeBSD__
+ (void) signal(sig, SIG_IGN); /* Can't quit after death. */
++#else
++ (void) sysv_signal(sig, SIG_IGN); /* Can't quit after death. */
++#endif
+ else if (!character_saved && character_generated)
+ {
+ if (!get_check("Really commit *Suicide*?"))
+@@ -137,7 +137,11 @@
+ put_qio();
+ error_sig = -1;
+ #ifdef USG
++#ifdef __FreeBSD__
+ (void) signal(sig, signal_handler);/* Have to restore handler. */
++#else
++ (void) sysv_signal(sig, signal_handler);/* Have to restore handler. */
++#endif
+ #else
+ (void) sigsetmask(smask);
+ #endif
+@@ -179,7 +179,11 @@
+ restore_term();
+ #if !defined(MSDOS) && !defined(AMIGA) && !defined(ATARIST_TC)
+ /* always generate a core dump */
++#ifdef __FreeBSD__
+ (void) signal(sig, SIG_DFL);
++#else
++ (void) sysv_signal(sig, SIG_DFL);
++#endif
+ (void) kill(getpid(), sig);
+ (void) sleep(5);
+ #endif
+@@ -199,7 +199,11 @@
+ #if defined(atarist) && defined(__GNUC__)
+ (void) signal(SIGTSTP, (__Sigfunc)SIG_IGN);
+ #else
++#ifdef __FreeBSD__
+ (void) signal(SIGTSTP, SIG_IGN);
++#else
++ (void) sysv_signal(SIGTSTP, SIG_IGN);
++#endif
+ #endif
+ #ifndef USG
+ mask = sigsetmask(0);
+@@ -220,7 +220,11 @@
+ #ifdef __386BSD__
+ (void) signal(SIGTSTP, (sig_t)suspend);
+ #else
++#ifdef __FreeBSD__
+ (void) signal(SIGTSTP, suspend);
++#else
++ (void) sysv_signal(SIGTSTP, suspend);
++#endif
+ #endif
+ #endif
+ #ifndef USG
+@@ -237,7 +237,11 @@
+ {
+ #if !defined(ATARIST_MWC) && !defined(ATARIST_TC)
+ /* No signals for Atari ST compiled with MWC or TC. */
++#ifdef __FreeBSD__
+ (void) signal(SIGINT, signal_handler);
++#else
++ (void) sysv_signal(SIGINT, signal_handler);
++#endif
+
+ #if defined(atarist) && defined(__GNUC__)
+ /* Atari ST compiled with GNUC has most signals, but we need a cast
+@@ -259,8 +259,13 @@
+
+ #else
+ /* Everybody except the atari st. */
++#ifdef __FreeBSD__
+ (void) signal(SIGINT, signal_handler);
+ (void) signal(SIGFPE, signal_handler);
++#else
++ (void) sysv_signal(SIGINT, signal_handler);
++ (void) sysv_signal(SIGFPE, signal_handler);
++#endif
+
+ #if defined(MSDOS)
+ /* many fewer signals under MSDOS */
+@@ -278,30 +278,61 @@
+
+ /* Everybody except Atari, MSDOS, and Amiga. */
+ /* Ignore HANGUP, and let the EOF code take care of this case. */
++#ifdef __FreeBSD__
+ (void) signal(SIGHUP, SIG_IGN);
+ (void) signal(SIGQUIT, signal_handler);
+ (void) signal(SIGILL, signal_handler);
+ (void) signal(SIGTRAP, signal_handler);
+ (void) signal(SIGIOT, signal_handler);
++#else
++ (void) sysv_signal(SIGHUP, SIG_IGN);
++ (void) sysv_signal(SIGQUIT, signal_handler);
++ (void) sysv_signal(SIGILL, signal_handler);
++ (void) sysv_signal(SIGTRAP, signal_handler);
++ (void) sysv_signal(SIGIOT, signal_handler);
++#endif
+ #ifdef SIGEMT /* in BSD systems */
+ (void) signal(SIGEMT, signal_handler);
+ #endif
+ #ifdef SIGDANGER /* in SYSV systems */
+ (void) signal(SIGDANGER, signal_handler);
+ #endif
++#ifdef __FreeBSD__
+ (void) signal(SIGKILL, signal_handler);
+ (void) signal(SIGBUS, signal_handler);
+ (void) signal(SIGSEGV, signal_handler);
++#else
++ (void) sysv_signal(SIGKILL, signal_handler);
++ (void) sysv_signal(SIGBUS, signal_handler);
++ (void) sysv_signal(SIGSEGV, signal_handler);
++#endif
+ #ifdef SIGSYS
++#ifdef __FreeBSD__
+ (void) signal(SIGSYS, signal_handler);
++#else
++ (void) sysv_signal(SIGSYS, signal_handler);
++#endif
+ #endif
++#ifdef __FreeBSD__
+ (void) signal(SIGTERM, signal_handler);
+ (void) signal(SIGPIPE, signal_handler);
++#else
++ (void) sysv_signal(SIGTERM, signal_handler);
++ (void) sysv_signal(SIGPIPE, signal_handler);
++#endif
+ #ifdef SIGXCPU /* BSD */
++#ifdef __FreeBSD__
+ (void) signal(SIGXCPU, signal_handler);
++#else
++ (void) sysv_signal(SIGXCPU, signal_handler);
++#endif
+ #endif
+ #ifdef SIGPWR /* SYSV */
++#ifdef __FreeBSD__
+ (void) signal(SIGPWR, signal_handler);
++#else
++ (void) sysv_signal(SIGPWR, signal_handler);
++#endif
+ #endif
+ #endif
+ #endif
+@@ -314,7 +314,11 @@
+ #if !defined(ATARIST_MWC)
+ (void) signal(SIGINT, SIG_IGN);
+ #ifdef SIGQUIT
++#ifdef __FreeBSD__
+ (void) signal(SIGQUIT, SIG_IGN);
++#else
++ (void) sysv_signal(SIGQUIT, SIG_IGN);
++#endif
+ #endif
+ #endif
+ }
+@@ -324,7 +324,11 @@
+ #if !defined(ATARIST_MWC)
+ (void) signal(SIGINT, SIG_DFL);
+ #ifdef SIGQUIT
++#ifdef __FreeBSD__
+ (void) signal(SIGQUIT, SIG_DFL);
++#else
++ (void) sysv_signal(SIGQUIT, SIG_DFL);
++#endif
+ #endif
+ #endif
+ }
+@@ -335,13 +335,21 @@
+ #if defined(atarist) && defined(__GNUC__)
+ (void) signal(SIGINT, (__Sigfunc)signal_handler);
+ #else
++#ifdef __FreeBSD__
+ (void) signal(SIGINT, signal_handler);
++#else
++ (void) sysv_signal(SIGINT, signal_handler);
++#endif
+ #endif
+ #ifdef SIGQUIT
+ #if defined(atarist) && defined(__GNUC__)
+ (void) signal(SIGQUIT, (__Sigfunc)signal_handler);
+ #else
++#ifdef __FreeBSD__
+ (void) signal(SIGQUIT, signal_handler);
++#else
++ (void) sysv_signal(SIGQUIT, signal_handler);
++#endif
+ #endif
+ #endif
+ #endif
+diff -Naur common-orig/unix.c umoria/unix/unix.c
+--- common-orig/unix.c 2003-12-09 10:06:19.000000000 -0500
++++ umoria/unix/unix.c 2003-12-09 10:06:56.000000000 -0500
+@@ -261,7 +261,7 @@
+ #endif
+
+ #ifdef USG
+-unsigned short getuid();
++/* unsigned short getuid(); */
+ #else
+ #ifndef SECURE
+ #ifdef BSD4_3
diff --git a/games-roguelike/moria/files/5.5.2-hours.patch b/games-roguelike/moria/files/5.5.2-hours.patch
new file mode 100644
index 000000000000..3d1c329d9b9b
--- /dev/null
+++ b/games-roguelike/moria/files/5.5.2-hours.patch
@@ -0,0 +1,30 @@
+diff -ru umoria.orig/source/files.c umoria/source/files.c
+--- umoria.orig/source/files.c 1994-07-21 21:47:22.000000000 -0400
++++ umoria/source/files.c 2010-05-05 14:51:44.334588483 -0400
+@@ -130,19 +130,19 @@
+ if (strlen(in_line) > 3)
+ {
+ if (!strncmp(in_line, "SUN:", 4))
+- (void) strcpy(days[0], in_line);
++ (void) snprintf(days[0], sizeof(days[0]), "%s", in_line);
+ else if (!strncmp(in_line, "MON:", 4))
+- (void) strcpy(days[1], in_line);
++ (void) snprintf(days[1], sizeof(days[0]), "%s", in_line);
+ else if (!strncmp(in_line, "TUE:", 4))
+- (void) strcpy(days[2], in_line);
++ (void) snprintf(days[2], sizeof(days[0]), "%s", in_line);
+ else if (!strncmp(in_line, "WED:", 4))
+- (void) strcpy(days[3], in_line);
++ (void) snprintf(days[3], sizeof(days[0]), "%s", in_line);
+ else if (!strncmp(in_line, "THU:", 4))
+- (void) strcpy(days[4], in_line);
++ (void) snprintf(days[4], sizeof(days[0]), "%s", in_line);
+ else if (!strncmp(in_line, "FRI:", 4))
+- (void) strcpy(days[5], in_line);
++ (void) snprintf(days[5], sizeof(days[0]), "%s", in_line);
+ else if (!strncmp(in_line, "SAT:", 4))
+- (void) strcpy(days[6], in_line);
++ (void) snprintf(days[6], sizeof(days[0]), "%s", in_line);
+ }
+ (void) fclose(file1);
+ }
diff --git a/games-roguelike/moria/files/5.5.2-warnings.patch b/games-roguelike/moria/files/5.5.2-warnings.patch
new file mode 100644
index 000000000000..33a2762b99d0
--- /dev/null
+++ b/games-roguelike/moria/files/5.5.2-warnings.patch
@@ -0,0 +1,12 @@
+diff -ru umoria.orig/unix/unix.c umoria/unix/unix.c
+--- umoria.orig/unix/unix.c 2014-11-01 02:45:07.375535783 -0400
++++ umoria/unix/unix.c 2014-11-01 02:45:58.575820065 -0400
+@@ -315,7 +315,7 @@
+
+ user[0] = '\0';
+ file++;
+- while (*file != '/' && i < sizeof(user))
++ while (*file != '/' && i < sizeof(user) - 1)
+ user[i++] = *file++;
+ user[i] = '\0';
+ if (i == 0)
diff --git a/games-roguelike/moria/metadata.xml b/games-roguelike/moria/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-roguelike/moria/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-roguelike/moria/moria-5.5.2.ebuild b/games-roguelike/moria/moria-5.5.2.ebuild
new file mode 100644
index 000000000000..d67bd7105e5b
--- /dev/null
+++ b/games-roguelike/moria/moria-5.5.2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils toolchain-funcs games
+
+DESCRIPTION="Rogue-like D&D curses game similar to nethack (BUT BETTER)"
+HOMEPAGE="http://remarque.org/~grabiner/moria.html"
+SRC_URI="ftp://ftp.greyhelm.com/pub/Games/Moria/source/um${PV}.tar.Z
+ http://www.funet.fi/pub/unix/games/moria/source/um${PV}.tar.Z
+ http://www.piratehaven.org/~beej/moria/mirror/Games/Moria/source/um${PV}.tar.Z
+ http://alge.anart.no/ftp/pub/games/RPG/moria/um${PV}.tar.Z
+ ftp://kane.evendata.net/pub/${PN}-extras.tar.bz2"
+
+LICENSE="Moria"
+SLOT="0"
+KEYWORDS="amd64 x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=sys-libs/ncurses-5:0"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/umoria
+
+src_prepare() {
+ local f
+
+ epatch \
+ "${FILESDIR}"/${PV}-gentoo-paths.patch \
+ "${FILESDIR}"/${PV}-glibc.patch \
+ "${FILESDIR}"/${PV}-fbsd.patch \
+ "${FILESDIR}"/${PV}-hours.patch \
+ "${FILESDIR}"/${PV}-warnings.patch
+
+ for f in source/* unix/* ; do
+ ln -s ${f} $(basename ${f})
+ done
+
+ sed -i \
+ -e "s:David Grabiner:root:" \
+ -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}:" \
+ -e "s:GENTOO_STATEDIR:${GAMES_STATEDIR}:" \
+ config.h || die
+ {
+ echo "#include <stdlib.h>"
+ echo "#include <stdio.h>"
+ } >> config.h || die
+ sed -i \
+ -e "/^STATEDIR =/s:=.*:=\$(DESTDIR)${GAMES_STATEDIR}:" \
+ -e "/^BINDIR = /s:=.*:=\$(DESTDIR)${GAMES_BINDIR}:" \
+ -e "/^LIBDIR = /s:=.*:=\$(DESTDIR)${GAMES_DATADIR}/${PN}:" \
+ -e "/^CFLAGS = /s:=.*:=${CFLAGS}:" \
+ -e "/^OWNER = /s:=.*:=${GAMES_USER}:" \
+ -e "/^GROUP = /s:=.*:=${GAMES_GROUP}:" \
+ -e "/^CC = /s:=.*:=$(tc-getCC):" \
+ -e '/^LFLAGS = /s:=.*:= $(LDFLAGS):' \
+ Makefile || die
+ mv doc/moria.6 "${S}" || die
+}
+
+src_install() {
+ dodir "${GAMES_BINDIR}" "${GAMES_DATADIR}/${PN}" "${GAMES_STATEDIR}"
+ emake DESTDIR="${D}" install
+
+ doman moria.6
+ dodoc README doc/* "${WORKDIR}"/${PN}-extras/*
+
+ prepgamesdirs
+}