diff --git a/.gitignore b/.gitignore index e69de29..aee5fc6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/python-pyaes-1.6.0.tar.gz diff --git a/python-pyaes-0001-Use-relative-imports-during-tests.patch b/python-pyaes-0001-Use-relative-imports-during-tests.patch new file mode 100644 index 0000000..bb32d56 --- /dev/null +++ b/python-pyaes-0001-Use-relative-imports-during-tests.patch @@ -0,0 +1,54 @@ +From: Peter Lemenkov +Date: Fri, 31 Mar 2017 17:49:01 +0300 +Subject: [PATCH] Use relative imports during tests + +Sometimes you're testing package not from ~/Projects/pyaes or something, +but from ~/Projects/python-pyaes. Let's allow people to rename a +project's top-level directory. + +Also let's allow run tests from ./tests/ as well. + +Signed-off-by: Peter Lemenkov + +diff --git a/tests/test-aes.py b/tests/test-aes.py +index afa59aa..35d0a4f 100644 +--- a/tests/test-aes.py ++++ b/tests/test-aes.py +@@ -22,7 +22,8 @@ + + + import sys +-sys.path.append('../pyaes') ++sys.path.append('./') ++sys.path.append('../') + + from pyaes import * + +diff --git a/tests/test-blockfeeder.py b/tests/test-blockfeeder.py +index 41bd487..9781253 100644 +--- a/tests/test-blockfeeder.py ++++ b/tests/test-blockfeeder.py +@@ -22,7 +22,8 @@ + + + import sys +-sys.path.append('../pyaes') ++sys.path.append('./') ++sys.path.append('../') + + import os + import random +diff --git a/tests/test-util.py b/tests/test-util.py +index db30918..3b1ae7e 100644 +--- a/tests/test-util.py ++++ b/tests/test-util.py +@@ -22,7 +22,8 @@ + + + import sys +-sys.path.append('../pyaes') ++sys.path.append('./') ++sys.path.append('../') + + from pyaes.util import append_PKCS7_padding, strip_PKCS7_padding + diff --git a/python-pyaes.spec b/python-pyaes.spec new file mode 100644 index 0000000..e1d4c00 --- /dev/null +++ b/python-pyaes.spec @@ -0,0 +1,83 @@ +%global srcname pyaes + + +Name: python-%{srcname} +Version: 1.6.0 +Release: 1%{?dist} +Summary: Pure-Python implementation of AES block-cipher and common modes of operation +Group: Development/Languages +License: MIT +URL: https://github.com/ricmoo/%{srcname} +Source0: https://github.com/ricmoo/%{srcname}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch1: python-pyaes-0001-Use-relative-imports-during-tests.patch +BuildArch: noarch + + +%description +A pure-Python implementation of the AES block cipher algorithm and the common +modes of operation (CBC, CFB, CTR, ECB and OFB). + + +%package -n python2-%{srcname} +Summary: %{summary} +BuildRequires: python2-crypto +BuildRequires: python2-devel +%{?python_provide:%python_provide python2-%{srcname}} + + +%description -n python2-%{srcname} +A pure-Python implementation of the AES block cipher algorithm and the common +modes of operation (CBC, CFB, CTR, ECB and OFB). + + +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-crypto +BuildRequires: python3-devel +%{?python_provide:%python_provide python3-%{srcname}} + + +%description -n python3-%{srcname} +A pure-Python implementation of the AES block cipher algorithm and the common +modes of operation (CBC, CFB, CTR, ECB and OFB). + + +%prep +%autosetup -p1 -n %{srcname}-%{version} + + +%build +%py2_build +%py3_build + + +%install +%py2_install +%py3_install + + +%check +%{__python2} tests/test-aes.py +%{__python2} tests/test-blockfeeder.py +%{__python2} tests/test-util.py + +%{__python3} tests/test-aes.py +%{__python3} tests/test-blockfeeder.py +%{__python3} tests/test-util.py + + +%files -n python2-%{srcname} +%license LICENSE.txt +%doc README.md +%{python2_sitelib}/* + + +%files -n python3-%{srcname} +%license LICENSE.txt +%doc README.md +%{python3_sitelib}/* + + +%changelog +* Fri Mar 31 2017 Peter Lemenkov - 1.6.0-1 +- Initial build diff --git a/sources b/sources index e69de29..565b416 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (python-pyaes-1.6.0.tar.gz) = e9886cd09e9c803ecd71d72716c33b2721daab940356300726e34951cae945c995b3057e9574299585b77a0bd96058b505a07bfd146dcaf04db63c0ac251d454