#! /usr/bin/perl
# 
# $Id$
# CVS page of 'My::Project::captive'
# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
# 
# 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::captive::CVS;
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/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
use My::Web;
Wuse 'My::Project';
Wuse 'project::captive::ListItem';


my $W=My::Project->init_project(
		"__PACKAGE__"=>__PACKAGE__,
		"ListItem"=>\@project::captive::ListItem::ListItem,
		"before_project_data"=>
				'<h2 align="center">'.a_href('./','Captive Main Page').'</h2>'."\n",
		);


print <<"HERE";
<h2>CVS Checkout Instructions</h2>
<pre>
cvs -d :pserver:pserver@{[ '@' ]}cvs.jankratochvil.net:/cvs login
	Just hit ENTER (empty password)
cvs -d :pserver:pserver@{[ '@' ]}cvs.jankratochvil.net:/cvs -z3 checkout captive
cd captive
cvs -d :pserver:pserver@{[ '@' ]}cvs.jankratochvil.net:/cvs -z3 checkout -r captive -kk reactos
./autogen.pl
make
./src/client/cmdline/captive-cmdline --load-module=/var/lib/captive/ntoskrnl.exe --filesystem=/var/lib/captive/ntfs.sys --disk --blind /dev/hda1
</pre>

@{[ vskip "3ex" ]}

<h2>Download</h2>

<table border="1" align="center" style="text-align: center;" width="100%"><tr><th>Distribution</th>
		<th>Installation Case #1<br />Filesystem and installer<br />(recommended)</th>
		<th>Installation Case #2<br />Manual installation<br />(filesystem, expert user)</th>
		<th>Installation Case #3<br />Command-line client<br />(no filesystem access)</th></tr>
HERE
my %pkg=(
		1=>[qw(captive captive-lufs captive-install lufs gnome-vfs-httpcaptive ntfsprogs ntfsprogs-gnomevfs)],
		2=>[qw(captive captive-lufs                 lufs)],
		3=>[qw(captive)],
		);
my %version=(
		map(($_=>["1.1.5","0"]),qw(captive captive-lufs captive-install)),
		"lufs"=>["0.9.7","1captive8"],
		"gnome-vfs-httpcaptive"=>["2.3.8captive2","0"],
		"ntfsprogs"=>["200309071734","1captive1"],
		"ntfsprogs-gnomevfs"=>["1.0.2","0"],
		"build-captive-static"=>"2003-12-14-00",
		);
my %has_devel=(map(($_=>1),qw(
		ntfsprogs
		)));
my %pkg_nosrc=(map(($_=>1),qw(
		captive-lufs
		captive-install
		ntfsprogs
		ntfsprogs-gnomevfs
		)));

my $case;
my $a_href_arch=sub ($$%)
{
my($file_base,$text,%args)=@_;

	$text=~s/[._]\D.*$// if $case!=1 && $text!~/^[.]/;
	return a_href $file_base,$text,"size"=>($case==1),%args;
};

my $ntfsprogs_after=sub ($) {
	my($format)=@_;
		return () if $case!=1;
		return '<hr width="80%" />requirement: '
				.a_href('http://linux-ntfs.sourceforge.net/downloads.html#downloads','ntfsprogs')
				.' '.$format.' &ge; 1.8.0';
	};

my @dist=(
		{
			"name"=>"Sources (.tar.gz)",
			"id"=>"source",
			"out"=>sub {
				my($pkg,$version_base,$version_ext)=@_;
					return () if $pkg_nosrc{$pkg};
					$version_ext=~s/^\d+//;
					my $file="$pkg-$version_base".($version_ext=~/^\d+$/ ? "" : $version_ext).".tar.gz";
					return $file,$file;
				},
			"after"=>sub { return &{$ntfsprogs_after}(".tar.gz"); },
			},
		);

for my $dist (@dist) {
	print "<a name=".$dist->{"id"}."><tr>";
		print "<td>".$dist->{"name"}."</td>";
		for my $casel (1,2,3) {
			$case=$casel;
			print "<td>";
			print join("<br />",map({ my $pkg=$_;
				my($file,$text)=&{$dist->{"out"}}($pkg,@{$version{$pkg}});
				(!defined $text ? ($file) || () : (&$a_href_arch("dist/$file",$text)));
				} @{$pkg{$case}}),map({ (!$_ ? () : (&{$_}())); } $dist->{"after"}));
			print "</td>";
			}
	print "</tr></a>\n";
	}
print <<"HERE";
	<tr>
		<td>'captive-static' build<br />system patches for Red Hat 9 Shrike<br />(never needed for a&nbsp;regular build)</td>
		<td colspan="3">
HERE
my $build_static_basename=(map("$_-".$version{$_}.".tar.gz","build-captive-static"))[0];
print a_href "dist/$build_static_basename",$build_static_basename;
print <<"HERE";
		</td>
	</tr>
</table>

@{[ vskip "3ex" ]}


<h2>Pending Integrations</h2>

<dl>
	<dt>@{[ a_href $W->{"project_viewcvs"}.'/lufs/','lufs-captive' ]}
			[@{[ a_href $W->{"project_viewcvs"}.'/*checkout*/lufs/NEWS.captive?rev=1.1.2.11','NEWS' ]}]
	<dd>
		<p>@{[ a_href 'http://lufs.sourceforge.net/lufs/','LUFS' ]} still has not yet integrated
				the Captive-developed patches. No integration schedule is currently known.</p>
		<ul>
			<li>Linux kernel module has implemented support for statfs(2)/df(1)</li>
			<li>Many fixes of the userland lufsd(8) daemon</li>
			<li>Scripts for unattended Linux kernel module prebuilds/compilation/installation</li>
		</ul>
	</dd>
	<dt>@{[ a_href $W->{"project_viewcvs"}.'/gnome-vfs-httpcaptive/?only_with_tag=captive','gnome-vfs-httpcaptive' ]}</dt>
	<dd>
		<p>seek() function support for http:// handler was submitted as Gnome BugZilla
				@{[ a_href 'http://bugzilla.gnome.org/show_bug.cgi?id=121194','Bug # 121194' ]}.
				Bug is currently pending.</p>
	</dd>
</dl>


<h1>@{[ a_href './','Back to Captive Main Page' ]}</h1>

HERE


My::Web->footer();
