[lzma-sdk] Initial import.

Jon Ciesla limb at fedoraproject.org
Wed Nov 30 00:14:29 UTC 2011


commit e366954d75a46903e57c696186efc45b207c9fb7
Author: Jon Ciesla <limb at jcomserv.net>
Date:   Tue Nov 29 18:14:21 2011 -0600

    Initial import.

 .gitignore                     |    1 +
 lzma-sdk-4.6.5-sharedlib.patch |  400 ++++++++++++++++++++++++++++++++++++++++
 lzma-sdk-LICENSE.fedora        |   41 ++++
 lzma-sdk.spec                  |  116 ++++++++++++
 sources                        |    1 +
 5 files changed, 559 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..45023d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/lzma465.tar.bz2
diff --git a/lzma-sdk-4.6.5-sharedlib.patch b/lzma-sdk-4.6.5-sharedlib.patch
new file mode 100644
index 0000000..8192ba6
--- /dev/null
+++ b/lzma-sdk-4.6.5-sharedlib.patch
@@ -0,0 +1,400 @@
+diff -up lzma465/C/LzmaDec.c.shared lzma465/C/LzmaDec.c
+--- lzma465/C/LzmaDec.c.shared	2008-11-06 02:31:07.000000000 -0500
++++ lzma465/C/LzmaDec.c	2011-08-09 15:38:46.814214630 -0400
+@@ -5,110 +5,6 @@
+ 
+ #include <string.h>
+ 
+-#define kNumTopBits 24
+-#define kTopValue ((UInt32)1 << kNumTopBits)
+-
+-#define kNumBitModelTotalBits 11
+-#define kBitModelTotal (1 << kNumBitModelTotalBits)
+-#define kNumMoveBits 5
+-
+-#define RC_INIT_SIZE 5
+-
+-#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
+-
+-#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
+-#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
+-#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
+-#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
+-  { UPDATE_0(p); i = (i + i); A0; } else \
+-  { UPDATE_1(p); i = (i + i) + 1; A1; }
+-#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
+-
+-#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
+-#define TREE_DECODE(probs, limit, i) \
+-  { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
+-
+-/* #define _LZMA_SIZE_OPT */
+-
+-#ifdef _LZMA_SIZE_OPT
+-#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
+-#else
+-#define TREE_6_DECODE(probs, i) \
+-  { i = 1; \
+-  TREE_GET_BIT(probs, i); \
+-  TREE_GET_BIT(probs, i); \
+-  TREE_GET_BIT(probs, i); \
+-  TREE_GET_BIT(probs, i); \
+-  TREE_GET_BIT(probs, i); \
+-  TREE_GET_BIT(probs, i); \
+-  i -= 0x40; }
+-#endif
+-
+-#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
+-
+-#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
+-#define UPDATE_0_CHECK range = bound;
+-#define UPDATE_1_CHECK range -= bound; code -= bound;
+-#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
+-  { UPDATE_0_CHECK; i = (i + i); A0; } else \
+-  { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
+-#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
+-#define TREE_DECODE_CHECK(probs, limit, i) \
+-  { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
+-
+-
+-#define kNumPosBitsMax 4
+-#define kNumPosStatesMax (1 << kNumPosBitsMax)
+-
+-#define kLenNumLowBits 3
+-#define kLenNumLowSymbols (1 << kLenNumLowBits)
+-#define kLenNumMidBits 3
+-#define kLenNumMidSymbols (1 << kLenNumMidBits)
+-#define kLenNumHighBits 8
+-#define kLenNumHighSymbols (1 << kLenNumHighBits)
+-
+-#define LenChoice 0
+-#define LenChoice2 (LenChoice + 1)
+-#define LenLow (LenChoice2 + 1)
+-#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+-#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+-#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+-
+-
+-#define kNumStates 12
+-#define kNumLitStates 7
+-
+-#define kStartPosModelIndex 4
+-#define kEndPosModelIndex 14
+-#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+-
+-#define kNumPosSlotBits 6
+-#define kNumLenToPosStates 4
+-
+-#define kNumAlignBits 4
+-#define kAlignTableSize (1 << kNumAlignBits)
+-
+-#define kMatchMinLen 2
+-#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
+-
+-#define IsMatch 0
+-#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
+-#define IsRepG0 (IsRep + kNumStates)
+-#define IsRepG1 (IsRepG0 + kNumStates)
+-#define IsRepG2 (IsRepG1 + kNumStates)
+-#define IsRep0Long (IsRepG2 + kNumStates)
+-#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
+-#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+-#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
+-#define LenCoder (Align + kAlignTableSize)
+-#define RepLenCoder (LenCoder + kNumLenProbs)
+-#define Literal (RepLenCoder + kNumLenProbs)
+-
+-#define LZMA_BASE_SIZE 1846
+-#define LZMA_LIT_SIZE 768
+-
+-#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
+-
+ #if Literal != LZMA_BASE_SIZE
+ StopCompilingDueBUG
+ #endif
+@@ -119,8 +15,6 @@ static const Byte kLiteralNextStates[kNu
+   7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10
+ };
+ 
+-#define LZMA_DIC_MIN (1 << 12)
+-
+ /* First LZMA-symbol is always decoded.
+ And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
+ Out:
+@@ -706,7 +600,7 @@ void LzmaDec_InitDicAndState(CLzmaDec *p
+     p->needInitState = 1;
+ }
+ 
+-void LzmaDec_Init(CLzmaDec *p)
++MY_EXTERN_C void LzmaDec_Init(CLzmaDec *p)
+ {
+   p->dicPos = 0;
+   LzmaDec_InitDicAndState(p, True, True);
+@@ -724,7 +618,7 @@ static void LzmaDec_InitStateReal(CLzmaD
+   p->needInitState = 0;
+ }
+ 
+-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
++MY_EXTERN_C SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
+     ELzmaFinishMode finishMode, ELzmaStatus *status)
+ {
+   SizeT inSize = *srcLen;
+@@ -885,7 +779,7 @@ SRes LzmaDec_DecodeToBuf(CLzmaDec *p, By
+   }
+ }
+ 
+-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
++MY_EXTERN_C void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
+ {
+   alloc->Free(alloc, p->probs);
+   p->probs = 0;
+@@ -929,7 +823,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, con
+   return SZ_OK;
+ }
+ 
+-static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
++MY_EXTERN_C SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
+ {
+   UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
+   if (p->probs == 0 || numProbs != p->numProbs)
+diff -up lzma465/C/LzmaDec.h.shared lzma465/C/LzmaDec.h
+--- lzma465/C/LzmaDec.h.shared	2008-10-04 05:53:19.000000000 -0400
++++ lzma465/C/LzmaDec.h	2011-08-09 15:38:46.814214630 -0400
+@@ -6,6 +6,8 @@
+ 
+ #include "Types.h"
+ 
++#include "LzmaLib.h"
++
+ /* #define _LZMA_PROB32 */
+ /* _LZMA_PROB32 can increase the speed on some CPUs,
+    but memory usage for CLzmaDec::probs will be doubled in that case */
+@@ -16,6 +18,111 @@
+ #define CLzmaProb UInt16
+ #endif
+ 
++#define kNumTopBits 24
++#define kTopValue ((UInt32)1 << kNumTopBits)
++
++#define kNumBitModelTotalBits 11
++#define kBitModelTotal (1 << kNumBitModelTotalBits)
++#define kNumMoveBits 5
++
++#define RC_INIT_SIZE 5
++
++#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
++
++#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
++#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
++#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
++#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
++  { UPDATE_0(p); i = (i + i); A0; } else \
++  { UPDATE_1(p); i = (i + i) + 1; A1; }
++#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
++
++#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
++#define TREE_DECODE(probs, limit, i) \
++  { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
++
++/* #define _LZMA_SIZE_OPT */
++
++#ifdef _LZMA_SIZE_OPT
++#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
++#else
++#define TREE_6_DECODE(probs, i) \
++  { i = 1; \
++  TREE_GET_BIT(probs, i); \
++  TREE_GET_BIT(probs, i); \
++  TREE_GET_BIT(probs, i); \
++  TREE_GET_BIT(probs, i); \
++  TREE_GET_BIT(probs, i); \
++  TREE_GET_BIT(probs, i); \
++  i -= 0x40; }
++#endif
++
++#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
++
++#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
++#define UPDATE_0_CHECK range = bound;
++#define UPDATE_1_CHECK range -= bound; code -= bound;
++#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
++  { UPDATE_0_CHECK; i = (i + i); A0; } else \
++  { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
++#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
++#define TREE_DECODE_CHECK(probs, limit, i) \
++  { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
++
++
++#define kNumPosBitsMax 4
++#define kNumPosStatesMax (1 << kNumPosBitsMax)
++
++#define kLenNumLowBits 3
++#define kLenNumLowSymbols (1 << kLenNumLowBits)
++#define kLenNumMidBits 3
++#define kLenNumMidSymbols (1 << kLenNumMidBits)
++#define kLenNumHighBits 8
++#define kLenNumHighSymbols (1 << kLenNumHighBits)
++
++#define LenChoice 0
++#define LenChoice2 (LenChoice + 1)
++#define LenLow (LenChoice2 + 1)
++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
++#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
++
++
++#define kNumStates 12
++#define kNumLitStates 7
++
++#define kStartPosModelIndex 4
++#define kEndPosModelIndex 14
++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
++
++#define kNumPosSlotBits 6
++#define kNumLenToPosStates 4
++
++#define kNumAlignBits 4
++#define kAlignTableSize (1 << kNumAlignBits)
++
++#define kMatchMinLen 2
++#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
++
++#define IsMatch 0
++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
++#define IsRepG0 (IsRep + kNumStates)
++#define IsRepG1 (IsRepG0 + kNumStates)
++#define IsRepG2 (IsRepG1 + kNumStates)
++#define IsRep0Long (IsRepG2 + kNumStates)
++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
++#define LenCoder (Align + kAlignTableSize)
++#define RepLenCoder (LenCoder + kNumLenProbs)
++#define Literal (RepLenCoder + kNumLenProbs)
++
++#define LZMA_BASE_SIZE 1846
++#define LZMA_LIT_SIZE 768
++
++#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
++
++#define LZMA_DIC_MIN (1 << 12)
+ 
+ /* ---------- LZMA Properties ---------- */
+ 
+@@ -66,7 +173,7 @@ typedef struct
+ 
+ #define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
+ 
+-void LzmaDec_Init(CLzmaDec *p);
++MY_EXTERN_C void LzmaDec_Init(CLzmaDec *p);
+ 
+ /* There are two types of LZMA streams:
+      0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
+@@ -126,9 +233,11 @@ LzmaDec_Allocate* can return:
+   SZ_ERROR_MEM         - Memory allocation error
+   SZ_ERROR_UNSUPPORTED - Unsupported properties
+ */
++
++MY_EXTERN_C SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc);
+    
+ SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
+-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
++MY_EXTERN_C void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
+ 
+ SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
+ void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
+@@ -174,7 +283,7 @@ Returns:
+   SZ_ERROR_DATA - Data error
+ */
+ 
+-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
++MY_EXTERN_C SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
+     const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+ 
+ 
+diff -up lzma465/C/LzmaEnc.c.shared lzma465/C/LzmaEnc.c
+--- lzma465/C/LzmaEnc.c.shared	2009-02-02 02:34:23.000000000 -0500
++++ lzma465/C/LzmaEnc.c	2011-08-09 15:39:31.450585156 -0400
+@@ -42,7 +42,7 @@ static int ttt = 0;
+ #define kNumBitPriceShiftBits 4
+ #define kBitPrice (1 << kNumBitPriceShiftBits)
+ 
+-void LzmaEncProps_Init(CLzmaEncProps *p)
++MY_EXTERN_C void LzmaEncProps_Init(CLzmaEncProps *p)
+ {
+   p->level = 5;
+   p->dictSize = p->mc = 0;
+@@ -2258,7 +2258,7 @@ SRes LzmaEnc_MemEncode(CLzmaEncHandle pp
+   return res;
+ }
+ 
+-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
++MY_EXTERN_C SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+     const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+     ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
+ {
+diff -up lzma465/C/LzmaEnc.h.shared lzma465/C/LzmaEnc.h
+--- lzma465/C/LzmaEnc.h.shared	2008-10-04 05:53:19.000000000 -0400
++++ lzma465/C/LzmaEnc.h	2011-08-09 15:39:19.554752799 -0400
+@@ -5,6 +5,7 @@
+ #define __LZMAENC_H
+ 
+ #include "Types.h"
++#include "LzmaLib.h"
+ 
+ #define LZMA_PROPS_SIZE 5
+ 
+@@ -26,7 +27,7 @@ typedef struct _CLzmaEncProps
+   int numThreads;  /* 1 or 2, default = 2 */
+ } CLzmaEncProps;
+ 
+-void LzmaEncProps_Init(CLzmaEncProps *p);
++MY_EXTERN_C void LzmaEncProps_Init(CLzmaEncProps *p);
+ void LzmaEncProps_Normalize(CLzmaEncProps *p);
+ UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
+ 
+@@ -65,7 +66,7 @@ Return code:
+   SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)
+ */
+ 
+-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
++MY_EXTERN_C SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+     const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+     ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
+ 
+diff -up lzma465/CPP/7zip/Compress/LZMA_Alone/makefile.gcc.shared lzma465/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
+--- lzma465/CPP/7zip/Compress/LZMA_Alone/makefile.gcc.shared	2008-12-26 01:51:47.000000000 -0500
++++ lzma465/CPP/7zip/Compress/LZMA_Alone/makefile.gcc	2011-08-09 15:38:46.816214602 -0400
+@@ -1,6 +1,8 @@
+-PROG = lzma
+-CXX = g++ -O2 -Wall
+-CXX_C = gcc -O2 -Wall
++LIBRARY = liblzmasdk.so
++LIBRARYMINOR = $(LIBRARY).4
++LIBRARYMAJOR = $(LIBRARYMINOR).6.5
++CXX = g++ -O2 -Wall -fPIC
++CXX_C = gcc -O2 -Wall -fPIC
+ LIB = -lm
+ RM = rm -f
+ CFLAGS = -c
+@@ -46,10 +48,10 @@ OBJS = \
+   Lzma86Enc.o \
+ 
+ 
+-all: $(PROG)
++all: $(LIBRARYMAJOR)
+ 
+-$(PROG): $(OBJS)
+-	$(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)
++$(LIBRARYMAJOR): $(OBJS)
++	$(CXX) -o $(LIBRARYMAJOR) -shared -Wl,-soname=$(LIBRARYMINOR) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)
+ 
+ LzmaAlone.o: LzmaAlone.cpp
+ 	$(CXX) $(CFLAGS) LzmaAlone.cpp
+@@ -131,5 +133,5 @@ Lzma86Enc.o: ../../../../C/LzmaUtil/Lzma
+ 	$(CXX_C) $(CFLAGS) ../../../../C/LzmaUtil/Lzma86Enc.c
+ 
+ clean:
+-	-$(RM) $(PROG) $(OBJS)
++	-$(RM) $(LIBRARYMAJOR) $(OBJS)
+ 
diff --git a/lzma-sdk-LICENSE.fedora b/lzma-sdk-LICENSE.fedora
new file mode 100644
index 0000000..691a531
--- /dev/null
+++ b/lzma-sdk-LICENSE.fedora
@@ -0,0 +1,41 @@
+Subject: Re: Licensing of lzma-sdk
+From: "Igor Pavlov" <supp at 7-zip.org>
+Date: Tue, 5 Apr 2011 23:11:30 +0600
+To: "Tom Callaway" <tcallawa at redhat.com>
+
+Hello!
+
+I use LGPL 2.1 for 7-Zip.
+
+Thanks!
+
+-- 
+Igor Pavlov
+http://www.7-zip.org
+Compression software
+
+----- Original Message ----- 
+From: "Tom Callaway" <tcallawa at redhat.com>
+To: "Igor Pavlov" <supp at 7-zip.org>
+Sent: Tuesday, April 05, 2011 9:47 PM
+Subject: Re: Licensing of lzma-sdk
+
+
+> On 04/05/2011 11:28 AM, Igor Pavlov wrote:
+>> Hello!
+>>
+>> 1) Russian law probably can have many problems.
+>> Maybe there is some "public domain" limitation there. If so, I hope the
+>> law will be fixed in future.
+>> Now I just don't care about it.
+>>
+>> 2) I used GNU LGPL in old versions of LZMA SDK.
+>> If you are OK with GNU LGPL rules, you can use it.
+>> I can add the note to my site.
+>
+> GNU LGPL is fine, do you have any preference on version?
+>
+> ~tom
+>
+> ==
+> Fedora Project
diff --git a/lzma-sdk.spec b/lzma-sdk.spec
new file mode 100644
index 0000000..14408ea
--- /dev/null
+++ b/lzma-sdk.spec
@@ -0,0 +1,116 @@
+Name:           lzma-sdk
+Version:        4.6.5
+Release:        6%{?dist}
+Summary:        SDK for lzma compression
+
+Group:          Applications/Archiving
+License:        LGPLv2
+URL:            http://sourceforge.net/projects/sevenzip/
+Source0:        http://downloads.sourceforge.net/sevenzip/lzma465.tar.bz2
+Source1:        lzma-sdk-LICENSE.fedora
+Patch0:         lzma-sdk-4.6.5-sharedlib.patch
+
+%description
+LZMA SDK provides the documentation, samples, header files, libraries,
+and tools you need to develop applications that use LZMA compression.
+
+LZMA is default and general compression method of 7z format
+in 7-Zip compression program (www.7-zip.org). LZMA provides high
+compression ratio and very fast decompression.
+
+LZMA is an improved version of famous LZ77 compression algorithm. 
+It was improved in way of maximum increasing of compression ratio,
+keeping high decompression speed and low memory requirements for
+decompressing.
+
+%package devel
+Summary:        Development libraries and headers for %{name}
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+Development libraries and headers for %{name}.
+
+%prep
+%setup -q -c -n lzma465
+%patch0 -p1 -b .shared
+rm lzma.exe
+
+for f in .h .c .cpp .dsw .dsp .java .cs .txt makefile; do
+   find . -iname "*$f" | xargs chmod -x
+done
+
+# correct end-of-line encoding
+sed -i 's/\r//' *.txt 
+
+for i in \
+7zFormat.txt \
+CS/7zip/Compress/LzmaAlone/LzmaAlone.sln \
+7zC.txt \
+CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj \
+CPP/7zip/Bundles/Alone7z/resource.rc \
+history.txt \
+lzma.txt \
+CPP/7zip/Compress/LZMA_Alone/makefile.gcc \
+CPP/Build.mak \
+C/LzmaUtil/makefile.gcc \
+CPP/7zip/Bundles/Format7zR/resource.rc \
+C/Archive/7z/makefile.gcc \
+CPP/7zip/Archive/Archive.def \
+CPP/7zip/Bundles/Format7zExtractR/resource.rc \
+C/LzmaLib/resource.rc \
+CPP/7zip/Archive/Archive2.def \
+CPP/7zip/MyVersionInfo.rc \
+Methods.txt \
+C/LzmaLib/LzmaLib.def; do
+    iconv -f iso-8859-1 -t utf-8 $i > $i.utf8
+    touch -r $i $i.utf8
+    mv $i.utf8 $i
+done
+
+install -p -m 0644 %{SOURCE1} .
+
+%build
+cd CPP/7zip/Compress/LZMA_Alone
+make -f makefile.gcc clean all CXX="g++ %{optflags} -fPIC" CXX_C="gcc %{optflags} -fPIC"
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_libdir}
+install -m0755 CPP/7zip/Compress/LZMA_Alone/liblzmasdk.so.4.6.5 %{buildroot}%{_libdir}
+pushd %{buildroot}%{_libdir}
+ln -s liblzmasdk.so.4.6.5 liblzmasdk.so.4
+ln -s liblzmasdk.so.4.6.5 liblzmasdk.so
+popd
+mkdir -p %{buildroot}/%{_includedir}/lzma465/
+find -iname '*.h' | xargs -I {} install -m0644 -D {} %{buildroot}/%{_includedir}/lzma465/{}
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%doc lzma.txt history.txt lzma-sdk-LICENSE.fedora
+%{_libdir}/liblzmasdk.so.*
+
+%files devel
+%doc 7z*.txt Methods.txt
+%{_includedir}/lzma465/
+%{_libdir}/liblzmasdk.so
+
+%changelog
+* Tue Nov 29 2011 Jon Ciesla <limb at jcomserv.net> - 4.6.5-6
+- Changed first gcc on make line to g++ to silence rpmlint.
+
+* Tue Aug  9 2011 Tom Callaway <spot at fedoraproject.org> - 4.6.5-5
+- rework package to be more normal
+
+* Wed Apr 27 2011 Jon Ciesla <limb at jcomserv.net> - 4.6.5-4
+- Additional provides macro.
+
+* Mon Apr 11 2011 Jon Ciesla <limb at jcomserv.net> - 4.6.5-3
+- Stripped perl(SevenZip) provides.
+
+* Tue Apr 05 2011 Jon Ciesla <limb at jcomserv.net> - 4.6.5-2
+- Licensing clarification.
+
+* Wed May 26 2010 Jon Ciesla <limb at jcomserv.net> - 4.6.5-1
+- Initial build
diff --git a/sources b/sources
index e69de29..3fbf4c4 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+29d5ffd03a5a3e51aef6a74e9eafb759  lzma465.tar.bz2


More information about the scm-commits mailing list