summaryrefslogtreecommitdiff
path: root/games-misc/fortune-mod
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /games-misc/fortune-mod
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'games-misc/fortune-mod')
-rw-r--r--games-misc/fortune-mod/Manifest5
-rw-r--r--games-misc/fortune-mod/files/01_all_fortune_all-fix.patch21
-rw-r--r--games-misc/fortune-mod/files/fortune-mod-1.99.1-gentoo.patch99
-rw-r--r--games-misc/fortune-mod/fortune-mod-1.99.1-r2.ebuild57
-rw-r--r--games-misc/fortune-mod/metadata.xml8
5 files changed, 190 insertions, 0 deletions
diff --git a/games-misc/fortune-mod/Manifest b/games-misc/fortune-mod/Manifest
new file mode 100644
index 000000000000..503792d0e07f
--- /dev/null
+++ b/games-misc/fortune-mod/Manifest
@@ -0,0 +1,5 @@
+AUX 01_all_fortune_all-fix.patch 783 BLAKE2B 6624a194f63177a3dd414f7c0612d14343f1663867eee04456d8c7fa6b374c7bd1da48495c5c4e8820aedc93c247357574c7a73b71249970f5bea9feac18ff07 SHA512 52211ad8a5f29bc65314fff58e151a7890f0f5d1d6e613b67e693f0bf4ece09219febdb9291ff006901d48b6c50dab0f5507201d412760ddc5d7857c74e11e86
+AUX fortune-mod-1.99.1-gentoo.patch 2699 BLAKE2B aea72dffd92071d416d8bb239f26f26a59aa2920d5bb25cae36267cd8a12362f6463bf43592c9b5065d218d413bc0d5c5d1ad361f52fd6f8260eef4f447b5204 SHA512 83ad811f73216db89eaea52a1a55b63e6f12f8580fd3e360b7adc6e80066c0d6d79191e6c2fbe3e2b78cf446bdb0500562cd9fe8cf00375af76034861b2ab54c
+DIST fortune-mod-1.99.1.tar.gz 1812089 BLAKE2B a5df4a5a518021073ee95ac7e110ac75b961feb1b4dfcc3a40165ea98859f93e6d002ee4906d3f03a40762503ae475b61399a2bd4144609fa4d9815a1a85fa84 SHA512 4c06ea37532dd59f0251d7c49538bee703852c60a3247aba7c516f4f0d4b8ab15b9d7495d004a6423acd74c4dd7532e3dbe1679d6904ab373b617a3386205cde
+EBUILD fortune-mod-1.99.1-r2.ebuild 1721 BLAKE2B 9b29121f9b0a2c73388fe59bd5c4c2c69ed6bbca62b6c5b3a8c12d96b134057e1c5e2be65dcbddcc52be6e00e1c9ca16e1a3acf392b64fe22eca6732a12b3e72 SHA512 52b572cc853851ec820c8e12c361b187f93e0a68b783111b8cf3fea229afd786b51831ca77491c8aa75905c489ea9c62a0dc927544d875da0d1e9c896a4e4814
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-misc/fortune-mod/files/01_all_fortune_all-fix.patch b/games-misc/fortune-mod/files/01_all_fortune_all-fix.patch
new file mode 100644
index 000000000000..b4175ac81bfc
--- /dev/null
+++ b/games-misc/fortune-mod/files/01_all_fortune_all-fix.patch
@@ -0,0 +1,21 @@
+--- fortune/fortune.c.old 2006-03-11 15:33:14.000000000 +0100
++++ fortune/fortune.c 2006-03-11 15:43:16.000000000 +0100
+@@ -974,7 +974,7 @@
+ if (!ret)
+ ret=add_file(percent, fullpathname, NULL, &File_list,
+ &File_tail, NULL);
+- if ( (!ret && fullpathname != locpathname) || strcmp(sp, "all") == 0 )
++ if (!ret && strncmp(fullpathname, locpathname, sizeof(fullpathname)))
+ ret=add_file(percent, locpathname, NULL, &File_list,
+ &File_tail, NULL);
+
+@@ -985,7 +985,8 @@
+ }
+ if (!ret)
+ return FALSE;
+-
++ if (strncmp(fullpathname, locpathname, sizeof(fullpathname)) && strcmp(sp, "all") == 0)
++ add_file(percent, locpathname, NULL, &File_list, &File_tail, NULL);
+ }
+ else
+ if (!add_file(percent, fullpathname, NULL, &File_list,
diff --git a/games-misc/fortune-mod/files/fortune-mod-1.99.1-gentoo.patch b/games-misc/fortune-mod/files/fortune-mod-1.99.1-gentoo.patch
new file mode 100644
index 000000000000..d9b27fb350e5
--- /dev/null
+++ b/games-misc/fortune-mod/files/fortune-mod-1.99.1-gentoo.patch
@@ -0,0 +1,99 @@
+--- fortune-mod-1.99.1/datfiles/Makefile
++++ fortune-mod-1.99.1/datfiles/Makefile
+@@ -58,7 +58,7 @@
+ if [ $(WEB) = 1 ] ; then cd html && $(MAKE) install ; fi
+ for i in $(COOKIES) ; do \
+ install -m 0644 $$i $$i.dat $(COOKIEDIR) || exit $? ; \
+- cp -d $$i.u8 $(COOKIEDIR) ; \
++ cp -P $$i.u8 $(COOKIEDIR) ; \
+ done
+
+ clean:
+--- fortune-mod-1.99.1/datfiles/off/Makefile
++++ fortune-mod-1.99.1/datfiles/off/Makefile
+@@ -38,7 +38,7 @@
+ install -m 0755 -d $(OCOOKIEDIR)
+ for i in $(OCOOKIES) ; \
+ do install -m 0644 $$i $$i.dat $(OCOOKIEDIR) || exit $$? ; \
+- cp -d $$i.u8 $(OCOOKIEDIR) ; \
++ cp -P $$i.u8 $(OCOOKIEDIR) ; \
+ done
+
+ clean:
+--- fortune-mod-1.99.1/Makefile
++++ fortune-mod-1.99.1/Makefile
+@@ -65,8 +65,7 @@
+ RECODELIBS=-lrecode
+
+ DEFINES=-DFORTDIR="\"$(COOKIEDIR)\"" -DOFFDIR="\"$(OCOOKIEDIR)\"" -DLOCFORTDIR="\"$(LOCALDIR)\"" -DLOCOFFDIR="\"$(LOCALODIR)\""
+-CFLAGS=-O2 $(DEFINES) -Wall -fomit-frame-pointer -pipe -fsigned-char
+-LDFLAGS=-s
++CFLAGS += $(DEFINES) -fsigned-char
+
+ # The above flags are used by default; the debug flags are used when make
+ # is called with a debug target, such as 'make debug'
+--- fortune-mod-1.99.1/fortune/fortune.c
++++ fortune-mod-1.99.1/fortune/fortune.c
+@@ -97,7 +97,7 @@
+ #endif /* killing warnings */
+
+ #define PROGRAM_NAME "fortune-mod"
+-#define PROGRAM_VERSION "9708"
++#define PROGRAM_VERSION "1.99.1"
+
+ #ifdef HAVE_STDBOOL_H
+ #include <stdbool.h>
+@@ -256,6 +256,7 @@
+
+ int add_dir(register FILEDESC *);
+
++const char *program_name;
+ char *program_version(void)
+ {
+ static char buf[BUFSIZ];
+@@ -1675,14 +1675,17 @@
+ char *ctype, *crequest;
+ getargs(ac, av);
+
++ program_name = (char *const) av[0];
+ outer = recode_new_outer(true);
+ request = recode_new_request (outer);
+
+ setlocale(LC_ALL,"");
+ ctype = nl_langinfo(CODESET);
+- if(strcmp(ctype,"ANSI_X3.4-1968") == 0)
+- ctype="ISO-8859-1";
+-
++ if (!ctype || !*ctype)
++ ctype="C"; /* revert to C if no valid envvars! */
++ else
++ if(strcmp(ctype,"ANSI_X3.4-1968") == 0)
++ ctype="ISO-8859-1";
+ crequest = malloc(strlen(ctype) + 7 + 1);
+ sprintf(crequest, "UTF-8..%s", ctype);
+ recode_scan_request (request, crequest);
+--- fortune-mod-1.99.1/util/rot.c
++++ fortune-mod-1.99.1/util/rot.c
+@@ -5,10 +5,11 @@
+
+ #include <stdio.h>
+ #include <ctype.h>
++#include <stdlib.h>
+
+ int main(void)
+ {
+- char a, b;
++ short int a, b;
+
+ while ((a = getchar()) != EOF)
+ {
+--- fortune-mod-1.99.1/util/unstr.c
++++ fortune-mod-1.99.1/util/unstr.c
+@@ -96,6 +96,7 @@
+ #include <string.h>
+ #include <unistd.h>
+
++#include <stdlib.h>
+ #ifndef MAXPATHLEN
+ #define MAXPATHLEN 1024
+ #endif /* MAXPATHLEN */
diff --git a/games-misc/fortune-mod/fortune-mod-1.99.1-r2.ebuild b/games-misc/fortune-mod/fortune-mod-1.99.1-r2.ebuild
new file mode 100644
index 000000000000..b37cea4d9a5f
--- /dev/null
+++ b/games-misc/fortune-mod/fortune-mod-1.99.1-r2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="The notorious fortune program"
+HOMEPAGE="http://www.redellipse.net/code/fortune"
+SRC_URI="http://www.redellipse.net/code/downloads/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa m68k ~mips ppc64 sh x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="offensive elibc_glibc"
+
+DEPEND="app-text/recode"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch \
+ "${FILESDIR}"/01_all_fortune_all-fix.patch
+
+ sed -i \
+ -e 's:/games::' \
+ -e 's:/fortunes:/fortune:' \
+ -e '/^FORTDIR=/s:=.*:=$(prefix)/usr/bin:' \
+ -e '/^all:/s:$: fortune/fortune.man:' \
+ -e "/^OFFENSIVE=/s:=.*:=`use offensive && echo 1 || echo 0`:" \
+ Makefile || die "sed Makefile failed"
+
+ if ! use elibc_glibc ; then
+ [[ ${CHOST} == *-*bsd* ]] && local reglibs="-lcompat"
+ [[ ${CHOST} == *-darwin* ]] && local reglibs="-lc"
+ has_version "app-text/recode[nls]" && reglibs="${reglibs} -lintl"
+ sed -i \
+ -e "/^REGEXLIBS=/s:=.*:= ${reglibs}:" \
+ Makefile \
+ || die "sed REGEXLIBS failed"
+ fi
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ sed -i -e 's:u_int:uint:g' util/strfile.h || die "sed strfile.h failed"
+ fi
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e 's/-DBSD_REGEX/-DPOSIX_REGEX/' Makefile || die "sed Makefile failed"
+ fi
+}
+
+src_compile() {
+ local myrex=
+ [[ ${CHOST} == *-interix* ]] && myrex="REGEXDEFS=-DNO_REGEX"
+ emake prefix="${EPREFIX}" CC="$(tc-getCC)" $myrex
+}
+
+src_install() {
+ emake prefix="${ED}" install
+ dodoc ChangeLog INDEX Notes Offensive README TODO cookie-files
+}
diff --git a/games-misc/fortune-mod/metadata.xml b/games-misc/fortune-mod/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-misc/fortune-mod/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>