move scores file to /var/games #37594
authorMike Frysinger <vapier@gentoo.org>
Wed, 14 Jan 2004 16:51:56 +0000 (16:51 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 14 Jan 2004 16:51:56 +0000 (16:51 +0000)
games-roguelike/tome/ChangeLog
games-roguelike/tome/files/2.2.5-gentoo-paths.patch [new file with mode: 0644]
games-roguelike/tome/files/digest-tome-2.2.5-r1 [new file with mode: 0644]
games-roguelike/tome/tome-2.2.5-r1.ebuild [new file with mode: 0644]

index b917d9b075c7ae799c45fc98e363be8df360767a..e55f4fef824d18be398b856000a7cdbd091c330f 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for games-roguelike/tome
 # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-roguelike/tome/ChangeLog,v 1.4 2004/01/02 00:44:47 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-roguelike/tome/ChangeLog,v 1.5 2004/01/14 16:51:56 vapier Exp $
+
+*tome-2.2.5-r1 (14 Jan 2004)
+
+  14 Jan 2004; Mike Frysinger <vapier@gentoo.org> :
+  Move scores file out of /usr/share and into /var/games #37594.
 
 *tome-2.2.5 (01 Jan 2004)
 
diff --git a/games-roguelike/tome/files/2.2.5-gentoo-paths.patch b/games-roguelike/tome/files/2.2.5-gentoo-paths.patch
new file mode 100644 (file)
index 0000000..d171a1c
--- /dev/null
@@ -0,0 +1,31 @@
+diff -rU 1 tome-225-src.orig/src/files.c tome-225-src/src/files.c
+--- tome-225-src.orig/src/files.c      2004-01-14 11:17:02.423263360 -0500
++++ tome-225-src/src/files.c   2004-01-14 11:17:50.074019344 -0500
+@@ -5670,3 +5670,3 @@
+       /* Build the filename */
+-      path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
++      sprintf(buf, "GENTOO_DIR/tome-scores.raw");
+@@ -5748,3 +5748,3 @@
+       /* Build the filename */
+-      path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
++      sprintf(buf, "GENTOO_DIR/tome-scores.raw");
+@@ -5846,3 +5846,3 @@
+       /* Build the filename */
+-      path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
++      sprintf(buf, "GENTOO_DIR/tome-scores.raw");
+@@ -6296,3 +6296,3 @@
+       /* Build the filename */
+-      path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
++      sprintf(buf, "GENTOO_DIR/tome-scores.raw");
+diff -rU 1 tome-225-src.orig/src/init2.c tome-225-src/src/init2.c
+--- tome-225-src.orig/src/init2.c      2004-01-14 11:17:02.473255760 -0500
++++ tome-225-src/src/init2.c   2004-01-14 11:17:58.286770816 -0500
+@@ -6686,3 +6686,3 @@
+       /* Build the filename */
+-      path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
++      sprintf(buf, "GENTOO_DIR/tome-scores.raw");
diff --git a/games-roguelike/tome/files/digest-tome-2.2.5-r1 b/games-roguelike/tome/files/digest-tome-2.2.5-r1
new file mode 100644 (file)
index 0000000..72f8f65
--- /dev/null
@@ -0,0 +1 @@
+MD5 b1a340a6092fd53b07be9d107b16e16b tome-225-src.tgz 3179754
diff --git a/games-roguelike/tome/tome-2.2.5-r1.ebuild b/games-roguelike/tome/tome-2.2.5-r1.ebuild
new file mode 100644 (file)
index 0000000..533d22d
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-roguelike/tome/tome-2.2.5-r1.ebuild,v 1.1 2004/01/14 16:51:56 vapier Exp $
+
+inherit games eutils
+
+MY_PV=${PV//./}
+DESCRIPTION="save the world from Morgoth and battle evil (or become evil ;])"
+HOMEPAGE="http://t-o-m-e.net/"
+SRC_URI="http://t-o-m-e.net/dl/src/tome-${MY_PV}-src.tgz"
+
+LICENSE="Moria"
+SLOT="0"
+KEYWORDS="x86 ppc"
+
+RDEPEND="virtual/glibc
+       >=sys-libs/ncurses-5
+       virtual/x11"
+
+S=${WORKDIR}/tome-${MY_PV}-src
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}/src
+       mv makefile.std makefile
+       epatch ${FILESDIR}/${PV}-gentoo-paths.patch
+       sed -i "s:GENTOO_DIR:${GAMES_STATEDIR}:" files.c init2.c
+}
+
+src_compile() {
+       cd src
+       emake -j1 \
+               COPTS="${CFLAGS}" \
+               BINDIR=${GAMES_BINDIR} \
+               LIBDIR=${GAMES_DATADIR}/${PN} \
+               || die "emake failed"
+}
+
+src_install() {
+       cd src
+       emake -j1 \
+               OWNER=${GAMES_USER} \
+               BINDIR=${D}/${GAMES_BINDIR} \
+               LIBDIR=${D}/${GAMES_DATADIR}/${PN} install \
+               || die "make install failed"
+       cd ${S}
+       dodoc *.txt
+
+       dodir ${GAMES_STATEDIR}
+       touch ${D}/${GAMES_STATEDIR}/${PN}-scores.raw
+       prepgamesdirs
+       fperms g+w ${GAMES_STATEDIR}/${PN}-scores.raw
+       fperms g+w ${GAMES_DATADIR}/${PN}/data
+}
+
+pkg_postinst() {
+       games_pkg_postinst
+       echo
+       ewarn "ToME ${PV} is not save-game compatible with previous versions."
+       echo
+       einfo "If you have older save files and you wish to continue those games,"
+       einfo "you'll need to remerge the version of ToME with which you started"
+       einfo "those save-games."
+}