ports/58052: New port: chinese/chm2html

Statue statue at freebsd.sinica.edu.tw
Wed Oct 15 06:20:05 UTC 2003


>Number:         58052
>Category:       ports
>Synopsis:       New port: chinese/chm2html
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 14 23:20:01 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Statue
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD freebsd.sinica.edu.tw 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #4: Mon Sep 15 18:44:48 CST 2003 root at freebsd.sinica.edu.tw:/usr/src/sys/compile/GENERIC i386


	
>Description:
A set of tools for working with the CHM files, consisting of a C language
library 'chmlib' and a program called 'chmdump' which dumps out the files in
a CHM file.

Author: mison at bbs.ee.ntu.edu.tw
WWW: http://www.geocities.com/labourvanity/
	
>How-To-Repeat:
	
>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	chm2html/
#	chm2html/Makefile
#	chm2html/distinfo
#	chm2html/files
#	chm2html/pkg-descr
#	chm2html/pkg-plist
#	chm2html/files/chm.sh
#	chm2html/files/patch-hhc2html.pl
#
echo c - chm2html/
mkdir -p chm2html/ > /dev/null 2>&1
echo x - chm2html/Makefile
sed 's/^X//' >chm2html/Makefile << 'END-of-chm2html/Makefile'
X# New ports collection makefile for:	zh-chm2html
X# Date created:		16 April 2003
X# Whom:			Shen Chuan-Hsing <statue at freebsd.sinica.edu.tw>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	chm2html
XPORTVERSION=	0.1a
XCATEGORIES=	chinese
XMASTER_SITES=	http://www.geocities.com/labourvanity/pub/ \
X		ftp://freebsd.sinica.edu.tw/pub/statue/chm2html/
XEXTRACT_SUFX=	.tgz
X
XMAINTAINER=	statue at freebsd.sinica.edu.tw
XCOMMENT=	CHM Tools package
X
XWRKSRC=		${WRKDIR}/${PORTNAME}
X
Xpost-extract:
X		@cd ${WRKSRC} && tar zxvf chmtools.tar.gz
X		@cd ${WRKSRC} && tar zxvf utf-converter-1.0.tar.gz
X
Xdo-install:
X		${INSTALL_PROGRAM} ${WRKSRC}/chm2html ${PREFIX}/bin
X		${INSTALL_SCRIPT} ${WRKSRC}/hhc2bookmark.pl ${PREFIX}/bin
X		${INSTALL_SCRIPT} ${WRKSRC}/hhc2html.pl ${PREFIX}/bin
X		${INSTALL_SCRIPT} ${FILESDIR}/chm.sh ${PREFIX}/bin
X
X.include <bsd.port.mk>
END-of-chm2html/Makefile
echo x - chm2html/distinfo
sed 's/^X//' >chm2html/distinfo << 'END-of-chm2html/distinfo'
XMD5 (chm2html-0.1a.tgz) = 703c71d6d5cddfc7e6fe5325cccb8d4b
END-of-chm2html/distinfo
echo c - chm2html/files
mkdir -p chm2html/files > /dev/null 2>&1
echo x - chm2html/pkg-descr
sed 's/^X//' >chm2html/pkg-descr << 'END-of-chm2html/pkg-descr'
XA set of tools for working with the CHM files, consisting of a C language
Xlibrary 'chmlib' and a program called 'chmdump' which dumps out the files in
Xa CHM file. 
X
XAuthor: mison at bbs.ee.ntu.edu.tw
XWWW: http://www.geocities.com/labourvanity/
END-of-chm2html/pkg-descr
echo x - chm2html/pkg-plist
sed 's/^X//' >chm2html/pkg-plist << 'END-of-chm2html/pkg-plist'
Xbin/chm2html
Xbin/chm.sh
Xbin/hhc2bookmark.pl
Xbin/hhc2html.pl
END-of-chm2html/pkg-plist
echo x - chm2html/files/chm.sh
sed 's/^X//' >chm2html/files/chm.sh << 'END-of-chm2html/files/chm.sh'
X#!/bin/sh
X# chm.sh
X
Xif [ -z "$1" ]; then
X    echo "file not specified"
X    exit 1;
Xfi
X
Xif [ ! -s "$1" ]; then
X    echo "file not exist: $1"
X    exit 1;
Xfi
X
Xwhich="/usr/bin/which"
X
X# get full path or ./ of this command
X# then, trace back the symbolic link
Xprefix=`$which $0`
Xwhile [ -h "$prefix" ]; do
X  lnk_to=`/bin/ls -l "$prefix" | awk '{print $NF}'`
X  if echo $lnk_to | grep "^/" >& /dev/null; then
X    prefix=$lnk_to
X  else
X    prefix=${prefix%/*}/$lnk_to
X  fi
Xdone
X
Xprefix=${prefix%/*}
Xchm2html="$prefix/chm2html"
Xhhc2html="$prefix/hhc2html.pl"
X
Xfor f in "$chm2html" "$hhc2html"; do
X  if [ ! -s "$f" ]; then
X    echo "${0##*/}: can not execute program '$f'"
X    exit 1
X  fi
Xdone
X
Xchmtmp="/tmp/chm-$$"
Xcontents="$chmtmp/chm-$$.html"
X
X"$chm2html" < "$1" "$chmtmp"
X"$hhc2html" "$chmtmp"/`ls "$chmtmp" | grep '\.hhc$'` > "$contents"
X
Xmozilla "$contents"
X
END-of-chm2html/files/chm.sh
echo x - chm2html/files/patch-hhc2html.pl
sed 's/^X//' >chm2html/files/patch-hhc2html.pl << 'END-of-chm2html/files/patch-hhc2html.pl'
X--- hhc2html.pl.orig	Thu May  8 13:05:31 2003
X+++ hhc2html.pl	Thu May  8 13:05:39 2003
X@@ -40,7 +40,7 @@
X     $name="";
X     $local="";
X     OBJECT: while(<>){
X-	last OBJECT if /<\/object>/i && print "<a href=$local>$name</a></dev>";
X+	last OBJECT if /<\/object>/i && print "<a href=$local>$name</a></div>";
X 	if( /(.*)($param)(.*)/i ){
X 	    $pre=$1; $_=$2; $post=$3;
X 	    print $pre,$post;
END-of-chm2html/files/patch-hhc2html.pl
exit

	


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list