diff --git a/LZMA-SDK.spec b/LZMA-SDK.spec new file mode 100644 index 0000000000000000000000000000000000000000..c05e949754e9064817df331a74d22a551227efc7 --- /dev/null +++ b/LZMA-SDK.spec @@ -0,0 +1,89 @@ +Name: LZMA-SDK +Version: 19.00 +Release: 1 +Summary: SDK for lzma compression +License: Public Domain +URL: http://sourceforge.net/projects/sevenzip/ +Source0: https://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/lzma1900.7z +BuildRequires: gcc-c++ p7zip +%description +The 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 methods of 7z format in the 7-Zip program. +LZMA provides a high compression ratio and fast decompression, so it is very +suitable for embedded applications. + +%package doc +Summary: The help file of %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description doc +The help file of %{name}. + +%package devel +Summary: Development headers for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development headers for %{name}. + +%prep +%setup -q -c -n lzma1900 + +for f in .c .cpp .cs .dsp .dsw .h .java .txt makefile; do + find . -iname "*$f" | xargs chmod -x +done + +# correct end-of-file encoding for txt files in the DOC. +sed -i 's/\r//' DOC/*.txt + +# The following files in lzma belong to the iso-8859-1 character set. +# They are currently converted to utf-8 character set type. +for FILE in \ +DOC/7zC.txt \ +DOC/7zFormat.txt \ +DOC/lzma.txt \ +DOC/lzma-history.txt \ +DOC/Methods.txt \ +C/Util/7z/makefile.gcc \ +C/Util/Lzma/makefile.gcc \ +C/Util/LzmaLib/LzmaLib.def \ +C/Util/LzmaLib/resource.rc \ +CPP/Build.mak \ +CPP/7zip/MyVersionInfo.rc \ +CPP/7zip/Archive/Archive.def \ +CPP/7zip/Archive/Archive2.def \ +CPP/7zip/Bundles/Alone7z/resource.rc \ +CPP/7zip/Bundles/Format7zR/resource.rc \ +CPP/7zip/Bundles/Format7zExtractR/resource.rc \ +CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj \ +CS/7zip/Compress/LzmaAlone/LzmaAlone.sln \ +CPP/7zip/Bundles/LzmaCon/makefile.gcc; do + iconv -f iso-8859-1 -t utf-8 $FILE > $FILE.utf8 + touch -r $FILE $FILE.utf8 + mv $FILE.utf8 $FILE +done + +%build +make -f makefile.gcc clean all CXX="g++ %{optflags} -fPIC" CXX_C="gcc %{optflags} -fPIC" LDFLAGS="%{?__global_ldflags}" -C CPP/7zip/Bundles/LzmaCon + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_bindir} +install -m0755 CPP/7zip/Bundles/LzmaCon/lzma %{buildroot}%{_bindir} +mkdir -p %{buildroot}/%{_includedir}/lzma1900/ +find -iname '*.h' | xargs -I {} install -m0644 -D {} %{buildroot}/%{_includedir}/lzma1900/{} + +%files +%{_bindir}/* + +%files devel +%{_includedir}/lzma1900/ + +%files doc +%doc DOC/7z*.txt DOC/Methods.txt DOC/lzma.txt DOC/lzma-history.txt + +%changelog +* Fri Dec 4 2020 tangmeng5 - 19.00-1 +- package init diff --git a/README.en.md b/README.en.md index 1e79816a476c45e4f0b567ee263c593c8ef3a5f3..17f978afdc2dd9bcb272dab04a5c170c9a6a2aef 100644 --- a/README.en.md +++ b/README.en.md @@ -8,15 +8,27 @@ Software architecture description #### Installation -1. xxxx -2. xxxx -3. xxxx +1. Based on LZMA SDK version 19.00. + +2. Based on lzmacon directory code part of 7zip module, provide lzma command. #### Instructions -1. xxxx -2. xxxx -3. xxxx +This project mainly provides a lzma command for the following operations on the 7z file of LZMA compression algorithm: + +1. List and extract 7z files; + +2. List and extract encrypted (password protected) 7z files; + +3. List, extract encryption (password protection) + encryption header (no visible content, file list, no password) 7z file; + +4. Create 7z compressed document; + +5. Create encrypted (password protected) 7z compressed documents; + +6. Create encryption (password protection) + encryption header (no visible content, file list, no password) 7z archive. + +Specific usage can be obtained by LZMA -- help #### Contribution diff --git a/README.md b/README.md index 24aa1e4a14ad0eda9adb0a226431f881fd682b5e..d8fde05145ccdf32f8d7dee3d509a35559247343 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,27 @@ The LZMA SDK provides the documentation, samples, header files, libraries, and t #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +1. 基于LZMA SDK 19.00版本构建。 + +2. 基于7zip模块的LzmaCon目录代码部分,提供lzma命令。 #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +本项目主要提供一个lzma命令,供对lzma压缩算法的7z文件进行以下操作: + +1. 列出、提取7z文件; + +2. 列出、提取加密(密码保护)的7z文件; + +3. 列表,提取加密(密码保护)+加密头(无可见内容,文件列表,无密码)7z文件; + +4. 创建7z压缩文档; + +5. 创建加密(密码保护)7z压缩文档; + +6. 创建加密(密码保护)+加密头(无可见内容,文件列表,无密码)7z存档。 + +具体使用方法可以使用lzma --help获取 #### 参与贡献 diff --git a/lzma1900.7z b/lzma1900.7z new file mode 100644 index 0000000000000000000000000000000000000000..d0f20aa31f2ee22fbcb4a6ff751da51f4bad9359 Binary files /dev/null and b/lzma1900.7z differ