New port: xmill

An efficient compressor for XML.

Submitted by:	Alexey Dokuchaev
This commit is contained in:
Max Khon 2003-05-09 19:03:17 +00:00
parent b733e12934
commit 751000fc43
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=80559
7 changed files with 378 additions and 0 deletions

43
archivers/xmill/Makefile Normal file
View File

@ -0,0 +1,43 @@
# New ports collection makefile for: xmill
# Date created: 09 May 2003
# Whom: Alexey Dokuchaev <danfe@regency.nsu.ru>
#
# $FreeBSD$
#
PORTNAME= xmill
PORTVERSION= 0.7
CATEGORIES= archivers
MASTER_SITES= http://www.research.att.com/~mff/XMILL/
DISTNAME= xmill-0-7
MAINTAINER= danfe@regency.nsu.ru
COMMENT= An efficient compressor for XML
NO_WRKSUBDIR= yes
MAKEFILE= makefile
USE_ZIP= yes
.include <bsd.port.pre.mk>
.if !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX})
IGNORE="Explicit agreement to the terms and conditions of the license required. Download ${DISTNAME}${EXTRACT_SUFX} manually from http://www.research.att.com/sw/tools/xmill/download.html, put it under ${DISTDIR} and run make again"
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/unix/xmill ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/unix/xdemill ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/unix/xbmill ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/unix/xbdemill ${PREFIX}/bin
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/COPYRIGHT.txt ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/LICENSE.txt ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/MANUAL.txt ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.txt ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/paper/xmill.ps.gz ${DOCSDIR}
.endif
.include <bsd.port.post.mk>

1
archivers/xmill/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (xmill-0-7.zip) = d0f530efdb233b53f85bea36e6f21ce1

View File

