Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37548977
en ru br
Репозитории ALT
S:1.0.8-alt2
5.1: 1.0.6-alt1
4.1: 1.0.6-alt0.M40.1
4.0: 1.0.6-alt0.M40.1
+updates:1.0.5-alt2
3.0: 1.0.3-alt5
www.altlinux.org/Changes

Группа :: Архивирование/Сжатие
Пакет: bzip2

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: bzip2-1.0.3-alt-compat.patch
Скачать


diff -uprk.orig bzip2-1.0.3.orig/Makefile.am bzip2-1.0.3/Makefile.am
--- bzip2-1.0.3.orig/Makefile.am	2005-05-05 11:02:40 +0000
+++ bzip2-1.0.3/Makefile.am	2005-04-09 22:29:21 +0000
@@ -17,10 +17,15 @@ libbz2_la_SOURCES = \
 	huffman.c \
 	crctable.c \
 	randtable.c \
+	compat.c \
 	compress.c \
 	decompress.c \
 	bzlib.c
-libbz2_la_LDFLAGS = -version-info 1:3:0
+libbz2_la_LDFLAGS = -version-info 1:3:0 -Wl,--version-script=libbz2.map
+libbz2_la_DEPENDENCIES = libbz2.map
+
+libbz2.map: libbz2.map.sh
+	sh $^ >$@
 
 check-local: samples.sh bzip2
 	./samples.sh
diff -uprk.orig bzip2-1.0.3.orig/bzlib_compat.h bzip2-1.0.3/bzlib_compat.h
--- bzip2-1.0.3.orig/bzlib_compat.h	2005-05-05 11:02:40 +0000
+++ bzip2-1.0.3/bzlib_compat.h	2005-05-05 11:04:38 +0000
@@ -1,7 +1,7 @@
 
 /*-------------------------------------------------------------*/
-/*--- Public header file for the library.                   ---*/
-/*---                                               bzlib.h ---*/
+/*--- Public header file for the compatibility library.     ---*/
+/*---                                        bzlib_compat.h ---*/
 /*-------------------------------------------------------------*/
 
 /*--
@@ -59,13 +59,15 @@
 --*/
 
 
-#ifndef _BZLIB_H
-#define _BZLIB_H
+#ifndef _BZLIB_COMPAT_H
+#define _BZLIB_COMPAT_H
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#ifndef _BZLIB_H
+
 #define BZ_RUN               0
 #define BZ_FLUSH             1
 #define BZ_FINISH            2
@@ -134,6 +136,7 @@ typedef 
 #   define BZ_EXTERN extern
 #endif
 
+#endif /* _BZLIB_H */
 
 /*-- Core (low-level) library functions --*/
 
