diff options
Diffstat (limited to 'games-misc/bsd-games')
-rw-r--r-- | games-misc/bsd-games/Manifest | 9 | ||||
-rw-r--r-- | games-misc/bsd-games/bsd-games-2.17-r5.ebuild | 132 | ||||
-rw-r--r-- | games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch | 21 | ||||
-rw-r--r-- | games-misc/bsd-games/files/bsd-games-2.17-bg.patch | 22 | ||||
-rw-r--r-- | games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch | 34 | ||||
-rw-r--r-- | games-misc/bsd-games/files/bsd-games-2.17-headers.patch | 16 | ||||
-rw-r--r-- | games-misc/bsd-games/files/config.params-gentoo | 39 | ||||
-rw-r--r-- | games-misc/bsd-games/metadata.xml | 8 |
8 files changed, 281 insertions, 0 deletions
diff --git a/games-misc/bsd-games/Manifest b/games-misc/bsd-games/Manifest new file mode 100644 index 000000000000..907aa79ca930 --- /dev/null +++ b/games-misc/bsd-games/Manifest @@ -0,0 +1,9 @@ +AUX bsd-games-2.17-64bitutmp.patch 681 BLAKE2B 2ef7ad184787ecab40e3082992bfb562be4477dfe331f2ab68e93f619f9cf5b1ee33b8d4f2b342c44f8a22d19c51b341557670c9bebb5fe827f6fbfd601b99c1 SHA512 ba5a261950bd0f5f5b6aae0ee961a84f06bc6b68504c859db387d9c32875cb4f849c555c56c52f66b00af85d44d9a2324a2d1cccc6811acf6f980cefe9508258 +AUX bsd-games-2.17-bg.patch 732 BLAKE2B 84e76aa2d3e6eeb34b92140adb2cfb1ca6ad1ad23a1261225277d3cc439e98d70ba4e93af5d44e080c71bb4c62c906b68a872191c09aedb93345949b9db512a9 SHA512 006ce0aa632c1ff671bc98584307fcfabed62e81a4680271fcbbaebf93e0f6f7c89cb1fbe311ffa472facd02991c456ced6b198c02753958b1178aa9ef16d8ba +AUX bsd-games-2.17-gcc4.patch 893 BLAKE2B 54eb6b43592d83dd40c8e00e82438e3cbd818f2fc61cd121f0e9a3c555e57505668946bc6033f799791da96484ec834379ca657640b8541c4ba5b394fcc87070 SHA512 fca57d3887f202b973bf5c03eb0d9a8e62a0ef8f746ccec0cb6e3ad2494bdf1208a1a8833bd3b762281289802b8c58d90cab62fe2642915acaf1ff87233329c5 +AUX bsd-games-2.17-headers.patch 268 BLAKE2B e3b1761e4373e2ed22c3a4b1d31e30f5af8ecd16de8c33bee0f02aa988f5e8dad78395d786a55214ef9f714864723f71ea3913bb832b3fd322bbcc0f8ab01040 SHA512 cc7c62109e835b31db0dfbb84de35fcb962bebee04b901c727b7ff087c194bfb12e4edac6b7e2f3ca0e414bd486c18962e8f5ad1f33a997e2782f58b9b62469f +AUX config.params-gentoo 1204 BLAKE2B 638b52df3c92928a78a0e0833c2bc84a76906144b36d5a6b3523f4de24452aeeab355268afadb9d32933e5c0c19ab4145062bf3968a9d440af1a659a403b32c4 SHA512 b6734409235caec3deb531bbcdb37527b3090c41b803ccc11895ea403543722437f84bdfa044c6aa70b306384ce94a40979a347e6031bc1d937841c7222d6618 +DIST bsd-games-2.17.tar.gz 2563311 BLAKE2B 9dfff4e70929e14a422c536c661cd95c5f1ac81d9112494525b9ef13d7a39b66bd59b6a264e614cfb29784fdb63364f56b12b4d284b125b5b3c12e92def07fb0 SHA512 cb2ee60474f164d42e3d47700270bbeeda3c8279d64da409c9cc05e36437ef95b92d0a85543298e97604635fcf3e068f3a5cc812e90b5c61fb8d146cf35bc38f +DIST bsdgames_2.17-22.debian.tar.xz 32268 BLAKE2B 2485abc1d80b8319c7eb68e2747c0a4166d18079047eca67c1de549cd011f75a767b6fe69021cb4ce09aaf029823a097e6ac658efcab5e19e976a89ed798d06f SHA512 902d86557dd3813c31333fe18437d8046ae100814c9c1b340ab1f8266c817545f21e000702b1ca93babb9d632896ea5bada1e146436abfa7916b469681fceed5 +EBUILD bsd-games-2.17-r5.ebuild 4333 BLAKE2B c5b3a50469f62a5af317ca720b43787117a3d675d8170bb91cb4a43dbc9fd928359bfb62c1f86819522ed245fd2f96377deee74e0891c17538259afe4bc61123 SHA512 cd1ef22f06ffa4b454022ac65ce1b0cad748ae6dd07c5bc100eb2eb2ba8af92af5adcf76be7545c2bfc568bbd1f776c80ce4800784a6a22a04728a8b0b505e9d +MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118 diff --git a/games-misc/bsd-games/bsd-games-2.17-r5.ebuild b/games-misc/bsd-games/bsd-games-2.17-r5.ebuild new file mode 100644 index 000000000000..cefeb7976f5b --- /dev/null +++ b/games-misc/bsd-games/bsd-games-2.17-r5.ebuild @@ -0,0 +1,132 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils toolchain-funcs games + +DEB_PATCH_VER=22 +DESCRIPTION="collection of games from NetBSD" +HOMEPAGE="http://www.advogato.org/proj/bsd-games/" +SRC_URI="ftp://metalab.unc.edu/pub/Linux/games/${P}.tar.gz + mirror://debian/pool/main/b/bsdgames/bsdgames_${PV}-${DEB_PATCH_VER}.debian.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~x86" +IUSE="" + +RDEPEND="!games-misc/wtf + !app-misc/banner + !games-puzzle/hangman + sys-libs/ncurses:0 + sys-apps/miscfiles" +DEPEND="${RDEPEND} + sys-devel/flex + sys-devel/bison + virtual/pkgconfig" + +# Set GAMES_TO_BUILD variable to whatever you want +GAMES_TO_BUILD=${GAMES_TO_BUILD:=adventure arithmetic atc +backgammon banner battlestar bcd boggle caesar canfield countmail cribbage +dab dm factor fish gomoku hack hangman hunt mille monop morse +number phantasia pig pom ppt primes quiz rain random robots sail snake +tetris trek wargames worm worms wtf} + +src_prepare() { + local d="${WORKDIR}"/debian/patches + EPATCH_SOURCE="${d}" epatch $(<"${d}"/series) + + # Used by gentoo config.params. See bug 531200 + export GAMES_BINDIR GAMES_DATADIR GAMES_STATEDIR + + epatch \ + "${FILESDIR}"/${P}-64bitutmp.patch \ + "${FILESDIR}"/${P}-headers.patch \ + "${FILESDIR}"/${P}-bg.patch \ + "${FILESDIR}"/${P}-gcc4.patch + + # Use pkg-config to query Libs: from ncurses.pc (for eg. -ltinfo) wrt #459652 + sed -i \ + -e "/ncurses_lib/s:-lncurses:'$($(tc-getPKG_CONFIG) --libs-only-l ncurses)':" \ + configure || die + + sed -i \ + -e "s:/usr/games:${GAMES_BINDIR}:" \ + wargames/wargames || die + + sed -i \ + -e '/^CC :=/d' \ + -e '/^CXX :=/d' \ + -e '/^CFLAGS/s/OPTIMIZE/CFLAGS/' \ + -e '/^CXXFLAGS/s/OPTIMIZE/CXXFLAGS/' \ + -e '/^LDFLAGS/s/LDFLAGS := /LDFLAGS := \$(LDFLAGS) /' \ + Makeconfig.in || die + + cp "${FILESDIR}"/config.params-gentoo config.params || die + echo bsd_games_cfg_usrlibdir=\"$(games_get_libdir)\" >> ./config.params || die + echo bsd_games_cfg_build_dirs=\"${GAMES_TO_BUILD}\" >> ./config.params || die + echo bsd_games_cfg_docdir=\"/usr/share/doc/${PF}\" >> ./config.params || die +} + +src_test() { + addwrite /dev/full + emake -j1 check +} + +build_game() { + has ${1} ${GAMES_TO_BUILD} +} + +do_statefile() { + touch "${D}/${GAMES_STATEDIR}/${1}" || die + chmod ug+rw "${D}/${GAMES_STATEDIR}/${1}" || die +} + +src_install() { + dodir "${GAMES_BINDIR}" "${GAMES_STATEDIR}" /usr/share/man/man{1,6} + emake -j1 DESTDIR="${D}" install + + dodoc AUTHORS BUGS ChangeLog ChangeLog.0 \ + README PACKAGING SECURITY THANKS TODO YEAR2000 + + # set some binaries to run as games group (+S) + build_game atc && fperms g+s "${GAMES_BINDIR}"/atc + build_game battlestar && fperms g+s "${GAMES_BINDIR}"/battlestar + build_game canfield && fperms g+s "${GAMES_BINDIR}"/canfield + build_game cribbage && fperms g+s "${GAMES_BINDIR}"/cribbage + build_game phantasia && fperms g+s "${GAMES_BINDIR}"/phantasia + build_game robots && fperms g+s "${GAMES_BINDIR}"/robots + build_game sail && fperms g+s "${GAMES_BINDIR}"/sail + build_game snake && fperms g+s "${GAMES_BINDIR}"/snake + build_game tetris && fperms g+s "${GAMES_BINDIR}"/tetris-bsd + + # state files + build_game atc && do_statefile atc_score + build_game battlestar && do_statefile battlestar.log + build_game canfield && do_statefile cfscores + build_game cribbage && do_statefile criblog + build_game hack && keepdir "${GAMES_STATEDIR}"/hack + build_game robots && do_statefile robots_roll + build_game sail && do_statefile saillog + build_game snake && do_statefile snake.log && do_statefile snakerawscores + build_game tetris && do_statefile tetris-bsd.scores + + # extra docs + build_game atc && { docinto atc ; dodoc atc/BUGS; } + build_game boggle && { docinto boggle ; dodoc boggle/README; } + build_game hack && { docinto hack ; dodoc hack/{OWNER,Original_READ_ME,READ_ME,help}; } + build_game hunt && { docinto hunt ; dodoc hunt/README; } + build_game phantasia && { docinto phantasia ; dodoc phantasia/{OWNER,README}; } + + # Since factor is usually not installed, and primes.6 is a symlink to + # factor.6, make sure that primes.6 is ok ... + if build_game primes && [[ ! $(build_game factor) ]] ; then + rm -f "${D}"/usr/share/man/man6/{factor,primes}.6 + newman factor/factor.6 primes.6 + fi + + prepgamesdirs + + # state dirs + chmod -R ug+rw "${D}/${GAMES_STATEDIR}"/* || die +} diff --git a/games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch b/games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch new file mode 100644 index 000000000000..3be1b3de074b --- /dev/null +++ b/games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch @@ -0,0 +1,21 @@ +About utmpentry.c: + +the utmpx structure defines the ut_tv member a little differently on +64bit hosts so that a 32bit and 64bit structure can be shared. So the +ut_tv is a custom 32bit structure rather than the native 64bit timeval +structure. Work around is to assign the submembers instead. + +http://bugs.gentoo.org/show_bug.cgi?id=102667 + +--- bsd-games/dm/utmpentry.c ++++ bsd-games/dm/utmpentry.c +@@ -291,7 +291,8 @@ + e->line[sizeof(e->line) - 1] = '\0'; + (void)strncpy(e->host, up->ut_host, sizeof(up->ut_host)); + e->name[sizeof(e->host) - 1] = '\0'; +- e->tv = up->ut_tv; ++ e->tv.tv_sec = up->ut_tv.tv_sec; ++ e->tv.tv_usec = up->ut_tv.tv_usec; + adjust_size(e); + } + #endif diff --git a/games-misc/bsd-games/files/bsd-games-2.17-bg.patch b/games-misc/bsd-games/files/bsd-games-2.17-bg.patch new file mode 100644 index 000000000000..07dc520b77e4 --- /dev/null +++ b/games-misc/bsd-games/files/bsd-games-2.17-bg.patch @@ -0,0 +1,22 @@ +--- backgammon/common_source/fancy.c.old 2007-05-16 20:16:46.000000000 +0200 ++++ backgammon/common_source/fancy.c 2007-05-16 20:19:00.000000000 +0200 +@@ -58,7 +58,7 @@ + int lUP; /* length of UP */ + int CO; /* number of columns */ + int LI; /* number of lines */ +-int *linect; /* array of lengths of lines on screen (the ++static int linect[25]; /* array of lengths of lines on screen (the + * actual screen is not stored) */ + + /* two letter codes */ +@@ -728,10 +728,5 @@ + lND = strlen(ND); + if (LI < 24 || CO < 72 || !(CL && UP && ND)) + return (0); +- linect = (int *) calloc(LI + 1, sizeof(int)); +- if (linect == NULL) { +- write(2, "\r\nOut of memory!\r\n", 18); +- getout(0); +- } + return (1); + } diff --git a/games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch b/games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch new file mode 100644 index 000000000000..7de07effc25d --- /dev/null +++ b/games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch @@ -0,0 +1,34 @@ +--- trek/getpar.h.orig 2005-08-14 19:45:29.000000000 -0400 ++++ trek/getpar.h 2005-08-14 19:46:33.000000000 -0400 +@@ -31,6 +31,9 @@ + * @(#)getpar.h 8.1 (Berkeley) 5/31/93 + */ + ++#ifndef __GETPAR_H_ ++#define __GETPAR_H_ ++ + typedef void (*cmdfun)(int); + struct cvntab /* used for getcodpar() parameter list */ + { +@@ -51,3 +54,5 @@ + int testnl(void); + void skiptonl(int); + int readdelim(int); ++ ++#endif /*__GETPAR_H_*/ +--- trek/trek.h.orig 2005-08-14 19:45:37.000000000 -0400 ++++ trek/trek.h 2005-08-14 19:48:17.000000000 -0400 +@@ -31,6 +31,13 @@ + * @(#)trek.h 8.1 (Berkeley) 5/31/93 + */ + ++/* For struct cvntab definition, which is now required for ++ * Skitab and Lentab below. gcc 4.0 and later will emit ++ * "array type has incomplete element type" errors otherwise. ++ * -- Jason Bucata (jbucata@tulsaconnect.com), 12-AUG-2005 ++ */ ++#include "getpar.h" ++ + /* + ** Global Declarations + ** diff --git a/games-misc/bsd-games/files/bsd-games-2.17-headers.patch b/games-misc/bsd-games/files/bsd-games-2.17-headers.patch new file mode 100644 index 000000000000..953a5d35765a --- /dev/null +++ b/games-misc/bsd-games/files/bsd-games-2.17-headers.patch @@ -0,0 +1,16 @@ +http://bugs.gentoo.org/128348 + +--- include/stdio.h ++++ include/stdio.h +@@ -35,5 +35,11 @@ + #include_next <stdio.h> + + #ifndef HAVE_fgetln ++#ifdef __cplusplus ++extern "C" { ++#endif + extern char *fgetln(FILE *stream, size_t *len); ++#ifdef __cplusplus ++} ++#endif + #endif diff --git a/games-misc/bsd-games/files/config.params-gentoo b/games-misc/bsd-games/files/config.params-gentoo new file mode 100644 index 000000000000..9d246d1865e9 --- /dev/null +++ b/games-misc/bsd-games/files/config.params-gentoo @@ -0,0 +1,39 @@ + +# This file is read by configure for the Gentoo ebuild + +# Don't run configure interactively. +bsd_games_cfg_non_interactive=y + +bsd_games_cfg_install_prefix=${D} + +# For gentoo, +# banner used to be in util-linux. Gentoo might have an ebuild +# fortune is "app-games/fortune-mod" +# factor is in "sys-apps/sh-utils" +# dm is not installed by debian, I don't know why +bsd_games_cfg_no_build_dirs="dm banner fortune factor" + +# Gentoo's games eclass want everything in these places +bsd_games_cfg_gamesdir=${GAMES_BINDIR} +bsd_games_cfg_sbindir=${GAMES_BINDIR} +bsd_games_cfg_sharedir=${GAMES_DATADIR}/${PN} +bsd_games_cfg_varlibdir=${GAMES_STATEDIR} + +# We'll control all the permissions during install (via games eclass) +bsd_games_cfg_do_chown=n + +# .so or symlink??? (Debian perfers symlinks for manpages) +bsd_games_cfg_use_dot_so=symlinks + +# Gentoo'll handle manpage compressing. +bsd_games_cfg_gzip_manpages=n + +# sys-apps/less is in system (even though more is in /bin) +bsd_games_cfg_pager=/usr/bin/less + +# sys-apps/miscfiles might have too many words for boggle +bsd_games_cfg_dictionary_src=/usr/share/dict/words + +# Acronym file for "wft" +bsd_games_cfg_wtf_acronymfile=${GAMES_DATADIR}/${PN}/acronyms + diff --git a/games-misc/bsd-games/metadata.xml b/games-misc/bsd-games/metadata.xml new file mode 100644 index 000000000000..78274e0fa550 --- /dev/null +++ b/games-misc/bsd-games/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> |