head	1.6;
access;
symbols
	JA_WWW_1_0:1.1.1.1
	doc-jp:1.1.1;
locks; strict;
comment	@# @;


1.6
date	98.08.04.17.23.58;	author wosch;	state dead;
branches;
next	1.5;

1.5
date	98.04.25.16.41.06;	author kuriyama;	state Exp;
branches;
next	1.4;

1.4
date	98.02.12.02.32.52;	author hanai;	state Exp;
branches;
next	1.3;

1.3
date	97.12.26.17.05.23;	author max;	state Exp;
branches;
next	1.2;

1.2
date	97.12.07.15.44.08;	author max;	state Exp;
branches;
next	1.1;

1.1
date	97.11.23.22.23.06;	author max;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	97.11.23.22.23.06;	author max;	state Exp;
branches;
next	;


desc
@@


1.6
log
@The  repository copy www/data  -> www/en is done.
@
text
@#!/usr/bin/perl

# convert a ports INDEX file to HTML
#
# by John Fieber <jfieber@@freebsd.org>
# Mon May 13 10:31:58 EST 1996
# $Id: portindex,v 1.5 1998/04/25 16:41:06 kuriyama Exp $
# The FreeBSD Japanese Documentation Project
# Original revision: 1.12

############################################################

# This is the base of where we ftp stuff from
$base = "ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current";
$baseHTTP = "http://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current";
$urlcgi = 'http://www.freebsd.org/cgi/url.cgi';

# better layout and link to the sources
if ($urlcgi) {
    $baseHTTP = $urlcgi . '?' . $baseHTTP;
}
 
$today = &getdate;

&main;

sub getdate {
#    @@months = ("January", "February", "March", "April", "May","June",
#	       "July", "August", "September", "October", "November", "December");
    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
    $year += 1900;
#    return "Updated $months[$mon] $mday, $year";
    $mon++;
    return "$year ǯ $mon  $mday ˹ޤ.";
}

sub header {
    local ($fh, $htext) = @@_;
    print $fh "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2//EN\" [\n";
    print $fh "<!ENTITY base CDATA '..'>";
    print $fh "<!ENTITY date  \"<em>$today</em>\">\n";
    print $fh "<!ENTITY title '$htext'>";
    print $fh "<!ENTITY blurb  SYSTEM \"ports.inc\">\n";
    print $fh "<!ENTITY % includes SYSTEM \"../includes.sgml\">\n";
    print $fh "%includes;\n";
    print $fh "]>\n";
    print $fh "<html>&header;\n";
}

sub footer {
    local ($fh, $ftext) = @@_;
    print $fh "\n$ftext\n";
    print $fh "&footer;\n";
    print $fh "</BODY>\n</HTML>\n";
}

