1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

New port: mkisofs

mkisofs is a pre-mastering program that generates binary ISO9660
filesystem image.  Users can then write the image to devices like
CD-R or CD-RW.  This port can also generate Chinese Big5 filenames
on Joliet filesystems.  Use the -J option to activate it.

Although it works flawlessly, further improvements are possible:
1. Accept GB(Simplified Chinese) filenames also.
2. Upgrade to mkisofs 1.13.  1.13 uses a better structure to manage
   I18N, which is (almost all) borrowed from Linux kernel's fs code.
This commit is contained in:
Jing-Tang Keith Jang 2000-11-07 04:50:24 +00:00
parent 303b9da965
commit 4d10c5d235
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=34867
10 changed files with 245 additions and 0 deletions

View File

@ -28,6 +28,7 @@
SUBDIR += linux-netscape47-communicator
SUBDIR += linux-netscape47-navigator
SUBDIR += lunar
SUBDIR += mkisofs
SUBDIR += moefonts-cid
SUBDIR += moettf
SUBDIR += mule-freewnn

32
chinese/mkisofs/Makefile Normal file
View File

@ -0,0 +1,32 @@
# New ports collection makefile for: zh-mkisofs
# Date created: 19 Oct 2000
# Whom: Jing-Tang Keith Jang <keith@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= mkisofs
PORTVERSION= 1.12b5
CATEGORIES= chinese sysutils
MASTER_SITES= ftp://freebsd.sinica.edu.tw/pub/keith/
PATCH_SITES= ftp://freebsd.sinica.edu.tw/pub/keith/
PATCHFILES= mkisofs-1.12b5.big5patch.gz
MAINTAINER= keith@FreeBSD.org
GNU_CONFIGURE= yes
ALL_TARGET= World
MAN8= mkisofs.8 isoinfo.8
pre-configure:
${PERL} -pi.orig -e 's:prefix = /usr/local:prefix = ${PREFIX}:' \
${WRKSRC}/diag/Makefile.in
post-build:
cd ${WRKSRC}/diag && make
post-install:
cd ${WRKSRC}/diag && make install
.include <bsd.port.mk>

2
chinese/mkisofs/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (mkisofs-1.12b5.tar.gz) = 176b5f7f2499d8f2b32e55befdd13f69
MD5 (mkisofs-1.12b5.big5patch.gz) = 8aa012761b9bf7d6c4d79c7051028ff6

View File

@ -0,0 +1,26 @@
--- include/mconfig.h.orig Mon Mar 1 18:42:26 1999
+++ include/mconfig.h Sat May 8 17:00:07 1999
@@ -28,6 +28,10 @@
#ifndef _MCONFIG_H
#define _MCONFIG_H
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+# include <sys/param.h>
+#endif
+
/*
* This hack that is needed as long as VMS has no POSIX shell.
*/
@@ -77,6 +81,12 @@
/*
* Some magic that cannot (yet) be figured out with autoconf.
*/
+
+#if (defined(BSD) && (BSD >= 199103))
+# ifndef HAVE_FLOCK
+# define HAVE_FLOCK
+# endif
+#endif
#ifdef sparc
# ifndef HAVE_LDSTUB

View File

@ -0,0 +1,26 @@
--- defaults.h.orig Mon Oct 13 04:21:11 1997
+++ defaults.h Thu Dec 4 21:14:16 1997
@@ -39,6 +39,22 @@
#define SYSTEM_ID_DEFAULT "AIX"
#endif
-#ifndef SYSTEM_ID_DEFAULT
+#ifdef __linux__
#define SYSTEM_ID_DEFAULT "LINUX"
+#endif
+
+#ifdef __FreeBSD__
+#define SYSTEM_ID_DEFAULT "FreeBSD"
+#endif
+
+#ifdef __OpenBSD__
+#define SYSTEM_ID_DEFAULT "OpenBSD"
+#endif
+
+#ifdef __NetBSD__
+#define SYSTEM_ID_DEFAULT "NetBSD"
+#endif
+
+#ifndef SYSTEM_ID_DEFAULT
+#define SYSTEM_ID_DEFAULT "Unknown"
#endif

View File

@ -0,0 +1,127 @@
--- joliet.c.orig Fri Mar 3 15:33:48 2000
+++ joliet.c Fri Mar 3 15:54:48 2000
@@ -78,6 +78,9 @@
#include <stdlib.h>
#include <time.h>
+/* Big5 to Unicode mapping table */
+#include "big52uni.h"
+
static int jpath_table_index;
static struct directory ** jpathlist;
static int next_jpath_index = 1;
@@ -88,6 +91,9 @@
static void DECL(assign_joliet_directory_addresses, (struct directory * node));
static int jroot_gen __PR((void));
+static u_int16_t unicode_table[] = CHINESE_UNICODE;
+static u_int16_t big5_table[] = CHINESE_BIG5;
+
/*
* Function: convert_to_unicode
*
@@ -101,6 +107,8 @@
unsigned char * tmpbuf;
int i;
int j;
+ int p;
+ u_int16_t code, unicode;
/*
* If we get a NULL pointer for the source, it means we have an inplace
@@ -156,6 +164,31 @@
break;
}
}
+ /******//* big5 to unicode patch*/
+
+ if( tmpbuf[j] >= 0xA1 ){
+
+ /* **** 00 A4 00 A4 00 A4 00 E5 **** */
+ /* **** ¤¤ ¤å **** */
+ /* ***j=A4 A4 A4 E5 --> code=0xa4a4 ->find unicode **** */
+ /* **** 4E 2D 65 87 <--- result **** */
+
+ code = tmpbuf[j];
+ code = code << 8;
+ code += tmpbuf[j+1];
+ for (p=0;p<BIG5_TABLE_SIZE;p++) {
+ if (big5_table[p] == code){
+ unicode = unicode_table[p];
+ buffer[i] = unicode >> 8;
+ buffer[i+1] = unicode ;
+ j++;
+ break;
+ }
+ /*else {
+ return (u_int16_t)'?';
+ }*/
+ }
+ }
}
if( source == NULL )
@@ -176,8 +209,48 @@
static int FDECL1(joliet_strlen, const char *, string)
{
int rtn;
+ unsigned char * tmpbuf;
+ int i;
+ int j;
+
+ int p;
+ u_int16_t code, unicode;
+ int tmpsize ;
rtn = strlen(string) << 1;
+ tmpsize = rtn;
+
+ tmpbuf = (u_char *)string;
+ tmpsize = rtn;
+ j=0;
+ for(i=0; i < tmpsize ; i += 2, j++)
+ {
+ /******//* big5 to unicode patch*/
+
+ if( tmpbuf[j] >= 0xA1 ){
+
+ /* **** 00 A4 00 A4 00 A4 00 E5 **** */
+ /* **** ¤¤ ¤å **** */
+ /* ***j=A4 A4 A4 E5 --> code=0xa4a4 ->find unicode **** */
+ /* **** 4E 2D 65 87 <--- result **** */
+
+ code = tmpbuf[j];
+ code = code << 8;
+ code += tmpbuf[j+1];
+ for (p=0;p<BIG5_TABLE_SIZE;p++) {
+ if (big5_table[p] == code){
+ tmpsize -= 2;
+ unicode = unicode_table[p];
+ j++;
+ break;
+ }
+ /*else {
+ return (u_int16_t)'?';
+ }
+ */
+ }
+ }
+ }
/*
* We do clamp the maximum length of a Joliet string to be the
@@ -185,11 +258,11 @@
* bolix things up with very long paths. The Joliet specs say
* that the maximum length is 128 bytes, or 64 unicode characters.
*/
- if( rtn > 0x80)
+ if( tmpsize > 0x80)
{
- rtn = 0x80;
+ tmpsize = 0x80;
}
- return rtn;
+ return tmpsize;
}
/*

View File

@ -0,0 +1,19 @@
--- name.c.orig Fri Mar 3 15:33:43 2000
+++ name.c Fri Mar 3 15:45:25 2000
@@ -213,6 +213,7 @@
}
if(current_length < 30)
{
+/*
if( *pnt < 0 )
{
*result++ = '_';
@@ -221,6 +222,8 @@
{
*result++ = (islower((unsigned char)*pnt) ? toupper((unsigned char)*pnt) : *pnt);
}
+*/
+ *result++ = *pnt;
}
}
else

View File

@ -0,0 +1 @@
Create ISO9660/JOLIET/Rock Ridge filesystems, Big5 compatible

View File

@ -0,0 +1,7 @@
mkisofs is effectively a pre-mastering program to generate the iso9660
filesystem - it takes a snapshot of a given directory tree, and generates
a binary image which will correspond to an iso9660 filesystem when written
to a block device.
This port can also generate Big5 filenames on Joliet filesystems. Use
the -J option to activate it.

View File

@ -0,0 +1,4 @@
bin/mkisofs
bin/isodump
bin/isoinfo
bin/isovfy