summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2000-12-15 16:56:11 +0000
committerroam <roam@FreeBSD.org>2000-12-15 16:56:11 +0000
commit17b07328775834a82aa27e4ba938618394a9db40 (patch)
treebcd9b0d64fc5b121a3d0209910818ef01e3641ab /games
parent1e7964ecff5228ce6678b4de426b22129b0b104d (diff)
downloadFreeBSD-ports-17b07328775834a82aa27e4ba938618394a9db40.zip
FreeBSD-ports-17b07328775834a82aa27e4ba938618394a9db40.tar.gz
nonsense is a nonsense, but funny-sounding, text generator.
Diffstat (limited to 'games')
-rw-r--r--games/Makefile1
-rw-r--r--games/nonsense/Makefile27
-rw-r--r--games/nonsense/distinfo1
-rw-r--r--games/nonsense/files/patch-aa65
-rw-r--r--games/nonsense/pkg-comment1
-rw-r--r--games/nonsense/pkg-descr10
-rw-r--r--games/nonsense/pkg-plist23
7 files changed, 128 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index 39ec2e7..41c2001 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -177,6 +177,7 @@
SUBDIR += trojka
SUBDIR += tvp
SUBDIR += nil
+ SUBDIR += nonsense
SUBDIR += omega
SUBDIR += uox3
SUBDIR += wmeyes
diff --git a/games/nonsense/Makefile b/games/nonsense/Makefile
new file mode 100644
index 0000000..6a107e0
--- /dev/null
+++ b/games/nonsense/Makefile
@@ -0,0 +1,27 @@
+# New ports collection makefile for: nonsense
+# Date created: 15 December 2000
+# Whom: roam@FreeBSD.org
+#
+# $FreeBSD$
+#
+
+PORTNAME= nonsense
+PORTVERSION= 0.4
+CATEGORIES= games
+MASTER_SITES= http://i-want-a-website.com/about-linux/
+
+MAINTAINER= roam@FreeBSD.org
+
+NO_BUILD= defined
+
+post-configure:
+ ${PERL} -pi -e "s,/usr/local,${PREFIX}," ${WRKSRC}/nonsense
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/nonsense ${PREFIX}/bin
+ ${MKDIR} ${PREFIX}/share/nonsense/data
+ ${MKDIR} ${PREFIX}/share/nonsense/template
+ ${INSTALL_DATA} ${WRKSRC}/*.data ${PREFIX}/share/nonsense/data
+ ${INSTALL_DATA} ${WRKSRC}/*.template ${PREFIX}/share/nonsense/template
+
+.include <bsd.port.mk>
diff --git a/games/nonsense/distinfo b/games/nonsense/distinfo
new file mode 100644
index 0000000..4572d3f
--- /dev/null
+++ b/games/nonsense/distinfo
@@ -0,0 +1 @@
+MD5 (nonsense-0.4.tar.gz) = 4913fd46d6b93a62eb26cf96586721b8
diff --git a/games/nonsense/files/patch-aa b/games/nonsense/files/patch-aa
new file mode 100644
index 0000000..6b5d2d5
--- /dev/null
+++ b/games/nonsense/files/patch-aa
@@ -0,0 +1,65 @@
+--- nonsense 2000/12/15 13:26:57 1.1.1.3
++++ nonsense 2000/12/15 13:54:30 1.6
+@@ -40,6 +40,10 @@
+ use POSIX qw( strftime ); # Just in case somebody needs the date
+ use CGI;
+
++my $PREFIX = "/usr/local";
++my $datadir = "$PREFIX/share/nonsense/data";
++my $templatedir = "$PREFIX/share/nonsense/template";
++
+ my %pool; # Where the datafiles are slurped into
+ my %static; # Hash of persistent data (to maintain state)
+
+@@ -328,7 +332,8 @@
+ sub LoadDataFile {
+ my $file = shift;
+ $file = SafeFile( $file ) if $cgi_mode;
+- open IN, $file or die "Error opening $file... $!\n";
++ open IN, $file or open IN, "$datadir/$file"
++ or die "Error opening $file... $!\n";
+ local $/ = '';
+
+ SECTION: while( <IN> ) {
+@@ -344,7 +349,8 @@
+ my $file = shift;
+ my $m = '';
+ $file = SafeFile( $file ) if $cgi_mode;
+- open IN, $file or die "Error opening $file template... $!\n";
++ open IN, $file or open IN, "$templatedir/$file"
++ or die "Error opening $file template... $!\n";
+ local $/; undef $/; my $t = <IN>;
+ close IN;
+ if( $t =~ /__BEGIN__/ ) { # Check for a header
+@@ -356,15 +362,29 @@
+ ### Remove special characters from a filename to prevent maliciousness
+ sub SafeFile {
+ my( $file ) = shift;
+- $file =~ s/([|<>])//g;
++ $file =~ s/([|<>\0]|\.\.\/)//g;
+ warn("[" . localtime() . "] [warning] [client $ENV{REMOTE_ADDR}] Attempt to override filename safety feature!") if $1;
+ return $file;
+ }
+
++sub ListUniq {
++ my ($v, $last) = (undef, undef);
++ my @l = ();
++
++ foreach $v (@_) {
++ push (@l, $v) if (defined($last) && ($v ne $last));
++ $last = $v;
++ }
++ return @l;
++}
++
+ ### Return all of the datafiles in the current directory
+ sub GlobCurrentDirectory {
+ opendir(DIR, ".");
+ my @datafiles = grep { /\.data$/ } readdir(DIR);
++ closedir(DIR);
++ opendir(DIR, "$datadir");
++ push(@datafiles, grep { /\.data$/ } readdir(DIR));
+ closedir(DIR);
+- return @datafiles;
++ return ListUniq(sort @datafiles);
+ }
diff --git a/games/nonsense/pkg-comment b/games/nonsense/pkg-comment
new file mode 100644
index 0000000..808dc0f
--- /dev/null
+++ b/games/nonsense/pkg-comment
@@ -0,0 +1 @@
+A nonsense text generator
diff --git a/games/nonsense/pkg-descr b/games/nonsense/pkg-descr
new file mode 100644
index 0000000..8aa00a9
--- /dev/null
+++ b/games/nonsense/pkg-descr
@@ -0,0 +1,10 @@
+From the nonsense README:
+
+Nonsense generates random (and sometimes 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, 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
diff --git a/games/nonsense/pkg-plist b/games/nonsense/pkg-plist
new file mode 100644
index 0000000..19d1b5b
--- /dev/null
+++ b/games/nonsense/pkg-plist
@@ -0,0 +1,23 @@
+bin/nonsense
+share/nonsense/data/college.data
+share/nonsense/data/cookie.data
+share/nonsense/data/default.data
+share/nonsense/data/insults.data
+share/nonsense/data/linux.data
+share/nonsense/data/mission.data
+share/nonsense/data/newspaper.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/template/bingo.html.template
+share/nonsense/template/bizplan.html.template
+share/nonsense/template/freshmeat.rdf.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
+@dirrm share/nonsense/data
+@dirrm share/nonsense/template
+@dirrm share/nonsense
OpenPOWER on IntegriCloud