aboutsummaryrefslogtreecommitdiff
path: root/chinese/chm2html
diff options
context:
space:
mode:
authorVanilla I. Shu <vanilla@FreeBSD.org>2003-11-13 04:59:49 +0000
committerVanilla I. Shu <vanilla@FreeBSD.org>2003-11-13 04:59:49 +0000
commit4116bb7efb8590c29ed1992254971af4f10caf35 (patch)
treec2da5a85fdbc1515e41bdccfc294d9272ad990fa /chinese/chm2html
parentdc01a0e8497d79494bfd65ad8aa146810e689151 (diff)
downloadports-4116bb7efb8590c29ed1992254971af4f10caf35.tar.gz
ports-4116bb7efb8590c29ed1992254971af4f10caf35.zip
Notes
Diffstat (limited to 'chinese/chm2html')
-rw-r--r--chinese/chm2html/Makefile30
-rw-r--r--chinese/chm2html/distinfo1
-rw-r--r--chinese/chm2html/files/chm.sh46
-rw-r--r--chinese/chm2html/files/patch-hhc2html.pl11
-rw-r--r--chinese/chm2html/pkg-descr6
-rw-r--r--chinese/chm2html/pkg-plist4
6 files changed, 98 insertions, 0 deletions
diff --git a/chinese/chm2html/Makefile b/chinese/chm2html/Makefile
new file mode 100644
index 000000000000..b509760f7910
--- /dev/null
+++ b/chinese/chm2html/Makefile
@@ -0,0 +1,30 @@
+# New ports collection makefile for: zh-chm2html
+# Date created: 16 April 2003
+# Whom: Shen Chuan-Hsing <statue@freebsd.sinica.edu.tw>
+#
+# $FreeBSD$
+#
+
+PORTNAME= chm2html
+PORTVERSION= 0.1a
+CATEGORIES= chinese
+MASTER_SITES= http://www.geocities.com/labourvanity/pub/ \
+ ftp://freebsd.sinica.edu.tw/pub/statue/chm2html/
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= statue@freebsd.sinica.edu.tw
+COMMENT= CHM Tools package
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+
+post-extract:
+ @cd ${WRKSRC} && tar zxvf chmtools.tar.gz
+ @cd ${WRKSRC} && tar zxvf utf-converter-1.0.tar.gz
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/chm2html ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${WRKSRC}/hhc2bookmark.pl ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${WRKSRC}/hhc2html.pl ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${FILESDIR}/chm.sh ${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/chinese/chm2html/distinfo b/chinese/chm2html/distinfo
new file mode 100644
index 000000000000..212349e31484
--- /dev/null
+++ b/chinese/chm2html/distinfo
@@ -0,0 +1 @@
+MD5 (chm2html-0.1a.tgz) = 703c71d6d5cddfc7e6fe5325cccb8d4b
diff --git a/chinese/chm2html/files/chm.sh b/chinese/chm2html/files/chm.sh
new file mode 100644
index 000000000000..7446702e2f90
--- /dev/null
+++ b/chinese/chm2html/files/chm.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+# chm.sh
+
+if [ -z "$1" ]; then
+ echo "file not specified"
+ exit 1;
+fi
+
+if [ ! -s "$1" ]; then
+ echo "file not exist: $1"
+ exit 1;
+fi
+
+which="/usr/bin/which"
+
+# get full path or ./ of this command
+# then, trace back the symbolic link
+prefix=`$which $0`
+while [ -h "$prefix" ]; do
+ lnk_to=`/bin/ls -l "$prefix" | awk '{print $NF}'`
+ if echo $lnk_to | grep "^/" >& /dev/null; then
+ prefix=$lnk_to
+ else
+ prefix=${prefix%/*}/$lnk_to
+ fi
+done
+
+prefix=${prefix%/*}
+chm2html="$prefix/chm2html"
+hhc2html="$prefix/hhc2html.pl"
+
+for f in "$chm2html" "$hhc2html"; do
+ if [ ! -s "$f" ]; then
+ echo "${0##*/}: can not execute program '$f'"
+ exit 1
+ fi
+done
+
+chmtmp="/tmp/chm-$$"
+contents="$chmtmp/chm-$$.html"
+
+"$chm2html" < "$1" "$chmtmp"
+"$hhc2html" "$chmtmp"/`ls "$chmtmp" | grep '\.hhc$'` > "$contents"
+
+mozilla "$contents"
+
diff --git a/chinese/chm2html/files/patch-hhc2html.pl b/chinese/chm2html/files/patch-hhc2html.pl
new file mode 100644
index 000000000000..8fcd27492d1f
--- /dev/null
+++ b/chinese/chm2html/files/patch-hhc2html.pl
@@ -0,0 +1,11 @@
+--- hhc2html.pl.orig Thu May 8 13:05:31 2003
++++ hhc2html.pl Thu May 8 13:05:39 2003
+@@ -40,7 +40,7 @@
+ $name="";
+ $local="";
+ OBJECT: while(<>){
+- last OBJECT if /<\/object>/i && print "<a href=$local>$name</a></dev>";
++ last OBJECT if /<\/object>/i && print "<a href=$local>$name</a></div>";
+ if( /(.*)($param)(.*)/i ){
+ $pre=$1; $_=$2; $post=$3;
+ print $pre,$post;
diff --git a/chinese/chm2html/pkg-descr b/chinese/chm2html/pkg-descr
new file mode 100644
index 000000000000..535cd09f335d
--- /dev/null
+++ b/chinese/chm2html/pkg-descr
@@ -0,0 +1,6 @@
+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@bbs.ee.ntu.edu.tw
+WWW: http://www.geocities.com/labourvanity/
diff --git a/chinese/chm2html/pkg-plist b/chinese/chm2html/pkg-plist
new file mode 100644
index 000000000000..e986746bd54d
--- /dev/null
+++ b/chinese/chm2html/pkg-plist
@@ -0,0 +1,4 @@
+bin/chm2html
+bin/chm.sh
+bin/hhc2bookmark.pl
+bin/hhc2html.pl