@ -0,0 +1,138 @@
--- makefile.orig Mon Nov 29 16:37:20 1999
+++ makefile Fri May 9 16:40:56 2003
@@ -33,21 +33,18 @@
TMP = ./tmp
SRC = ./src
-CPP = g++
-CPPFLAGS_XMILL = -O3 -c -Izlib -DXMILL
-CPPFLAGS_XDEMILL = -O3 -c -Izlib -DXDEMILL
+CPP = $(CXX)
+CPPFLAGS_XMILL = $(CXXFLAGS) -c -Izlib -DXMILL
+CPPFLAGS_XDEMILL = $(CXXFLAGS) -c -Izlib -DXDEMILL
-CC = gcc
-CFLAGS = -O3 -c
+CC = $(CC)
+CFLAGS += -c
LINK=g++
# LINK_FLAGS = -L.
-ZLIB_OBJS = $(TMP)/adler32.o $(TMP)/crc32.o $(TMP)/deflate.o $(TMP)/trees.o $(TMP)/uncompr.o \
- $(TMP)/inffast.o $(TMP)/inflate.o $(TMP)/inftrees.o $(TMP)/infutil.o $(TMP)/infblock.o \
- $(TMP)/infcodes.o $(TMP)/zutil.o
+ZLIB_LIBS = -lz
-BZLIB_OBJS= $(TMP)/blocksort.o $(TMP)/bzlib.o $(TMP)/compress_b.o $(TMP)/crctable.o $(TMP)/decompress.o \
- $(TMP)/huffman.o $(TMP)/randtable.o
+BZLIB_LIBS = -lbz2
XMILL_OBJSPART = $(TMP)/CompressMan.o $(TMP)/ContMan.o $(TMP)/PathDict.o $(TMP)/PathTree.o \
$(TMP)/RepeatCompress.o $(TMP)/RunLenCompress.o $(TMP)/SAXClient.o \
@@ -61,11 +58,11 @@
$(TMP)/DivCompress_u.o $(TMP)/EnumCompress_u.o $(TMP)/Error_u.o \
$(TMP)/Options_u.o $(TMP)/MemStreamer_u.o
-XMILLOBJS = $(ZLIB_OBJS) $(XMILL_OBJSPART) $(TMP)/ZLib.o
-XBMILLOBJS = $(BZLIB_OBJS) $(XMILL_OBJSPART) $(TMP)/ZLib_b.o
+XMILLOBJS = $(XMILL_OBJSPART) $(TMP)/ZLib.o $(ZLIB_LIBS)
+XBMILLOBJS = $(XMILL_OBJSPART) $(TMP)/ZLib_b.o $(BZLIB_LIBS)
-XDEMILLOBJS = $(ZLIB_OBJS) $(XDEMILL_OBJSPART) $(TMP)/ZLib_u.o
-XBDEMILLOBJS = $(BZLIB_OBJS) $(XDEMILL_OBJSPART) $(TMP)/ZLib_bu.o
+XDEMILLOBJS = $(XDEMILL_OBJSPART) $(TMP)/ZLib_u.o $(ZLIB_LIBS)
+XBDEMILLOBJS = $(XDEMILL_OBJSPART) $(TMP)/ZLib_bu.o $(BZLIB_LIBS)
$(BIN)/xmill : $(XMILLOBJS)
$(LINK) -o $(BIN)/xmill $(LINK_FLAGS) $(XMILLOBJS)
@@ -146,7 +143,7 @@
$(CPP) -o $*.o $(CPPFLAGS_XMILL) $(SRC)/ZLib.cpp
$(TMP)/ZLib_b.o : $(SRC)/ZLib.cpp
- $(CPP) -o $*.o -I./bzlib $(CPPFLAGS_XMILL) -DUSE_BZIP $(SRC)/ZLib.cpp
+ $(CPP) -o $*.o $(CPPFLAGS_XMILL) -DUSE_BZIP $(SRC)/ZLib.cpp
#********************************************************************
@@ -199,80 +196,7 @@
$(CPP) -o $*.o $(CPPFLAGS_XDEMILL) $(SRC)/ZLib.cpp
$(TMP)/ZLib_bu.o : $(SRC)/ZLib.cpp
- $(CPP) -o $*.o -I./bzlib $(CPPFLAGS_XDEMILL) -DUSE_BZIP $(SRC)/ZLib.cpp
-
-#********************************************************************
-
-$(TMP)/adler32.o : ./zlib/adler32.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/adler32.c
-
-$(TMP)/crc32.o : ./zlib/crc32.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/crc32.c
-
-$(TMP)/compress.o : ./zlib/compress.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/compress.c
-
-$(TMP)/deflate.o : ./zlib/deflate.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/deflate.c
-
-$(TMP)/gzio.o : ./zlib/gzio.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/gzio.c
-
-$(TMP)/infblock.o : ./zlib/infblock.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/infblock.c
-
-$(TMP)/infcodes.o : ./zlib/infcodes.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/infcodes.c
-
-$(TMP)/inffast.o : ./zlib/inffast.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/inffast.c
-
-$(TMP)/inflate.o : ./zlib/inflate.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/inflate.c
-
-$(TMP)/inftrees.o : ./zlib/inftrees.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/inftrees.c
-
-$(TMP)/infutil.o : ./zlib/infutil.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/infutil.c
-
-$(TMP)/trees.o : ./zlib/trees.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/trees.c
-
-$(TMP)/uncompr.o : ./zlib/uncompr.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/uncompr.c
-
-$(TMP)/zutil.o : ./zlib/zutil.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/zutil.c
-
-$(TMP)/minigzip.o : ./zlib/minigzip.c
- $(CC) -o $*.o $(CFLAGS) ./zlib/minigzip.c
-
-#********************************************************************
-
-$(TMP)/blocksort.o : ./bzlib/blocksort.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/blocksort.c
-
-$(TMP)/compress_b.o : ./bzlib/compress.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/compress.c
-
-$(TMP)/crctable.o : ./bzlib/crctable.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/crctable.c
-
-$(TMP)/decompress.o : ./bzlib/decompress.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/decompress.c
-
-$(TMP)/huffman.o : ./bzlib/huffman.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/huffman.c
-
-$(TMP)/randtable.o : ./bzlib/randtable.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/randtable.c
-
-$(TMP)/bzlib.o : ./bzlib/bzlib.c
- $(CC) -o $*.o $(CFLAGS) ./bzlib/bzlib.c
-
-#$(TMP)/bzip2.o : ./bzlib/bzip2.c
-# $(CC) -o $*.o $(CFLAGS) ./bzlib/bzip2.c
+ $(CPP) -o $*.o $(CPPFLAGS_XDEMILL) -DUSE_BZIP $(SRC)/ZLib.cpp
#********************************************************************

View File

@ -0,0 +1,27 @@
--- src/Main.cpp.orig Fri May 9 16:24:51 2003
+++ src/Main.cpp Fri May 9 16:25:41 2003
@@ -599,7 +599,7 @@
return;
}
- if(output.CreateFile((no_output==0) ? destfile : "")==0)
+ if(output.CreateFile((no_output==0) ? destfile : (char *)"")==0)
{
Error("Could not create output file '");
ErrorCont(destfile);
@@ -816,7 +816,7 @@
globallabeldict.Init();
- if(output.CreateFile((no_output==0) ? destfile : "")==0)
+ if(output.CreateFile((no_output==0) ? destfile : (char *)"")==0)
{
Error("Could not create output file '");
ErrorCont(destfile);
@@ -905,4 +905,4 @@
{
return malloc(size);
}
-*/
\ No newline at end of file
+*/

View File

@ -0,0 +1,150 @@
--- src/ZLib.cpp.orig Fri May 9 16:34:09 2003
+++ src/ZLib.cpp Fri May 9 16:55:35 2003
@@ -125,7 +125,7 @@
// We finish compression, if there has been some data in the queue
{
#ifdef USE_BZIP
- bzCompressEnd(&state);
+ BZ2_bzCompressEnd(&state);
#else
deflateEnd(&state);
#endif
@@ -175,7 +175,7 @@
if(isinitialized==0)
{
#ifdef USE_BZIP
- if(bzCompressInit(&state,7,0,0)!=BZ_OK)
+ if(BZ2_bzCompressInit(&state,7,0,0)!=BZ_OK)
#else
if(deflateInit(&state,zlib_compressidx)!=Z_OK)
#endif
@@ -183,8 +183,15 @@
Error("Error while compressing container!");
Exit();
}
+#ifdef USE_BZIP
+ state.total_out_lo32=0;
+ state.total_out_hi32=0;
+ state.total_in_lo32=0;
+ state.total_in_hi32=0;
+#else
state.total_out=0;
state.total_in=0;
+#endif
isinitialized=1;
}
@@ -205,7 +212,7 @@
saveavail=state.avail_out;
#ifdef USE_BZIP
- if(bzCompress(&state,BZ_RUN)!=BZ_RUN_OK)
+ if(BZ2_bzCompress(&state,BZ_RUN)!=BZ_RUN_OK)
#else
if(deflate(&state,Z_NO_FLUSH)!=Z_OK)
#endif
@@ -259,7 +266,7 @@
if(isinitialized==0)
{
#ifdef USE_BZIP
- if(bzCompressInit(&state,7,0,0)!=BZ_OK)
+ if(BZ2_bzCompressInit(&state,7,0,0)!=BZ_OK)
#else
if(deflateInit(&state,zlib_compressidx)!=Z_OK)
#endif
@@ -267,8 +274,15 @@
Error("Error while compressing container!");
Exit();
}
+#ifdef USE_BZIP
+ state.total_out_lo32=0;
+ state.total_out_hi32=0;
+ state.total_in_lo32=0;
+ state.total_in_hi32=0;
+#else
state.total_out=0;
state.total_in=0;
+#endif
isinitialized=1;
}
@@ -278,7 +292,7 @@
// The actual compression
#ifdef USE_BZIP
- if(bzCompress(&state,BZ_RUN)!=BZ_RUN_OK)
+ if(BZ2_bzCompress(&state,BZ_RUN)!=BZ_RUN_OK)
#else
if(deflate(&state,Z_NO_FLUSH)!=Z_OK)
#endif
@@ -326,7 +340,7 @@
saveavail=state.avail_out;
#ifdef USE_BZIP
- err=bzCompress(&state,BZ_FINISH);
+ err=BZ2_bzCompress(&state,BZ_FINISH);
#else
err=deflate(&state,Z_FINISH);
#endif
@@ -353,15 +367,25 @@
while(1);
// Let's store the input and output size
+#ifdef USE_BZIP
+ if(uncompressedsize!=NULL) *uncompressedsize =state.total_in_lo32;
+ if(compressedsize!=NULL) *compressedsize =state.total_out_lo32;
+
+ state.total_out_lo32=0;
+ state.total_out_hi32=0;
+ state.total_in_lo32=0;
+ state.total_in_hi32=0;
+#else
if(uncompressedsize!=NULL) *uncompressedsize =state.total_in;
if(compressedsize!=NULL) *compressedsize =state.total_out;
state.total_out=0;
state.total_in=0;
+#endif
// Finally, we release the internal memory
#ifdef USE_BZIP
- if(bzCompressEnd(&state)!=BZ_OK)
+ if(BZ2_bzCompressEnd(&state)!=BZ_OK)
#else
if(deflateReset(&state)!=Z_OK)
#endif
@@ -404,7 +428,7 @@
#endif
#ifdef USE_BZIP
- if(bzDecompressInit(&state,0,0)!=BZ_OK)
+ if(BZ2_bzDecompressInit(&state,0,0)!=BZ_OK)
#else
if(inflateInit(&state)!=Z_OK)
#endif
@@ -439,7 +463,7 @@
// The actual decompression
#ifdef USE_BZIP
- switch(bzDecompress(&state))
+ switch(BZ2_bzDecompress(&state))
#else
switch(inflate(&state,Z_NO_FLUSH))
#endif
@@ -454,11 +478,15 @@
input->SkipData(save_in-state.avail_in);
// Let's store the overall amount of "decompressed" data.
+#ifdef USE_BZIP
+ *len=state.total_out_lo32;
+#else
*len=state.total_out;
+#endif
// Let's finish the decompression entirely
#ifdef USE_BZIP
- if(bzDecompressEnd(&state)!=BZ_OK)
+ if(BZ2_bzDecompressEnd(&state)!=BZ_OK)
#else
if(inflateReset(&state)!=Z_OK)
#endif

View File

@ -0,0 +1,9 @@
XMill is a new tool for compressing XML data efficiently. It is based
on a regrouping strategy that leverages the effect of highly-efficient
compression techniques in compressors such as gzip. XMill groups XML
text strings with respect to their meaning and exploits similarities
between those text strings for compression. Hence, XMill typically
achieves much better compression rates than conventional compressors
such as gzip.
WWW: http://www.research.att.com/sw/tools/xmill/

10
archivers/xmill/pkg-plist Normal file
View File

@ -0,0 +1,10 @@
bin/xmill
bin/xdemill
bin/xbmill
bin/xbdemill
%%PORTDOCS%%share/doc/xmill/COPYRIGHT.txt
%%PORTDOCS%%share/doc/xmill/LICENSE.txt
%%PORTDOCS%%share/doc/xmill/MANUAL.txt
%%PORTDOCS%%share/doc/xmill/README.txt
%%PORTDOCS%%share/doc/xmill/xmill.ps.gz
%%PORTDOCS%%@dirrm share/doc/xmill