@@ -172,9 +175,11 @@ BZ_EXTERN int BZ_API(bzDecompressEnd) ( 
 /*-- High(er) level library functions --*/
 
 #ifndef BZ_NO_STDIO
+#ifndef _BZLIB_H
 #define BZ_MAX_UNUSED 5000
 
 typedef void BZFILE;
+#endif
 
 BZ_EXTERN BZFILE* BZ_API(bzReadOpen) ( 
       int*  bzerror,   
@@ -319,5 +324,5 @@ BZ_EXTERN const char * BZ_API(bzerror) (
 #endif
 
 /*-------------------------------------------------------------*/
-/*--- end                                           bzlib.h ---*/
+/*--- end                                    bzlib_compat.h ---*/
 /*-------------------------------------------------------------*/
diff -uprk.orig bzip2-1.0.3.orig/compat.c bzip2-1.0.3/compat.c
--- bzip2-1.0.3.orig/compat.c	1970-01-01 00:00:00 +0000
+++ bzip2-1.0.3/compat.c	2005-04-09 22:29:21 +0000
@@ -0,0 +1,251 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include "bzlib.h"
+#include "bzlib_compat.h"
+
+/*-- Core (low-level) library functions --*/
+
+int bzCompressInit (
+      bz_stream* strm,
+      int        blockSize100k,
+      int        verbosity,
+      int        workFactor
+   )
+{
+	return BZ2_bzCompressInit( strm, blockSize100k, verbosity, workFactor );
+}
+
+int bzCompress (
+      bz_stream* strm,
+      int action
+   )
+{
+	return BZ2_bzCompress( strm, action );
+}
+
+int bzCompressEnd (
+      bz_stream* strm
+   )
+{
+	return BZ2_bzCompressEnd( strm );
+}
+
+int bzDecompressInit (
+      bz_stream *strm,
+      int       verbosity,
+      int       small
+   )
+{
+	return BZ2_bzDecompressInit( strm, verbosity, small );
+}
+
+int bzDecompress (
+      bz_stream* strm
+   )
+{
+	return BZ2_bzDecompress( strm );
+}
+
+int bzDecompressEnd (
+      bz_stream *strm
+   )
+{
+	return BZ2_bzDecompressEnd( strm );
+}
+
+
+
+/*-- High(er) level library functions --*/
+
+#ifndef BZ_NO_STDIO
+
+BZFILE* bzReadOpen (
+      int*  bzerror,
+      FILE* f,
+      int   verbosity,
+      int   small,
+      void* unused,
+      int   nUnused
+   )
+{
+	return BZ2_bzReadOpen( bzerror, f, verbosity, small, unused, nUnused );
+}
+
+void bzReadClose (
+      int*    bzerror,
+      BZFILE* b
+   )
+{
+	return BZ2_bzReadClose( bzerror, b );
+}
+
+void bzReadGetUnused (
+      int*    bzerror,
+      BZFILE* b,
+      void**  unused,
+      int*    nUnused
+   )
+{
+	return BZ2_bzReadGetUnused( bzerror, b, unused, nUnused );
+}
+
+int bzRead (
+      int*    bzerror,
+      BZFILE* b,
+      void*   buf,
+      int     len
+   )
+{
+	return BZ2_bzRead( bzerror, b, buf, len );
+}
+
+BZFILE* bzWriteOpen (
+      int*  bzerror,
+      FILE* f,
+      int   blockSize100k,
+      int   verbosity,
+      int   workFactor
+   )
+{
+	return BZ2_bzWriteOpen( bzerror, f, blockSize100k, verbosity, workFactor );
+}
+
+void bzWrite (
+      int*    bzerror,
+      BZFILE* b,
+      void*   buf,
+      int     len
+   )
+{
+	return BZ2_bzWrite( bzerror, b, buf, len );
+}
+
+void bzWriteClose (
+      int*          bzerror,
+      BZFILE*       b,
+      int           abandon,
+      unsigned int* nbytes_in,
+      unsigned int* nbytes_out
+   )
+{
+	return BZ2_bzWriteClose( bzerror, b, abandon, nbytes_in, nbytes_out );
+}
+
+void bzWriteClose64 (
+      int*          bzerror,
+      BZFILE*       b,
+      int           abandon,
+      unsigned int* nbytes_in_lo32,
+      unsigned int* nbytes_in_hi32,
+      unsigned int* nbytes_out_lo32,
+      unsigned int* nbytes_out_hi32
+   )
+{
+	return BZ2_bzWriteClose64( bzerror, b, abandon, nbytes_in_lo32, nbytes_in_hi32, nbytes_out_lo32, nbytes_out_hi32 );
+}
+#endif
+
+
+/*-- Utility functions --*/
+
+int bzBuffToBuffCompress (
+      char*         dest,
+      unsigned int* destLen,
+      char*         source,
+      unsigned int  sourceLen,
+      int           blockSize100k,
+      int           verbosity,
+      int           workFactor
+   )
+{
+	return BZ2_bzBuffToBuffCompress( dest, destLen, source, sourceLen, blockSize100k, verbosity, workFactor );
+}
+
+int bzBuffToBuffDecompress (
+      char*         dest,
+      unsigned int* destLen,
+      char*         source,
+      unsigned int  sourceLen,
+      int           small,
+      int           verbosity
+   )
+{
+	return BZ2_bzBuffToBuffDecompress( dest, destLen, source, sourceLen, small, verbosity );
+}
+
+
+/*--
+   Code contributed by Yoshioka Tsuneo
+   (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
+   to support better zlib compatibility.
+   This code is not _officially_ part of libbzip2 (yet);
+   I haven't tested it, documented it, or considered the
+   threading-safeness of it.
+   If this code breaks, please contact both Yoshioka and me.
+--*/
+
+const char * bzlibVersion ( void )
+{
+	return BZ2_bzlibVersion();
+}
+
+#ifndef BZ_NO_STDIO
+BZFILE * bzopen (
+      const char *path,
+      const char *mode
+   )
+{
+	return BZ2_bzopen ( path, mode );
+}
+
+BZFILE * bzdopen (
+      int        fd,
+      const char *mode
+   )
+{
+	return BZ2_bzdopen ( fd, mode );
+}
+
+int bzread (
+      BZFILE* b,
+      void* buf,
+      int len
+   )
+{
+	return BZ2_bzread( b, buf, len );
+}
+
+int bzwrite (
+      BZFILE* b,
+      void*   buf,
+      int     len
+   )
+{
+	return BZ2_bzwrite( b, buf, len );
+}
+
+int bzflush (
+      BZFILE* b
+   )
+{
+	return BZ2_bzflush( b );
+}
+
+void bzclose (
+      BZFILE* b
+   )
+{
+	return BZ2_bzclose( b );
+}
+
+const char * bzerror (
+      BZFILE *b,
+      int    *errnum
+   )
+{
+	return BZ2_bzerror( b, errnum );
+}
+#endif
diff -uprk.orig bzip2-1.0.3.orig/libbz2.map.sh bzip2-1.0.3/libbz2.map.sh
--- bzip2-1.0.3.orig/libbz2.map.sh	1970-01-01 00:00:00 +0000
+++ bzip2-1.0.3/libbz2.map.sh	2005-04-09 22:29:21 +0000
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+cat <<__EOF__
+
+BZLIB_0.9 {
+  global:
+$(sed -ne 's/^BZ_EXTERN .*BZ_API(\([^)]\+\)).*/    \1;/pg' bzlib_compat.h)
+};
+
+BZLIB_1.0 {
+  global:
+$(sed -ne 's/^BZ_EXTERN .*BZ_API(\([^)]\+\)).*/    \1;/pg' bzlib.h)
+  local:
+    *;
+};
+__EOF__
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin