From c23b9f766513041c36b6832975295c00b96878e1 Mon Sep 17 00:00:00 2001 From: short <> Date: Fri, 10 Oct 2003 06:53:34 +0000 Subject: [PATCH] +middleman --- configure.ac | 1 + project/Index.html.pl | 111 +++++++++++---------------------- project/List.html.pl | 132 ++++++++++++++++++++++++++++++++++++++++ project/Makefile.am | 6 +- project/Platform.pm | 39 ++++++++++++ project/fixhtml/ListItem.pm | 1 + project/middleman/Index.html.pl | 39 ++++++++++++ project/middleman/ListItem.pm | 49 +++++++++++++++ project/middleman/Makefile.am | 23 +++++++ project/pipebuf/ListItem.pm | 2 +- 10 files changed, 324 insertions(+), 79 deletions(-) create mode 100755 project/List.html.pl create mode 100755 project/Platform.pm create mode 100755 project/middleman/Index.html.pl create mode 100755 project/middleman/ListItem.pm create mode 100644 project/middleman/Makefile.am diff --git a/configure.ac b/configure.ac index 9ddcc7a..f3625c8 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,7 @@ Makefile ./project/ResRAM/Makefile ./project/ssht/Makefile ./project/postget/Makefile +./project/middleman/Makefile ]) echo done. diff --git a/project/Index.html.pl b/project/Index.html.pl index 8b67c4b..eb645d8 100755 --- a/project/Index.html.pl +++ b/project/Index.html.pl @@ -29,6 +29,7 @@ BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/, use My::Web; require CGI; Wrequire 'My::Project'; +Wrequire 'project::Platform'; My::Web->init( @@ -39,20 +40,25 @@ My::Web->heading(); my $CGI=CGI->new(); -print <<'HERE'; -

Project List of Jan Kratochvil

+print <<"HERE"; +

Project List of @{[ a_href 'http://www.jankratochvil.net/','Jan Kratochvil' ]}

-

- - -

+ HERE +print ''."\n"; + my @platforms=@project::Platform::platforms; + while (@platforms) { + my $platform_sym =shift @platforms; + my $platform_name=shift @platforms; + print '\n"; + } +print '
'.a_href('#'.$platform_sym,$platform_name)."
'."\n"; +print vskip "1ex"; + my %item=( My::Project::item_hash_read() ); # $col{"name"}{"show"}=1 @@ -71,72 +77,25 @@ $col{"name"}{"format"}=sub { return "".$_[0].""; }; -$col{"license"}{"format"}=sub { - my %known=( - "PD"=>"PD", - "GPL"=>"GPL", - "LGPL"=>"LGPL", - ); - return $known{$_[0]} if $known{$_[0]}; - return $_[0]; - }; - -$col{"maintenance"}{"format"}=sub { - return ($_[0]=~/^([^-]*)/)[0]; - }; - -$col{"online-demo"}{"format"}=\&format_url; -$col{"download"}{"format"}=\&format_url; -$col{"name"}{""}="Project Name"; -$col{"summary"}{""}="Abstract"; -$col{"license"}{""}="Copying"; -$col{"maintenance"}{""}="State"; -$col{"language"}{""}="Language"; - -# Fill in cols not contained in @col_order -if (0) { - my %col_order=map(($_=>1),@col_order); - push @col_order,map({ ($col_order{$_} ? () : $_); } keys(%{{ map(($_=>1),map((keys(%{$item{$_}})),keys(%item)))}})); +@platforms=@project::Platform::platforms; +while (@platforms) { + my $platform_sym =shift @platforms; + my $platform_name=shift @platforms; + print ''; + print "

$platform_name

"; + print '
'."\n"; + my @projects=sort { + ($item{$b}{"priority"} <=> $item{$a}{"priority"}) + or + (lc($item{$a}{"name"}) cmp lc($item{$b}{"name"})); + } map({ $item{$_}{"platform"} ne $platform_sym ? () : ($_); } keys(%item)); + for my $project (@projects) { + print "

".a_href("$project/",$item{$project}{"name"}.": ".$item{$project}{"summary"})."

\n"; + print "
\n"; + print $item{$project}{"description"}; + print "
\n"; + } } -print ''."\n"; - print ''; - for my $col (@col_order) { - next if defined $col{$col}{"show"} && !$col{$col}{"show"}; - print ''; - } - print ''."\n"; - my @rows_ordered=sort { - for my $order_by (@row_order,"name") { - my $order_by=$order_by; - my $minus=($order_by=~s/^(-)//)[0]; - my $r=($item{$a}{$order_by} cmp $item{$b}{$order_by}); - $r=-$r if $minus; - return $r if $r; - } - return 0; - } keys(%item); - for my $row (@rows_ordered) { - print ''; - for my $col (@col_order) { - next if defined $col{$col}{"show"} && !$col{$col}{"show"}; - print ''; - } - print ''."\n"; - if ($CGI->param("description_opt")) { - print ''; - print ''; - print ''."\n"; - print ''."\n"; - } - } -print '
'.($col{$col}{""} || "[$col]").'
'; - if (!$col{$col}{"format"}) { - print(($item{$row}{$col} || "")); - } - else { - print(&{$col{$col}{"format"}}($item{$row}{$col},$row)); - } - print '
'.$item{$row}{"description"}.'
 
'."\n"; My::Web->footer(); diff --git a/project/List.html.pl b/project/List.html.pl new file mode 100755 index 0000000..06dd078 --- /dev/null +++ b/project/List.html.pl @@ -0,0 +1,132 @@ +#! /usr/bin/perl +# +# $Id$ +# List of projects Perl template. +# Copyright (C) 2003 Jan Kratochvil +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; exactly version 2 of June 1991 is required +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +package project::List; +require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway +our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; +our $CVS_ID=q$Id$; +use strict; +use warnings; + +BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } +use My::Web; +require CGI; +Wrequire 'My::Project'; + + +My::Web->init( + "__PACKAGE__"=>__PACKAGE__, + "title"=>'Project List', + ); +My::Web->heading(); + +my $CGI=CGI->new(); + +print <<"HERE"; +

@{[ a_href './','Project List' ]} of @{[ a_href 'http://www.jankratochvil.net/','Jan Kratochvil' ]}

+HERE + +my %item=( My::Project::item_hash_read() ); + +# $col{"name"}{"show"}=1 +# $col{"name"}{"format"}=sub { "<".$_[0].">"; } +# $col{"name"}{""}="Project name"; +# @col_order + +my @row_order=qw(-priority); +my @col_order=qw(name summary license maintenance language); +my %col; + +sub format_url ($) { return (!$_[0] ? "" : 'X'); } + +$col{"name"}{"format"}=sub { + $_[0]=~s#]*>([^<]*)#$1#g; + return "".$_[0].""; + }; + +$col{"license"}{"format"}=sub { + my %known=( + "PD"=>"PD", + "GPL"=>"GPL", + "LGPL"=>"LGPL", + ); + return $known{$_[0]} if $known{$_[0]}; + return $_[0]; + }; + +$col{"maintenance"}{"format"}=sub { + return ($_[0]=~/^([^-]*)/)[0]; + }; + +$col{"online-demo"}{"format"}=\&format_url; +$col{"download"}{"format"}=\&format_url; +$col{"name"}{""}="Project Name"; +$col{"summary"}{""}="Abstract"; +$col{"license"}{""}="Copying"; +$col{"maintenance"}{""}="State"; +$col{"language"}{""}="Language"; + +# Fill in cols not contained in @col_order +if (0) { + my %col_order=map(($_=>1),@col_order); + push @col_order,map({ ($col_order{$_} ? () : $_); } keys(%{{ map(($_=>1),map((keys(%{$item{$_}})),keys(%item)))}})); + } + +print ''."\n"; + print ''; + for my $col (@col_order) { + next if defined $col{$col}{"show"} && !$col{$col}{"show"}; + print ''; + } + print ''."\n"; + my @rows_ordered=sort { + for my $order_by (@row_order,"name") { + my $order_by=$order_by; + my $minus=($order_by=~s/^(-)//)[0]; + my $r=($item{$a}{$order_by} cmp $item{$b}{$order_by}); + $r=-$r if $minus; + return $r if $r; + } + return 0; + } keys(%item); + for my $row (@rows_ordered) { + print ''; + for my $col (@col_order) { + next if defined $col{$col}{"show"} && !$col{$col}{"show"}; + print ''; + } + print ''."\n"; + if ($CGI->param("description_opt")) { + print ''; + print ''; + print ''."\n"; + print ''."\n"; + } + } +print '
'.($col{$col}{""} || "[$col]").'
'; + if (!$col{$col}{"format"}) { + print(($item{$row}{$col} || "")); + } + else { + print(&{$col{$col}{"format"}}($item{$row}{$col},$row)); + } + print '
'.$item{$row}{"description"}.'
 
'."\n"; + +My::Web->footer(); diff --git a/project/Makefile.am b/project/Makefile.am index 4114ca9..db59b94 100644 --- a/project/Makefile.am +++ b/project/Makefile.am @@ -72,9 +72,11 @@ SUBDIRS= \ SClock \ ResRAM \ ssht \ - postget + postget \ + middleman EXTRA_DIST+= \ Index.html.pl \ ChangeLog.txt.pl \ - Pod2Html.html.pl + Pod2Html.html.pl \ + List.html.pl diff --git a/project/Platform.pm b/project/Platform.pm new file mode 100755 index 0000000..4606f74 --- /dev/null +++ b/project/Platform.pm @@ -0,0 +1,39 @@ +#! /usr/bin/perl +# +# $Id$ +# Definition of 'project::Platform' +# Copyright (C) 2003 Jan Kratochvil +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; exactly version 2 of June 1991 is required +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +package project::Platform; +require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway +our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; +our $CVS_ID=q$Id$; +use strict; +use warnings; + + +our @platforms=( + "unixuser"=>"GNU/Linux", + "unixdevel"=>"GNU/Linux Development", + "web"=>"Web", + "amiga"=>"Amiga", + "w32"=>"MS-Windows", + "dos"=>"MS-DOS", + "patch"=>"Patches", + ); + +1; diff --git a/project/fixhtml/ListItem.pm b/project/fixhtml/ListItem.pm index 1f33c73..5107512 100755 --- a/project/fixhtml/ListItem.pm +++ b/project/fixhtml/ListItem.pm @@ -31,6 +31,7 @@ use My::Web; our @ListItem=( "name"=>"fixhtml", "platform"=>"unixuser", + "trivia"=>1, "priority"=>3, "download"=>"fixhtml.pl", "summary"=>"Convert HTML files URLs to relative", diff --git a/project/middleman/Index.html.pl b/project/middleman/Index.html.pl new file mode 100755 index 0000000..e73a31a --- /dev/null +++ b/project/middleman/Index.html.pl @@ -0,0 +1,39 @@ +#! /usr/bin/perl +# +# $Id$ +# Main page of 'My::Project::middleman' +# Copyright (C) 2003 Jan Kratochvil +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; exactly version 2 of June 1991 is required +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +package project::middleman::Index; +require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway +our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; +our $CVS_ID=q$Id$; +use strict; +use warnings; + +BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } +use My::Web; +Wuse 'My::Project'; +Wuse 'project::middleman::ListItem'; + + +My::Project->init_project( + "__PACKAGE__"=>__PACKAGE__, + "ListItem"=>\@project::middleman::ListItem::ListItem, + ); + +My::Web->footer(); diff --git a/project/middleman/ListItem.pm b/project/middleman/ListItem.pm new file mode 100755 index 0000000..7f933a5 --- /dev/null +++ b/project/middleman/ListItem.pm @@ -0,0 +1,49 @@ +#! /usr/bin/perl +# +# $Id$ +# Definition of 'My::Project::middleman' for list.cgi.pl +# Copyright (C) 2003 Jan Kratochvil +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; exactly version 2 of June 1991 is required +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +package project::middleman::ListItem; +require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway +our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; +our $CVS_ID=q$Id$; +use strict; +use warnings; + +use My::Web; + + +our @ListItem=( + "name"=>a_href('http://middle-man.sourceforge.net/','Middleman').' port', + "platform"=>"unixuser", + "priority"=>3, + "cvs"=>"middleman:lace", + "summary"=>'HTTP proxy ported to ' + .a_href('http://www.freebsd.org/','FreeBSD'), + "license"=>"PD", + "maintenance"=>"ready", + "sponsorship"=>a_href('http://www.jklabs.cz/','JKLabs'), + "language"=>"C patch", + "description"=><<"HERE", +HTTP proxy server @{[ a_href 'http://middle-man.sourceforge.net/','Middleman' ]} +capable of returned data mangling has been ported to +@{[ a_href 'http://www.freebsd.org/','FreeBSD' ]}. +HERE + ); + +1; diff --git a/project/middleman/Makefile.am b/project/middleman/Makefile.am new file mode 100644 index 0000000..152d864 --- /dev/null +++ b/project/middleman/Makefile.am @@ -0,0 +1,23 @@ +# $Id$ +# automake source for the Makefile of project/middleman/ subdir +# Copyright (C) 2003 Jan Kratochvil +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; exactly version 2 of June 1991 is required +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +include $(top_srcdir)/Makefile-head.am + +EXTRA_DIST+= \ + ListItem.pm \ + Index.html.pl diff --git a/project/pipebuf/ListItem.pm b/project/pipebuf/ListItem.pm index ddf6ba4..c7922f3 100755 --- a/project/pipebuf/ListItem.pm +++ b/project/pipebuf/ListItem.pm @@ -44,7 +44,7 @@ its cache and also in the same time writes as fast as possible to the output. In it is implemented as two processes (no threads - no pthread libraries needed, only IPC communication used). Features custom buffer sizes, prefill (start writing of the first byte only after the WHOLE buffer has beel filled up) and warning messages when buffer is getting -emptied.

' +emptied.

HERE ); -- 1.8.3.1