summaryrefslogtreecommitdiff
path: root/python-pyminizip.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-pyminizip.spec')
-rw-r--r--python-pyminizip.spec288
1 files changed, 288 insertions, 0 deletions
diff --git a/python-pyminizip.spec b/python-pyminizip.spec
new file mode 100644
index 0000000..be51641
--- /dev/null
+++ b/python-pyminizip.spec
@@ -0,0 +1,288 @@
+%global _empty_manifest_terminate_build 0
+Name: python-pyminizip
+Version: 0.2.6
+Release: 1
+Summary: A minizip wrapper - To create a password encrypted zip file in python.
+License: zlib/libpng License
+URL: https://github.com/smihica/pyminizip
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1b/b4/b5584325a03acfbca05922700ab9195b5875a936dc23960224087088a409/pyminizip-0.2.6.tar.gz
+BuildArch: noarch
+
+
+%description
+## pyminizip
+
+To create a password encrypted zip file in python.
+And the zip file is able to extract in WINDOWS.
+
+This is a simple Minizip wrapper of python.
+(http://www.winimage.com/zLibDll/minizip.html)
+
+This software uses zlib.
+License: zlib/libpng License.
+
+## Install
+```
+$ pip install pyminizip
+```
+
+## Install zlib
+```
+# linux
+$ sudo apt-get install zlib
+# mac
+$ xcode-select --install
+$ brew install zlib
+```
+
+## How to use
+
+This package just provides three functions.
+
+```
+pyminizip.compress("/srcfile/path.txt", "file_path_prefix", "/distfile/path.zip", "password", int(compress_level))
+```
+
+ Args:
+ 1. src file path (string)
+ 2. src file prefix path (string) or None (path to prepend to file)
+ 3. dst file path (string)
+ 4. password (string) or None (to create no-password zip)
+ 5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress) or 0 (default)
+
+ Return value:
+ - always returns None
+
+```
+pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)
+```
+
+ Args:
+ 1. src file LIST path (list)
+ 2. src file LIST prefix path (list) or []
+ 3. dst file path (string)
+ 4. password (string) or None (to create no-password zip)
+ 5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress)
+ 6. optional function to be called during processing which takes one argument, the count of how many files have been compressed
+
+ Return value:
+ - always returns None
+
+```
+pyminizip.uncompress("/srcfile/path.zip", "password", "/dirtoextract", int(withoutpath))
+```
+
+ Args:
+ 1. src file path (string)
+ 2. password (string) or None (to unzip encrypted archives)
+ 3. dir path to extract files or None (to extract in a specific dir or cwd)
+ 4. withoutpath (exclude path of extracted)
+
+ Return value:
+ - always returns None
+
+
+
+
+%package -n python3-pyminizip
+Summary: A minizip wrapper - To create a password encrypted zip file in python.
+Provides: python-pyminizip
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-pyminizip
+## pyminizip
+
+To create a password encrypted zip file in python.
+And the zip file is able to extract in WINDOWS.
+
+This is a simple Minizip wrapper of python.
+(http://www.winimage.com/zLibDll/minizip.html)
+
+This software uses zlib.
+License: zlib/libpng License.
+
+## Install
+```
+$ pip install pyminizip
+```
+
+## Install zlib
+```
+# linux
+$ sudo apt-get install zlib
+# mac
+$ xcode-select --install
+$ brew install zlib
+```
+
+## How to use
+
+This package just provides three functions.
+
+```
+pyminizip.compress("/srcfile/path.txt", "file_path_prefix", "/distfile/path.zip", "password", int(compress_level))
+```
+
+ Args:
+ 1. src file path (string)
+ 2. src file prefix path (string) or None (path to prepend to file)
+ 3. dst file path (string)
+ 4. password (string) or None (to create no-password zip)
+ 5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress) or 0 (default)
+
+ Return value:
+ - always returns None
+
+```
+pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)
+```
+
+ Args:
+ 1. src file LIST path (list)
+ 2. src file LIST prefix path (list) or []
+ 3. dst file path (string)
+ 4. password (string) or None (to create no-password zip)
+ 5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress)
+ 6. optional function to be called during processing which takes one argument, the count of how many files have been compressed
+
+ Return value:
+ - always returns None
+
+```
+pyminizip.uncompress("/srcfile/path.zip", "password", "/dirtoextract", int(withoutpath))
+```
+
+ Args:
+ 1. src file path (string)
+ 2. password (string) or None (to unzip encrypted archives)
+ 3. dir path to extract files or None (to extract in a specific dir or cwd)
+ 4. withoutpath (exclude path of extracted)
+
+ Return value:
+ - always returns None
+
+
+
+
+%package help
+Summary: Development documents and examples for pyminizip
+Provides: python3-pyminizip-doc
+%description help
+## pyminizip
+
+To create a password encrypted zip file in python.
+And the zip file is able to extract in WINDOWS.
+
+This is a simple Minizip wrapper of python.
+(http://www.winimage.com/zLibDll/minizip.html)
+
+This software uses zlib.
+License: zlib/libpng License.
+
+## Install
+```
+$ pip install pyminizip
+```
+
+## Install zlib
+```
+# linux
+$ sudo apt-get install zlib
+# mac
+$ xcode-select --install
+$ brew install zlib
+```
+
+## How to use
+
+This package just provides three functions.
+
+```
+pyminizip.compress("/srcfile/path.txt", "file_path_prefix", "/distfile/path.zip", "password", int(compress_level))
+```
+
+ Args:
+ 1. src file path (string)
+ 2. src file prefix path (string) or None (path to prepend to file)
+ 3. dst file path (string)
+ 4. password (string) or None (to create no-password zip)
+ 5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress) or 0 (default)
+
+ Return value:
+ - always returns None
+
+```
+pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)
+```
+
+ Args:
+ 1. src file LIST path (list)
+ 2. src file LIST prefix path (list) or []
+ 3. dst file path (string)
+ 4. password (string) or None (to create no-password zip)
+ 5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress)
+ 6. optional function to be called during processing which takes one argument, the count of how many files have been compressed
+
+ Return value:
+ - always returns None
+
+```
+pyminizip.uncompress("/srcfile/path.zip", "password", "/dirtoextract", int(withoutpath))
+```
+
+ Args:
+ 1. src file path (string)
+ 2. password (string) or None (to unzip encrypted archives)
+ 3. dir path to extract files or None (to extract in a specific dir or cwd)
+ 4. withoutpath (exclude path of extracted)
+
+ Return value:
+ - always returns None
+
+
+
+
+%prep
+%autosetup -n pyminizip-0.2.6
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-pyminizip -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.6-1
+- Package Spec generated