summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-unrar-cffi.spec285
-rw-r--r--sources1
3 files changed, 287 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..fd43e2a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/unrar-cffi-0.2.2.tar.gz
diff --git a/python-unrar-cffi.spec b/python-unrar-cffi.spec
new file mode 100644
index 0000000..bcac8fe
--- /dev/null
+++ b/python-unrar-cffi.spec
@@ -0,0 +1,285 @@
+%global _empty_manifest_terminate_build 0
+Name: python-unrar-cffi
+Version: 0.2.2
+Release: 1
+Summary: Read RAR file from python -- cffi edition
+License: apache-2.0
+URL: https://github.com/davide-romanini/unrar-cffi
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/5e/86/69bb34ba96db686d05c27d8db00df5b524cacc21e0727cfe52fbf7e17e46/unrar-cffi-0.2.2.tar.gz
+
+Requires: python3-cffi
+
+%description
+[![Build Status](https://travis-ci.org/davide-romanini/unrar-cffi.svg?branch=develop)](https://travis-ci.org/davide-romanini/unrar-cffi)
+
+# unrar-cffi -- Work with RAR files.
+
+## Description
+
+unrar-cffi is a python extension that exposes [unrar library](https://rarlab.com/rar_add.htm)
+functionality through a [`zipfile`](https://docs.python.org/3/library/zipfile.html)-like interface.
+
+## Features
+
+The package implements the following `RarFile` functions:
+
+ * `namelist()`
+ * `infolist()`
+ * `getinfo()`
+ * `read()`
+ * `open()`
+ * `testrar()`
+ * `rarfile.is_rar_file()`
+
+## Usage
+
+ 1. Install with PIP:
+
+ `pip install unrar-cffi`
+
+ 2. Use from code:
+
+```python
+ from unrar.cffi import rarfile
+
+ rar = rarfile.RarFile('sample.rar')
+
+ assert rar.testrar() == None
+
+ for filename in rar.namelist():
+ info = rar.getinfo(filename)
+ print("Reading {}, {}, {} bytes ({} bytes compressed)".format(info.filename, info.date_time, info.file_size, info.compress_size))
+ data = rar.read(filename)
+ print("\t{}...\n".format(data[:100]))
+```
+
+## Build
+
+### Requirements
+
+Linux:
+ * gcc compiler suite (`build-essential` packages should be enough)
+ * docker (only for `buildmanylinux`)
+
+Windows:
+ * VS2017 Build Tools (PLATFORM_TOOLSET=v141)
+ * Visual C++ compiler suite
+
+### Compile and test
+
+ 1. `./build.sh init`
+ 2. `./build.sh build`
+ 3. `./build.sh test`
+
+If you have docker installed, you can build all the [manylinux](https://github.com/pypa/manylinux)
+wheels:
+
+ 1. `./build.sh within [manylinux docker image] buildmanylinux`
+ 2. `./build.sh within [manylinux docker image] testmanylinux`
+
+By deafult the image `quay.io/pypa/manylinux2010_x86_64` will be used.
+Use `$DOCKER_IMAGE` and `$PLAT` variables to customize the build.
+
+
+
+%package -n python3-unrar-cffi
+Summary: Read RAR file from python -- cffi edition
+Provides: python-unrar-cffi
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+BuildRequires: python3-cffi
+BuildRequires: gcc
+BuildRequires: gdb
+%description -n python3-unrar-cffi
+[![Build Status](https://travis-ci.org/davide-romanini/unrar-cffi.svg?branch=develop)](https://travis-ci.org/davide-romanini/unrar-cffi)
+
+# unrar-cffi -- Work with RAR files.
+
+## Description
+
+unrar-cffi is a python extension that exposes [unrar library](https://rarlab.com/rar_add.htm)
+functionality through a [`zipfile`](https://docs.python.org/3/library/zipfile.html)-like interface.
+
+## Features
+
+The package implements the following `RarFile` functions:
+
+ * `namelist()`
+ * `infolist()`
+ * `getinfo()`
+ * `read()`
+ * `open()`
+ * `testrar()`
+ * `rarfile.is_rar_file()`
+
+## Usage
+
+ 1. Install with PIP:
+
+ `pip install unrar-cffi`
+
+ 2. Use from code:
+
+```python
+ from unrar.cffi import rarfile
+
+ rar = rarfile.RarFile('sample.rar')
+
+ assert rar.testrar() == None
+
+ for filename in rar.namelist():
+ info = rar.getinfo(filename)
+ print("Reading {}, {}, {} bytes ({} bytes compressed)".format(info.filename, info.date_time, info.file_size, info.compress_size))
+ data = rar.read(filename)
+ print("\t{}...\n".format(data[:100]))
+```
+
+## Build
+
+### Requirements
+
+Linux:
+ * gcc compiler suite (`build-essential` packages should be enough)
+ * docker (only for `buildmanylinux`)
+
+Windows:
+ * VS2017 Build Tools (PLATFORM_TOOLSET=v141)
+ * Visual C++ compiler suite
+
+### Compile and test
+
+ 1. `./build.sh init`
+ 2. `./build.sh build`
+ 3. `./build.sh test`
+
+If you have docker installed, you can build all the [manylinux](https://github.com/pypa/manylinux)
+wheels:
+
+ 1. `./build.sh within [manylinux docker image] buildmanylinux`
+ 2. `./build.sh within [manylinux docker image] testmanylinux`
+
+By deafult the image `quay.io/pypa/manylinux2010_x86_64` will be used.
+Use `$DOCKER_IMAGE` and `$PLAT` variables to customize the build.
+
+
+
+%package help
+Summary: Development documents and examples for unrar-cffi
+Provides: python3-unrar-cffi-doc
+%description help
+[![Build Status](https://travis-ci.org/davide-romanini/unrar-cffi.svg?branch=develop)](https://travis-ci.org/davide-romanini/unrar-cffi)
+
+# unrar-cffi -- Work with RAR files.
+
+## Description
+
+unrar-cffi is a python extension that exposes [unrar library](https://rarlab.com/rar_add.htm)
+functionality through a [`zipfile`](https://docs.python.org/3/library/zipfile.html)-like interface.
+
+## Features
+
+The package implements the following `RarFile` functions:
+
+ * `namelist()`
+ * `infolist()`
+ * `getinfo()`
+ * `read()`
+ * `open()`
+ * `testrar()`
+ * `rarfile.is_rar_file()`
+
+## Usage
+
+ 1. Install with PIP:
+
+ `pip install unrar-cffi`
+
+ 2. Use from code:
+
+```python
+ from unrar.cffi import rarfile
+
+ rar = rarfile.RarFile('sample.rar')
+
+ assert rar.testrar() == None
+
+ for filename in rar.namelist():
+ info = rar.getinfo(filename)
+ print("Reading {}, {}, {} bytes ({} bytes compressed)".format(info.filename, info.date_time, info.file_size, info.compress_size))
+ data = rar.read(filename)
+ print("\t{}...\n".format(data[:100]))
+```
+
+## Build
+
+### Requirements
+
+Linux:
+ * gcc compiler suite (`build-essential` packages should be enough)
+ * docker (only for `buildmanylinux`)
+
+Windows:
+ * VS2017 Build Tools (PLATFORM_TOOLSET=v141)
+ * Visual C++ compiler suite
+
+### Compile and test
+
+ 1. `./build.sh init`
+ 2. `./build.sh build`
+ 3. `./build.sh test`
+
+If you have docker installed, you can build all the [manylinux](https://github.com/pypa/manylinux)
+wheels:
+
+ 1. `./build.sh within [manylinux docker image] buildmanylinux`
+ 2. `./build.sh within [manylinux docker image] testmanylinux`
+
+By deafult the image `quay.io/pypa/manylinux2010_x86_64` will be used.
+Use `$DOCKER_IMAGE` and `$PLAT` variables to customize the build.
+
+
+
+%prep
+%autosetup -n unrar-cffi-0.2.2
+
+%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-unrar-cffi -f filelist.lst
+%dir %{python3_sitearch}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.2-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..3da2ded
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+c43edb6a966263c6f1cb4c93e81665e4 unrar-cffi-0.2.2.tar.gz