diff options
author | Peter Pentchev <roam@FreeBSD.org> | 2001-03-06 10:56:55 +0000 |
---|---|---|
committer | Peter Pentchev <roam@FreeBSD.org> | 2001-03-06 10:56:55 +0000 |
commit | a6307737b802580d9582dd4d18ef7efdf17a2b44 (patch) | |
tree | dedb11cc3d9461adc00b661c738bca4383a263d0 /games/nonsense | |
parent | Update to 0.7.13. (diff) |
Update to 0.6. Include manpage submitted by Dave Chapeskie.
Submitted by: Dave Chapeskie <dchapes@ddm.crosswinds.net>
Notes
Notes:
svn path=/head/; revision=39118
Diffstat (limited to 'games/nonsense')
-rw-r--r-- | games/nonsense/Makefile | 14 | ||||
-rw-r--r-- | games/nonsense/distinfo | 2 | ||||
-rw-r--r-- | games/nonsense/files/nonsense.6 | 340 | ||||
-rw-r--r-- | games/nonsense/pkg-descr | 2 | ||||
-rw-r--r-- | games/nonsense/pkg-plist | 7 |
5 files changed, 361 insertions, 4 deletions
diff --git a/games/nonsense/Makefile b/games/nonsense/Makefile index cec33a7fcfb0..8f2edccd2405 100644 --- a/games/nonsense/Makefile +++ b/games/nonsense/Makefile @@ -6,16 +6,21 @@ # PORTNAME= nonsense -PORTVERSION= 0.5 +PORTVERSION= 0.6 CATEGORIES= games -MASTER_SITES= http://i-want-a-website.com/about-linux/ +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} MAINTAINER= roam@FreeBSD.org NO_BUILD= defined +MAN6= nonsense.6 + post-configure: ${PERL} -pi -e "s,/usr/local,${PREFIX}," ${WRKSRC}/nonsense + ${SED} -e "s^%%PREFIX%%^${PREFIX}^g" \ + < ${FILESDIR}/${MAN6} > ${WRKSRC}/${MAN6} do-install: ${INSTALL_SCRIPT} ${WRKSRC}/nonsense ${PREFIX}/bin @@ -23,5 +28,10 @@ do-install: ${MKDIR} ${PREFIX}/share/nonsense/template ${INSTALL_DATA} ${WRKSRC}/*.data ${PREFIX}/share/nonsense/data ${INSTALL_DATA} ${WRKSRC}/*.template ${PREFIX}/share/nonsense/template + ${INSTALL_MAN} ${WRKSRC}/${MAN6} ${PREFIX}/man/man6/ +.if !defined(NOPORTDOCS) + ${MKDIR} ${PREFIX}/share/doc/nonsense + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/nonsense/ +.endif .include <bsd.port.mk> diff --git a/games/nonsense/distinfo b/games/nonsense/distinfo index 94aaa9f0d818..dbdbd27b6656 100644 --- a/games/nonsense/distinfo +++ b/games/nonsense/distinfo @@ -1 +1 @@ -MD5 (nonsense-0.5.tar.gz) = 5749a6e4623e64b9929822e07c2a5512 +MD5 (nonsense-0.6.tar.gz) = c4dea11d034735a538810ef3d0fa5b97 diff --git a/games/nonsense/files/nonsense.6 b/games/nonsense/files/nonsense.6 new file mode 100644 index 000000000000..a36569cb8461 --- /dev/null +++ b/games/nonsense/files/nonsense.6 @@ -0,0 +1,340 @@ +.Dd March 6, 2001 +.Dt NONSENSE 6 +.Sh NAME +.Nm nonsense +.Nd generates random text from datafiles and templates +.Sh SYNOPSIS +.Nm +.Op Fl b Ar bullet +.Op Fl dDeF +.Op Fl f Ar data_file +.Op Fl n Ar number +.Op Fl t Ar template_file +.Op Fl p +.Op tag ... +.Sh DESCRIPTION +.Nm Nonsense +generates random +.Pq and sometime humorous +text from datafiles and templates using a very simple, recursive grammar. +It's like having a million monkeys sitting in front of a million +typewriters, without having to feed or clean up after them. +From fake Slashdot headlines to absurd +college courses to buzzword bingo cards, +.Nm +is a good way to waste time. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl b Ar bullet +Specify a +.Dq bullet +go in front of each item. +.It Fl d +Debug mode +.Pq shows each substitution +.It Fl D +Verbose debug mode +.Pq shows each substitution and the result +.It Fl e +Disable direct eval()'s +.It Fl f Ar data_file +Specify a data file to load in. +Use multiple +.Fl f +options to include additional files. +The +.Pa default.data +file is always loaded. +.It Fl F +Load all +.Pa *.data +files. +.It Fl n Ar number +Repeat +.Ar n +times. +.It Fl t Ar template_file +Use a template file. +The markup in this file will be processed and the result output to +.Dv stdout. +.It Fl p +Separate each item with a blank line. +.El +.Pp +The +.Fl d +and +.Fl D +options are mutually exclusive. +.Pp +Thanks to contributions by +.An Fred Hirsch Aq truehand@darkhart.com , +.Nm +can also be executed as a CGI script. +Details are in +.Pa %%PREFIX%%/share/doc/nonsense/README . +.Sh FILES +.Bl -tag -width Pa -compact +.It Pa %%PREFIX%%/share/nonsense/data/* +.Nm +data files. +Any files specified with the +.Fl f +option are found by looking in the current directory and then this +directory. +The +.Fl F +option loads all files in this directory. +.It Pa %%PREFIX%%/share/nonsense/template/* +.Nm +template files. +Any file specified with the +.Fl t +option is found by looking in the current directory and then this +directory. +.El +.Sh EXAMPLES +Bellow is a list of things that +.Nm +can output with the data files included. +.Pp +For a realistic simulation of the Slashdot homepage: +.Bd -literal -offset indent +nonsense -t slashdot.html.template +.Ed +.Pp +For a buzzword-enhanced mission statement that only a +.Dq Pointy Haired Boss +could love: +.Bd -literal -offset indent +nonsense -f mission.data +.Ed +.Pp +For a PHB-inspired business plan +.Pq in HTML : +.Bd -literal -offset indent +nonsense -t bizplan.html.template -f mission.data +.Ed +.Pp +For a person's name: +.Bd -literal -offset indent +nonsense Person +.Ed +.Pp +For a long list of random fake e-mail addresses suitable for sending to +a spammer's e-mail harvester: +.Bd -literal -offset indent +nonsense FakeEmail -n 1000 +.Ed +.Pp +For a buzzword bingo card +.Pq in HTML +to print out for your next meeting: +.Bd -literal -offset indent +nonsense -t bingo.html.template +.Ed +.Pp +For a listing of absurd college classes +.Pq these might be offensive to liberal-arts professors : +.Bd -literal -offset indent +nonsense -f college.data -n 20 +.Ed +.Pp +For a listing of political organizations +.Pq again, these might be offensive to certain people : +.Bd -literal -offset indent +nonsense OrgPolitical -n 10 +.Ed +.Pp +For a listing of stupid laws that may or may not really exist: +.Bd -literal -offset indent +nonsense -f stupidlaws.data -n 10 +.Ed +.Pp +For a list of Open Source programs as they would appear on Freshmeat: +.Bd -literal -offset indent +nonsense -f linux.data FreshmeatApp +.Ed +.Pp +For the resume of a random geek +.Pq in HTML : +.Bd -literal -offset indent +nonsense -f resume.data -t resume.html.template +.Ed +.Pp +For a news headline: +.Bd -literal -offset indent +nonsense -f newspaper.data Headline +.Ed +.Pp +For the front page of a newspaper +.Pq in HTML : +.Bd -literal -offset indent +nonsense -f newspaper.data -t newspaper.html.template +.Ed +.Pp +For a cheap replacement for the +.Xr fortune 6 +program: +.Bd -literal -offset indent +nonsense -F Fortune +.Ed +.Pp +To produce a file containing 100 items suitable for feeding to +.Xr fortune 6 : +.Bd -literal -offset indent +nonsense -F FortuneFile -n 100 +.Ed +.Sh FILE FORMATS +.Nm Nonsense +reads in +.Dq template files +and +.Dq data files . +.Pp +A template file is merely a text file containing +.Dq tags +enclosed in curly braces +.Po +.Sq { +and +.Sq } +.Pc . +.Nm Nonsense +substitutes random text for these +tags using a really crude markup language. +.Pp +A data file is a text file divided into sections +.Pq seperated by a blank line , +each one containing a list of text items +.Pq seperated by a newline +that are randomly selected to fill in the template. +.Pp +There are a few special cases that allow +.Nm +to handle more elaborate situations: +.Bl -tag -width 6n +.It {#number1-number2} +This tag will be replaced with a random number between +.Ar number1 +and +.Ar number2 +.Pq inclusive . +.It {[item1|item2|item3...} +This tag will be replaced with one item from the list. +If only one item is listed then it will be output %50 of the time +.Pq and nothing output the other 50% . +.It {@strftime format} +This tag will be replaced with the current date/time using the +.Xr strftime 3 +format string. +So, for instance, +{@A} +would be replaced with the current day of the week. +.It {@strftime format|number1|number2} +Same as above, but uses the date/time that occured X seconds ago, +where X is a random number between +.Ar number1 +and +.Ar number2 . +For instance, +{@%H:%M|0|86400} +would be replaced by the hour:minute anywhere from 0 to 86400 seconds +.Pq 1 day +ago. +.It {;short perl code segment} +The perl code within the braces will be evaluated. +This is useful for doing something really +complicated that requires the full power of Perl. +However, this is risky since there's no error checking and no +.Dq sandbox . +You can disable this behavior with the +.Fl e +option. +.It {\echaracter} +This allows literal characters that couldn't otherwise be specified, +such as: +.Bl -tag -width "{\e###}" -compact -offset indent +.It {\en} +newline +.It {\e0} +null +.Pq i.e. nothing +.It {\eL} +Left brace +.Pq Sq { +.It {\eR} +Right brace +.Pq Sq } +.It {\e###} +.Xr ascii 7 +character in decimal +.El +.It {variablename=literal text} +Stores the text on the right-hand side of the equals sign to +the specified state variable, without outputting anything. +This is useful for preserving context and is +used, for example, in the Slashdot simulator. +.It {variablename:=command} +Similar to above, but evaluates the command +and stores the result into a state variable. +.It {$variablename} +Returns the contents of a state variable. +.It {command#number1-number2} +Evaluates the command a random number of times between +.Ar number1 +and +.Ar number2 . +.El +.Pp +Case is important! +{ProductName}, {productname} and {PRODUCTNAME} are slightly different. +If the name is given in lowercase, the +substitution will be converted to all lowercase +.Pq i.e. fed through the perl lc function . +.Pp +Upercase names specify the opposite; the result is uppercoased with uc. +Mixed case names tell +.Nm +to leave the case of the result alone +.Pq this is usually what is used . +Finally, if you prepend a name with a caret, +.Sq ^ +.Pq i.e. {^ProductName} , +the result is fed through the perl ucfirst function, which will +capitalize the first character only. +.Sh SEE ALSO +.Xr fortune 6 +.Pp +http://i-want-a-website.com/about-linux/downloads.shtml +.Sh AUTHORS +The +.Nm +program is written by +.An -nosplit +.An James Baughn Aq nonsense@i-want-a-website.com . +.Pp +.An Fred Hirsch Aq truehand@darkhart.com +and +.An Peter Suschlik Aq peter@zilium.de +have both submitted code. +.Pp +Send suggestions, comments, feedback, patches, and new +datafiles/templates to the above address. +Direct your hate mail and flames to +.Aq devnull@i-want-a-website.com . +.Pp +This manual page was written by +.An Dave Chapeskie Aq dchapes@ddm.crosswinds.net +from the +.Pa README +file. +.Pp +Copyright 2000-2001. +This program and accompanying files are licensed +under the GNU General Public License 2.0. +.Sh BUGS +The +.Fl e +option is not the default. diff --git a/games/nonsense/pkg-descr b/games/nonsense/pkg-descr index 8aa00a97ff30..a169619c424a 100644 --- a/games/nonsense/pkg-descr +++ b/games/nonsense/pkg-descr @@ -7,4 +7,4 @@ clean up after them. From fake Slashdot headlines to absurd college courses to buzzword bingo cards, Nonsense is a good way to waste time. Author: James Bughn <nonsense@i-want-a-website.com> -WWW: http://i-want-a-website.com/about-linux/downloads.shtml +WWW: http://nonsense.sourceforge.net/ diff --git a/games/nonsense/pkg-plist b/games/nonsense/pkg-plist index 19d1b5bf028e..0f857f386464 100644 --- a/games/nonsense/pkg-plist +++ b/games/nonsense/pkg-plist @@ -1,23 +1,30 @@ bin/nonsense +%%PORTDOCS%%share/doc/nonsense/README +%%PORTDOCS%%@dirrm share/doc/nonsense share/nonsense/data/college.data share/nonsense/data/cookie.data share/nonsense/data/default.data +share/nonsense/data/humorix.data share/nonsense/data/insults.data share/nonsense/data/linux.data share/nonsense/data/mission.data share/nonsense/data/newspaper.data +share/nonsense/data/poetry.data share/nonsense/data/ratherism.data share/nonsense/data/resume.data share/nonsense/data/shows.data share/nonsense/data/slashdot.data share/nonsense/data/stupidlaws.data +share/nonsense/data/techdirt.data share/nonsense/template/bingo.html.template share/nonsense/template/bizplan.html.template share/nonsense/template/freshmeat.rdf.template +share/nonsense/template/humorix.html.template share/nonsense/template/newspaper.html.template share/nonsense/template/resume.html.template share/nonsense/template/slashdot.html.template share/nonsense/template/slashdot.rdf.template +share/nonsense/template/techdirt.html.template @dirrm share/nonsense/data @dirrm share/nonsense/template @dirrm share/nonsense |