Initial import as per bug #52367
authorDaniel Black <dragonheart@gentoo.org>
Mon, 17 Jan 2005 08:36:53 +0000 (08:36 +0000)
committerDaniel Black <dragonheart@gentoo.org>
Mon, 17 Jan 2005 08:36:53 +0000 (08:36 +0000)
Package-Manager: portage-2.0.51-r13

games-misc/typespeed/ChangeLog [new file with mode: 0644]
games-misc/typespeed/Manifest [new file with mode: 0644]
games-misc/typespeed/files/01_all_statedir-fix.patch [new file with mode: 0644]
games-misc/typespeed/files/digest-typespeed-0.4.4 [new file with mode: 0644]
games-misc/typespeed/metadata.xml [new file with mode: 0644]
games-misc/typespeed/typespeed-0.4.4.ebuild [new file with mode: 0644]

diff --git a/games-misc/typespeed/ChangeLog b/games-misc/typespeed/ChangeLog
new file mode 100644 (file)
index 0000000..d9ba2be
--- /dev/null
@@ -0,0 +1,11 @@
+# ChangeLog for games-misc/typespeed
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-misc/typespeed/ChangeLog,v 1.1 2005/01/17 08:36:52 dragonheart Exp $
+
+*typespeed-0.4.4 (17 Jan 2005)
+
+  17 Jan 2005; Daniel Black <dragonheart@gentoo.org> +metadata.xml,
+  +files/01_all_statedir-fix.patch, +typespeed-0.4.4.ebuild:
+  Initial import as per bug #52367. Thanks to Octavio Ruiz (Ta^3)
+  <tacvbo@tacvbo.net>.
+
diff --git a/games-misc/typespeed/Manifest b/games-misc/typespeed/Manifest
new file mode 100644 (file)
index 0000000..565593f
--- /dev/null
@@ -0,0 +1,15 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 fe9b1409fcc540cc7f0a90a2b1ff68cc typespeed-0.4.4.ebuild 2007
+MD5 6d796b061ed1c1337ef157a5f74dab35 metadata.xml 403
+MD5 48ddfa316630c8efd3381dc1aa4ec21d ChangeLog 469
+MD5 09490e2cc962578e3cf60ee6d9893fe9 files/digest-typespeed-0.4.4 66
+MD5 9818f759fab13af7dcafc9ad329e1af9 files/01_all_statedir-fix.patch 2095
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.0 (GNU/Linux)
+
+iD8DBQFB63krmdTrptrqvGERAgGIAJ4oP7jz42V3q/L8AO6Bl4y+H8Qn4ACeKqO0
+ZW5T0uoYTZwwrLEWRUEb44w=
+=4Hra
+-----END PGP SIGNATURE-----
diff --git a/games-misc/typespeed/files/01_all_statedir-fix.patch b/games-misc/typespeed/files/01_all_statedir-fix.patch
new file mode 100644 (file)
index 0000000..e8a7bd6
--- /dev/null
@@ -0,0 +1,73 @@
+diff -ur typespeed-0.4.4.orig/file.c typespeed-0.4.4/file.c
+--- typespeed-0.4.4.orig/file.c        2003-06-18 02:15:39.000000000 -0500
++++ typespeed-0.4.4/file.c     2005-01-15 21:56:50.386541848 -0600
+@@ -14,6 +14,7 @@
+       wordcount = -1;
+       nakkimakkara = 0;
+ 
++chdir(WORDLIST_PATH);
+       if ((wordfile = fopen(stringi, "r")) == NULL) {
+               return 1;
+       }
+@@ -89,6 +90,7 @@
+       k = 0;
+       a = 1;
+ 
++chdir(WORDLIST_PATH);
+       dcolor_set(5, NULL);
+       n = scandir(".", &namelist, 0, alphasort);
+       tot = n;
+@@ -272,6 +274,7 @@
+       {"3l33t", "Pro", "VeryGood", "Good", "Average", "NoGood", "ADP-Pro", "Loser", "None", "None"};
+ 
+ 
++chdir(HIGHSCORE_PATH);
+       filetys = (char *) malloc(sizeof(char) * (strlen(sanafile) + strlen(".high") + 1));
+       strcpy(filetys, "");
+       strcat(filetys, "high.");
+@@ -311,6 +314,7 @@
+               float typoratio;
+               char faim[21];
+       } high;
++chdir(HIGHSCORE_PATH);
+       filetys = (char *) malloc(sizeof(char) * (strlen(sanafile) + strlen(".high") + 1));
+       strcpy(filetys, "");
+       strcat(filetys, "high.");
+@@ -386,6 +390,7 @@
+                                               strlen(".high")
+                                               + 1));
+ 
++chdir(HIGHSCORE_PATH);
+       dcolor_set(5, NULL);
+       strcpy(filet, "");
+       strcat(filet, "high.");
+@@ -526,6 +531,7 @@
+       struct dirent **namelist;
+         int n;
+ 
++chdir(WORDLIST_PATH);
+       n = scandir(".", &namelist, 0, alphasort);
+       if (n < 0) {
+               printf("scandir failed.\n");
+diff -ur typespeed-0.4.4.orig/typespeed.1 typespeed-0.4.4/typespeed.1
+--- typespeed-0.4.4.orig/typespeed.1   2003-06-18 02:36:37.000000000 -0500
++++ typespeed-0.4.4/typespeed.1        2005-01-15 21:53:34.856266968 -0600
+@@ -1,4 +1,4 @@
+-.TH TYPESPEED 1
++.TH TYPESPEED 6
+ .SH NAME
+ typespeed \- Test your typing speed, and get your fingers' CPS
+ .SH SYNOPSIS
+diff -ur typespeed-0.4.4.orig/typespeed.h typespeed-0.4.4/typespeed.h
+--- typespeed-0.4.4.orig/typespeed.h   2003-06-18 01:43:13.000000000 -0500
++++ typespeed-0.4.4/typespeed.h        2005-01-15 21:56:52.443229184 -0600
+@@ -38,6 +38,9 @@
+ #define DEFAULT_TRAININGSPEED 2
+ #define DEFAULT_CHEAT 0
+ 
++#define HIGHSCORE_PATH "/var/games/typespeed"
++#define WORDLIST_PATH "/usr/share/games/typespeed"
++
+ typedef struct
+ {
+       int score;
diff --git a/games-misc/typespeed/files/digest-typespeed-0.4.4 b/games-misc/typespeed/files/digest-typespeed-0.4.4
new file mode 100644 (file)
index 0000000..8581f11
--- /dev/null
@@ -0,0 +1 @@
+MD5 97ca3e3d0323c41ecc4f453f557287ea typespeed-0.4.4.tar.gz 38526
diff --git a/games-misc/typespeed/metadata.xml b/games-misc/typespeed/metadata.xml
new file mode 100644 (file)
index 0000000..b9fc2b9
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+  <email>dragonheart@gentoo.org</email>
+    <name>Daniel Black</name>
+    <description>A user ebuild that I felt obliged to include. Please take over if you want 
+it</description>
+</maintainer>
+<longdescription></longdescription>
+</pkgmetadata>
diff --git a/games-misc/typespeed/typespeed-0.4.4.ebuild b/games-misc/typespeed/typespeed-0.4.4.ebuild
new file mode 100644 (file)
index 0000000..b0cd997
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-misc/typespeed/typespeed-0.4.4.ebuild,v 1.1 2005/01/17 08:36:52 dragonheart Exp $
+
+inherit games toolchain-funcs
+
+DESCRIPTION="Test your typing speed, and get your fingers CPS"
+HOMEPAGE="http://ls.purkki.org/typespeed/"
+SRC_URI="http://ls.purkki.org/typespeed/${P}.tar.gz"
+
+KEYWORDS="x86 ppc"
+IUSE=""
+LICENSE="GPL-2"
+SLOT="0"
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="${RDEPEND}
+       >=sys-apps/sed-4"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       epatch ${FILESDIR}/01_all_statedir-fix.patch || die "patch failed"
+       sed -i -e "s:^CFLAGS =.*:& ${CFLAGS}:" Makefile || \
+               die "src_unpack failed"
+}
+
+src_compile() {
+       emake CC=$(tc-getCC) || die "src_compile failed"
+}
+
+src_install() {
+       dodir "${GAMES_DATADIR}/${PN}" || die "dodir failed"
+       keepdir "${GAMES_STATEDIR}/${PN}" || die "keepdir failed"
+       dogamesbin typespeed || die "dogamesbin failed"
+       cp ${S}/words* "${D}${GAMES_DATADIR}/${PN}/" || die "copying wordfiles failed"
+       dodoc README TODO COPYING Changes BUGS || die "dodoc failed"
+       newman typespeed.1 typespeed.6 || die "doman failed"
+       prepgamesdirs
+}
+
+pkg_postinst() {
+       cd /var/games/typespeed || die "cd failed"
+       # Backup existing scorefiles
+       mkdir backup_scores || die "mkdir failed"
+       find -maxdepth 1 -name 'high.words.*' -exec mv '{}' backup_scores/ \;
+       echo ""
+       einfo "Generating scorefiles..."
+       echo ""
+       /usr/games/bin/typespeed --makescores > /dev/null || die "make scores failed"
+       find backup_scores -type f -exec mv -f '{}' . \;
+       rmdir backup_scores/ || die "rmdir backup_scores failed"
+       chmod g+rw,o-rwx ${PWD}/high*
+       games_pkg_postinst
+}
+
+pkg_postrm() {
+       echo ""
+       einfo "${PN} scorefiles was installed into ${GAMES_STATEDIR}/${PN}"
+       einfo "and haven't been removed (if this is an uninstall)."
+       einfo "To get rid of ${PN} completely, you can safely remove"
+       einfo "${GAMES_STATEDIR}/${PN} running:"
+       echo ""
+       einfo "rm -rf ${GAMES_STATEDIR}/${PN}"
+       echo ""
+}