aboutsummaryrefslogtreecommitdiffstats
path: root/misc/dvorak7min
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2014-02-27 17:10:24 +0800
committermiwi <miwi@FreeBSD.org>2014-02-27 17:10:24 +0800
commit1affba9416126bac901cc484acf635508913342b (patch)
tree57857ec7be3c29f5c0de9a7bd1ad6256487f0bfa /misc/dvorak7min
parentb174484ed7796d30bd5d4e8b2f3b137ea8e70615 (diff)
downloadfreebsd-ports-gnome-1affba9416126bac901cc484acf635508913342b.tar.gz
freebsd-ports-gnome-1affba9416126bac901cc484acf635508913342b.tar.zst
freebsd-ports-gnome-1affba9416126bac901cc484acf635508913342b.zip
- Update MASTER_SITES and WWW: line
- Add LICENSE PR: 187046 Submitted by: Ports Fury
Diffstat (limited to 'misc/dvorak7min')
-rw-r--r--misc/dvorak7min/Makefile25
-rw-r--r--misc/dvorak7min/distinfo4
-rw-r--r--misc/dvorak7min/files/patch-dvorak7min.c71
-rw-r--r--misc/dvorak7min/files/patch-lessons.c66
-rw-r--r--misc/dvorak7min/pkg-descr5
5 files changed, 157 insertions, 14 deletions
diff --git a/misc/dvorak7min/Makefile b/misc/dvorak7min/Makefile
index 1783e2d2228a..c4c589d8eace 100644
--- a/misc/dvorak7min/Makefile
+++ b/misc/dvorak7min/Makefile
@@ -3,23 +3,30 @@
PORTNAME= dvorak7min
PORTVERSION= 1.6.1
+PORTREVISION= 1
CATEGORIES= misc
-MASTER_SITES= http://www.linalco.com/ragnar/
+MASTER_SITES= DEBIAN
+DISTNAME= ${PORTNAME}_${PORTVERSION}.orig
MAINTAINER= ports@FreeBSD.org
-COMMENT= An ncurses-based Dvorak typing tutor
+COMMENT= Ncurses-based Dvorak typing tutor
-DEPRECATED= No more public distfiles
-EXPIRATION_DATE= 2014-03-10
+LICENSE= GPLv2 # (or later)
-.include <bsd.port.pre.mk>
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-MAKE_ARGS= PROF="${CPPFLAGS} ${CFLAGS}" LDFLAGS="${LDFLAGS}"
+post-patch:
+ @${REINPLACE_CMD} -e \
+ 's|^\(PROF\)|#\1| ; \
+ /^CFLAGS/s|\([[:space:]]\)=|\1+=| ; \
+ s|^\(LDFLAGS\)|#\1| ; \
+ s|-lncurses|-lcurses|' ${WRKSRC}/Makefile
pre-build:
- @cd ${WRKSRC} ; ${MAKE} clean
+ @${RM} -f ${WRKSRC}/*.o
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/dvorak7min ${STAGEDIR}${PREFIX}/bin
+ (cd ${WRKSRC} && ${INSTALL_PROGRAM} dvorak7min \
+ ${STAGEDIR}${PREFIX}/bin)
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/misc/dvorak7min/distinfo b/misc/dvorak7min/distinfo
index 71473efc57f0..d4dd32580087 100644
--- a/misc/dvorak7min/distinfo
+++ b/misc/dvorak7min/distinfo
@@ -1,2 +1,2 @@
-SHA256 (dvorak7min-1.6.1.tar.gz) = f0b5be8b44782904717adea087fc936cd4941d6885fe5d8d0a60a5c8467f15c5
-SIZE (dvorak7min-1.6.1.tar.gz) = 53115
+SHA256 (dvorak7min_1.6.1.orig.tar.gz) = f0b5be8b44782904717adea087fc936cd4941d6885fe5d8d0a60a5c8467f15c5
+SIZE (dvorak7min_1.6.1.orig.tar.gz) = 53115
diff --git a/misc/dvorak7min/files/patch-dvorak7min.c b/misc/dvorak7min/files/patch-dvorak7min.c
index 74363cb914da..0f4766fea9dd 100644
--- a/misc/dvorak7min/files/patch-dvorak7min.c
+++ b/misc/dvorak7min/files/patch-dvorak7min.c
@@ -8,3 +8,74 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
+@@ -173,7 +172,8 @@
+ /* calculate typing speed in a given interval */
+ inline float calcSpeed (time_t timeStart, time_t timeFinish, int hits)
+ {
+- return (float) hits / (timeFinish - timeStart);
++ // Use WPS/WPM as better standard, so also divide by 5
++ return (float) hits / 5 / (timeFinish - timeStart);
+ }
+
+
+@@ -193,7 +193,7 @@
+
+ file = fopen (fileName, "r");
+ if (!file) {
+- postmortem = sys_errlist[errno];
++ postmortem = strerror(errno);
+ return -1;
+ }
+
+@@ -220,7 +220,7 @@
+ while (1) {
+ c = fgetc (file);
+ if (errno) {
+- postmortem = sys_errlist[errno];
++ postmortem = strerror(errno);
+ fclose (file);
+ return -1;
+ }
+@@ -418,6 +418,7 @@
+ ++p;
+ if (!timeStart) {
+ timeStart = time(0);
++ hits = 0;
+ }
+ }
+
+@@ -431,8 +432,9 @@
+ float ratio = hits - misses;
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits);
+ timeCurrent = time(0);
+- speed = calcSpeed (timeStart, timeCurrent, hits);
+- mvprintw (LINES - 1, 0, "CPS %.2f CPM %.2f Hits: %d Misses: %d Seconds: %d Ratio: %.2f%%", speed, speed * 60, hits, misses, time(0) - timeStart, ratio);
++ speed = calcSpeed (timeStart, timeCurrent, hits + misses);
++ // Use WPS/WPM as better standards
++ mvprintw (LINES - 1, 0, "WPS %.2f WPM %.2f Hits: %d Misses: %d Seconds: %d Ratio: %.2f%%", speed, speed * 60, hits, misses, time(0) - timeStart, ratio);
+ clrtoeol();
+ }
+ } while (ch == ERR);
+@@ -510,7 +512,7 @@
+ }
+
+ timeFinish = time(0);
+- speed = calcSpeed(timeStart, timeFinish, hits);
++ speed = calcSpeed(timeStart, timeFinish, hits + misses);
+ clear();
+ cbreak();
+ if (!timeStart) {
+@@ -519,8 +521,11 @@
+ float ratio = hits - misses;
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits);
+ mvprintw (0, 0, "Elapsed time: %d seconds", timeFinish - timeStart);
+- mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%", hits, misses, ratio);
+- mvprintw (2, 0, "CPS: %.2f CPM: %.2f", speed, speed * 60);
++ mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%",
++ hits + misses, misses,
++ (float)100*(hits) / (hits + misses));
++ // Use WPM/WPS as better standard
++ mvprintw (2, 0, "WPS: %.2f WPM: %.2f", speed, speed * 60);
+ }
+
+ mvprintw (4, 0, "[ ] Press ESCAPE to continue.");
diff --git a/misc/dvorak7min/files/patch-lessons.c b/misc/dvorak7min/files/patch-lessons.c
new file mode 100644
index 000000000000..58fed4588658
--- /dev/null
+++ b/misc/dvorak7min/files/patch-lessons.c
@@ -0,0 +1,66 @@
+--- lessons.c.orig
++++ lessons.c
+@@ -166,6 +166,7 @@
+ "gggg pppp gggg pppp gggg pppp gggg pppp gggg pppp gggg pppp gggg ppp\n"
+ "pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg\n"
+ "gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp\n"
++"\x1"
+ "gggg hhhh pppp uuuu gggg hhhh pppp uuuu gggg hhhh pppp uuuu\n"
+ "up up up up hug hug hug hug pug pug pug pug pup pup pup pup\n"
+ "ugh ugh ugh ugh Hugh Hugh Hugh Hugh Pugh Pugh Pugh Pugh",
+@@ -263,7 +264,7 @@
+ "The catchup accident at the picnic depicted Dutch as an apathetic nuisance.\n"
+ "It is no coincidence that this idiotic sentence has eight concise Cs in it.\n"
+ "The enthusiastic duchess noticed the Pontiac coupe...and decided to chase it."
+-"\1"
++"\x1"
+ "I detect a headache...I hope it is not the\n"
+ "Schnapps and Cocoa I had as a nightcap.\n"
+ "\n"
+@@ -362,11 +363,12 @@
+ "Allegra, an unparalleled intellectual, calculated the celestial latitudes and\n"
+ "longitudes in her sleep.",
+
+- "YF: index fingers streching up",
++ "YF: index fingers stretching up",
+ "\x2"
+ "ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy\n"
+ "ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy\n"
+ "fy fy fy fy fy fy fy yf yf yf yf yf yf yf ffff gggg hhhh yyyy pppp uuuu\n"
++"\x1"
+ "guy guy guy guy guy guy guy guy guy gyp gyp gyp gyp gyp gyp gyp gyp gyp\n"
+ "UHF UHF UHF UHF UHF UHF UHF UHF UHF yuh yuh yuh yuh yuh yuh yuh yuh yuh\n"
+ "huff huff huff huff huff huff huff puff puff puff puff puff puff puff\n"
+@@ -406,6 +408,7 @@
+ "kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm\n"
+ "kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm\n"
+ "km km km km km km km km km km mk mk mk mk mk mk mk mk mk mk\n"
++"\x1"
+ "hhhh kkkk mmmm uuuu hhhh kkkk mmmm uuuu hhhh kkkk mmmm uuuu\n"
+ "ku ku ku ku ku ku ku ku ku ku mu mu mu mu mu mu mu mu mu mu\n"
+ "UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK\n"
+@@ -442,6 +445,7 @@
+ "jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww\n"
+ "jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww\n"
+ "jw jw jw jw jw jw jw jw jw jw jw wj wj wj wj wj wj wj wj wj\n"
++"\x1"
+ "eeee jjjj tttt wwww eeee jjjj tttt wwww eeee jjjj tttt wwww\n"
+ "ewe ewe ewe ewe ewe jet jet jet jet jet Jew Jew Jew Jew Jew\n"
+ "wee wee wee wee wee wee wee wet wet wet wet wet wet wet wet\n"
+@@ -500,6 +504,7 @@
+ "An acquisitive mind helped Pavlov evolve his theories.\n"
+ "QVC's involvement with Paramount may give it new verve.\n"
+ "Vivian's new Volvo unequivocally vanquished her fears of driving.\n"
++"\x1"
+ "According to Pravda, Vladivostok was a quiet village in its Soviet days.\n"
+ "This unique, opaque liquor does not quench your thirst, it makes you queasy.\n"
+ "David's vivid imagination and his inquisitive and inventive mind suggest a high IQ."
+@@ -548,7 +553,7 @@
+ "activity; several lizards hazarded the freezing waters and capsized the fish\n"
+ "tanks; a dozen grizzlies were waltzing in the plaza.",
+
+- "XB: index fingers streching down",
++ "XB: index fingers stretching down",
+ "\x2"
+ "bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx\n"
+ "bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx\n"
diff --git a/misc/dvorak7min/pkg-descr b/misc/dvorak7min/pkg-descr
index 000a27982e80..7bcb3dfcbe6d 100644
--- a/misc/dvorak7min/pkg-descr
+++ b/misc/dvorak7min/pkg-descr
@@ -4,6 +4,5 @@ lessons, color for easy visual feedback, and a real time characters per
second display. It's called 7min because it originally was a personal
hack written in 7 min.
-Author: Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
-WWW: http://www.linalco.com/comunidad.html
- http://freshmeat.net/projects/dvorak7mintutor/
+Author: Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
+WWW: http://packages.qa.debian.org/d/dvorak7min.html