sub main {

    $sep = "<B>:</B>";

    # 'category' translation database
    if (open(CATF, "categories.ja_JP.EUC")) {
	while (<CATF>) {
	    ($a, $b) = split('\|');
	    next if !defined($b);
	    chop($b);
	    $catsLANG{$a} = $b;
	}
    }
    # 'COMMENT' translation database
    if (open(COMF, "comments.ja")) {
	while (<COMF>) {
	    ($a, $b) = split('\|');
	    next if !defined($b);
	    chop($b);
	    $b =~ s/&/&amp;/g;
	    $b =~ s/</&lt;/g;
	    $b =~ s/>/&gt;/g;
	    $descLANG{$a} = $b;
	}
    }

    while (<>) {
	chop;
	s/&/&amp;/g;
    	s/</&lt;/g;
    	s/>/&gt;/g;

    	# Read a record
	($name, $loc, $prefix, $desc, $ldesc, $owner, $cats, 
	    $keys, $bdep, $rdep) = split('\|');

	# Check for double hyphens in the name (--).
	$name =~ s/--/-/g;

    	# Split the categories into an array
	@@cat = split("[ \t]+", $cats);

    	$catkey{$name} = $cat[0];

	# desc translation
	($lloc = $loc) =~ s@@^/usr/ports/@@@@;
	$desc = $descLANG{$lloc}
	    if ($descLANG{$lloc} ne '');

	foreach $i (@@cat) {

	    $stats{$i}++;

    	    # figure out the FTP url
	    $loc =~ s/\/usr/$base/;
	    $ldesc =~ s/\/usr/$baseHTTP/;

    	    # The name description and maintainer
	    $data{$i} .= "<DT><B><A NAME=\"$name\"></A><A HREF=\"$loc.tar\">$name</A></B> ";
	    $data{$i} .= "<DD>$desc<BR><I><A HREF=\"$ldesc\">ܤ</A></I>";
    	    $ownerurl = $owner;
    	    $ownerurl =~ s/&lt;/</g;
    	    $owenrurl =~ s/&gt;/>/g;
	    $data{$i} .= 
		"<BR><I>ݼô:</I> <A HREF=\"mailto:$ownerurl\">$owner</A>";

    	    # If there are any dependencies, list them
    	    if ($bdep ne "" || $rdep ne "") {
    	    	$data{$i} .= "<BR><I>ɬפʤ:</I> ";
    	    	@@dep = split(/ /, "$bdep $rdep");
    	    	foreach $j (@@dep) {
    	    	    $data{$i} .= " <A HREF=\"##$j##.html#$j\">$j</A>,";
    	    	}
    	    	# remove the trailing comma
    	    	chop $data{$i};
    	    }

    	    # If the port is listed in more than one category, throw
    	    # in some cross references
    	    if ($#cat > 0) {
    	    	$data{$i} .= "<BR><EM>ˤޤޤƤޤ:</EM> ";
    	    	foreach $j (@@cat) {
    	    	    if ($j ne $i) {
			if ($j eq $cat[0]) {
			    $data{$i} .= " <STRONG><A HREF=\"$j.html#$name\">\u$j</A></STRONG>,";
			}
			else {
			    $data{$i} .= " <A HREF=\"$j.html#$name\">\u$j</A>,";
			}
    	    	    }
    	    	}
    	    	# remove the trailing comma
    	    	chop($data{$i});
    	    }
    	    $data{$i} .= "<P></P></DD>\n"
	}

    	# Add an entry to the master index
    	$master[$portnumber] = 
    	    "<!-- $name --><STRONG><A HREF=\"$cat[0].html#$name\">$name</A></STRONG> " .
    	    " -- <EM>$desc</EM><BR>\n";
	$portnumber++;
    }

    open(MOUTF, ">index.sgml");

    &header(MOUTF, "FreeBSD Ports");
#    print MOUTF "<!--#include virtual=\"./ports.inc\" -->\n";
    print MOUTF "&blurb;";
    print MOUTF "<hr><P>FreeBSD Ports 쥯ˤ,  $portnumber Ĥ ports 󶡤Ƥޤ. <br> <A HREF=\"$base/ports.tar.gz\">Ƥ $portnumber Ĥ ports  tar ǤޤȤ gzip </A> (褽 4 ᥬХ) ɤ뤫, ʲʬफ餿ɤäƤ:\n";

    print MOUTF "<UL>\n";

    @@foos = sort(keys %stats);
    foreach $key  (@@foos) {
	# For translation
	$subkey = "";
	$subkey = " ($catsLANG{$key})"
	    if ($catsLANG{$key} ne '');
	# For the master file...
	print MOUTF 
	    "<LI><A HREF=\"$key.html\">\u$key$subkey</A> <em>($stats{$key})</em></LI>";

	# Create the category file
	open(OUTF, ">$key.sgml");
	$subkey = "";
	$subkey = " / $catsLANG{$key}"
	    if ($catsLANG{$key} ne '');
	&header(OUTF, "FreeBSD Ports: \u$key$subkey");
	print OUTF "<DL>\n";
	$d = join("\n", sort(split(/\n/, $data{$key})));
    	$d =~ s/##([^#]*)##/$catkey{$1}/g;
	print OUTF $d;
	print OUTF "</DL>\n";
	&footer(OUTF, "<HR><A HREF=\"index.html\">Port ʬ</A>" .
	    " -- <A HREF=\"master-index.html\"></A><HR>");
	close(OUTF);

    }
    print MOUTF "</UL>\n";
    print MOUTF 
    	"<UL><LI><A HREF=\"master-index.html\">$portnumber Ĥ ports Ƥ򥢥ե٥åȽ¤٤</A></LI></UL>\n";
    &footer(MOUTF, "");
    close(MOUTF);

    # Create the master index file
    open(MINDEX, ">master-index.sgml");
    &header(MINDEX, "FreeBSD Ports 쥯 ");
    print MINDEX "<P>\n";
    print MINDEX sort @@master;
    print MINDEX "</P>";
    &footer(MINDEX, "<HR><A HREF=\"index.html\">Port ʬ</A><HR>");
    close(MINDEX);

}
@


1.5
log
@Following changes in the English version are merged.

  includes.sgml:	1.15  --> 1.16
  search.sgml:		1.28  --> 1.29
  support.sgml:		1.48  --> 1.61
  web.atoz:		1.12  --> 1.19
  ports/Makefile:	1.5   --> 1.8
  ports/portindex:	1.11  --> 1.12

Submitted by:	Motoyuki Konno <motoyuki@@snipe.rim.or.jp>
@
text
@d7 1
a7 1
# $Id: portindex,v 1.4 1998/02/12 02:32:52 hanai Exp $
@


1.4
log
@A new file, comments.ja, describes comments of each port.
Fix portindex command to refer comments.ja.
Reviewed by: Motoyuki Konno <motoyuki@@snipe.rim.or.jp>
Submitted by: Jun Kuriyama <kuriyama@@opt.phys.waseda.ac.jp>
@
text
@d7 1
a7 1
# $Id: portindex,v 1.3 1997/12/26 17:05:23 max Exp $
d9 1
a9 1
# Original revision: 1.11
d16 1
d18 5
@


1.3
log
@Display the Japanese category summary on each category submenu.
Submitted by:	kuriyama@@opt.phys.waseda.ac.jp (Jun Kuriyama)
@
text
@d7 1
a7 1
# $Id: portindex,v 1.2 1997/12/07 15:44:08 max Exp $
d59 1
d64 12
d94 5
@


1.2
log
@Add Japanese description of each ports category.
Submitted by:	kuriyama@@opt.phys.waseda.ac.jp (Jun Kuriyama),
		Motoyuki Konno <motoyuki@@snipe.rim.or.jp>
@
text
@d7 1
a7 1
# $Id: portindex,v 1.1.1.1 1997/11/23 22:23:06 max Exp $
d158 4
a161 1
	&header(OUTF, "FreeBSD Ports: \u$key");
@


1.1
log
@Initial revision
@
text
@d7 1
a7 1
# $Id: portindex,v 1.2 1997/10/26 16:29:42 motoyuki Exp $
d55 9
d148 4
d154 1
a154 1
	    "<LI><A HREF=\"$key.html\">\u$key</A> <em>($stats{$key})</em></LI>";
@


1.1.1.1
log
@Initial import of the Japanese translation of the web pages.
Submitted by:	The FreeBSD Japanese DOcumentation Project
@
text
@@
