moria-5.5.2.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs games
  5. DESCRIPTION="Rogue-like D&D curses game similar to nethack (BUT BETTER)"
  6. HOMEPAGE="http://remarque.org/~grabiner/moria.html"
  7. SRC_URI="ftp://ftp.greyhelm.com/pub/Games/Moria/source/um${PV}.tar.Z
  8. http://www.funet.fi/pub/unix/games/moria/source/um${PV}.tar.Z
  9. http://www.piratehaven.org/~beej/moria/mirror/Games/Moria/source/um${PV}.tar.Z
  10. http://alge.anart.no/ftp/pub/games/RPG/moria/um${PV}.tar.Z
  11. ftp://kane.evendata.net/pub/${PN}-extras.tar.bz2"
  12. LICENSE="Moria"
  13. SLOT="0"
  14. KEYWORDS="amd64 ppc x86 ~x86-fbsd"
  15. IUSE=""
  16. RDEPEND=">=sys-libs/ncurses-5:0"
  17. DEPEND="${RDEPEND}
  18. virtual/pkgconfig"
  19. S=${WORKDIR}/umoria
  20. src_prepare() {
  21. local f
  22. epatch \
  23. "${FILESDIR}"/${PV}-gentoo-paths.patch \
  24. "${FILESDIR}"/${PV}-glibc.patch \
  25. "${FILESDIR}"/${PV}-fbsd.patch \
  26. "${FILESDIR}"/${PV}-hours.patch \
  27. "${FILESDIR}"/${PV}-warnings.patch
  28. for f in source/* unix/* ; do
  29. ln -s ${f} $(basename ${f})
  30. done
  31. sed -i \
  32. -e "s:David Grabiner:root:" \
  33. -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}:" \
  34. -e "s:GENTOO_STATEDIR:${GAMES_STATEDIR}:" \
  35. config.h || die
  36. {
  37. echo "#include <stdlib.h>"
  38. echo "#include <stdio.h>"
  39. } >> config.h || die
  40. sed -i \
  41. -e "/^STATEDIR =/s:=.*:=\$(DESTDIR)${GAMES_STATEDIR}:" \
  42. -e "/^BINDIR = /s:=.*:=\$(DESTDIR)${GAMES_BINDIR}:" \
  43. -e "/^LIBDIR = /s:=.*:=\$(DESTDIR)${GAMES_DATADIR}/${PN}:" \
  44. -e "/^CFLAGS = /s:=.*:=${CFLAGS}:" \
  45. -e "/^OWNER = /s:=.*:=${GAMES_USER}:" \
  46. -e "/^GROUP = /s:=.*:=${GAMES_GROUP}:" \
  47. -e "/^CC = /s:=.*:=$(tc-getCC):" \
  48. -e '/^LFLAGS = /s:=.*:= $(LDFLAGS):' \
  49. Makefile || die
  50. mv doc/moria.6 "${S}" || die
  51. }
  52. src_install() {
  53. dodir "${GAMES_BINDIR}" "${GAMES_DATADIR}/${PN}" "${GAMES_STATEDIR}"
  54. emake DESTDIR="${D}" install
  55. doman moria.6
  56. dodoc README doc/* "${WORKDIR}"/${PN}-extras/*
  57. prepgamesdirs
  58. }