diff --git a/.gitignore b/.gitignore index e69de29..ce8f3de 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/jwcrypto-0.2.0.tar.gz diff --git a/jwcrypto-0.2.0.tar.gz.sha512sum.txt b/jwcrypto-0.2.0.tar.gz.sha512sum.txt new file mode 100644 index 0000000..69ed504 --- /dev/null +++ b/jwcrypto-0.2.0.tar.gz.sha512sum.txt @@ -0,0 +1 @@ +16b21892b067f8e8e081f51d735884930b6b5866b6bf63b854d901dc3c371d63b9810902f498b2e3df7c9128ea566734eb71874b79e11ef380563f10f9f63410 dist/jwcrypto-0.2.0.tar.gz diff --git a/python-jwcrypto.spec b/python-jwcrypto.spec new file mode 100644 index 0000000..7369daa --- /dev/null +++ b/python-jwcrypto.spec @@ -0,0 +1,105 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + +%define module_name jwcrypto + +Name: python-jwcrypto +Version: 0.2.0 +Release: 5%{?dist} +Summary: Implements JWK,JWS,JWE specifications using python-cryptography + +License: LGPLv3+ +URL: https://github.com/simo5/%{module_name} +Source0: https://github.com/simo5/%{module_name}/releases/download/v%{version}/jwcrypto-%{version}.tar.gz +Source1: https://github.com/simo5/%{module_name}/releases/download/v%{version}/jwcrypto-%{version}.tar.gz.sha512sum.txt + +BuildArch: noarch +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: python-cryptography +BuildRequires: python-nose +Requires: python-cryptography + +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-cryptography +BuildRequires: python3-nose +%endif + +%description +Implements JWK,JWS,JWE specifications using python-cryptography + +%if 0%{?with_python3} +%package -n python3-jwcrypto +Summary: Implements JWK,JWS,JWE specifications using python3-cryptography +Requires: python3-cryptography + +%description -n python3-jwcrypto +Implements JWK,JWS,JWE specifications using python3-cryptography +%endif + +%prep +grep `sha512sum %{SOURCE0}` %{SOURCE1} || (echo "Checksum invalid!" && exit 1) +%setup -q -n %{module_name}-%{version} + + +%build +%{__python2} setup.py build +%if 0%{?with_python3} +%{__python3} setup.py build +%endif + + +%check +nosetests + + +%install +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +%if 0%{?with_python3} +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} +%endif +rm -rf %{buildroot}%{_docdir}/%{module_name} +rm -rf %{buildroot}%{python2_sitelib}/%{module_name}/tests{,-cookbook}.py* +%if 0%{?with_python3} +rm -rf %{buildroot}%{python3_sitelib}/%{module_name}/tests{,-cookbook}.py* +rm -rf %{buildroot}%{python3_sitelib}/%{module_name}/__pycache__/tests{,-cookbook}.*.py* +%endif + + +%files +%doc README.md +%license LICENSE +%{python_sitelib}/* + +%if 0%{?with_python3} +%files -n python3-jwcrypto +%doc README.md +%license LICENSE +%{python3_sitelib}/* +%endif + + +%changelog +* Mon Jun 22 2015 Patrick Uiterwijk - 0.2.0-5 +- Fix macro in changelog +- Remove the last remnants of the test suite + +* Wed Jun 17 2015 Patrick Uiterwijk - 0.2.0-4 +- Ship readme and license with python3 subpackage +- Move tests to %%check + +* Wed Jun 17 2015 Patrick Uiterwijk - 0.2.0-3 +- Fix F21 build error by adding buildrequire python-setuptools +- Move files into python3-jwcrypto subpackage +- Run test suite +- Do not install test suite +- Fix summary and description of python3-jwcrypto + +* Tue Jun 16 2015 Patrick Uiterwijk - 0.2.0-2 +- Enable python3 build + +* Tue Jun 16 2015 Patrick Uiterwijk - 0.2.0-1 +- Initial packaging diff --git a/sources b/sources index e69de29..d64bf59 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +f4941655c4a65ba6b519d14740d59b58 jwcrypto-0.2.0.tar.gz