From b50bb184c5af2dad36f99eb0abfaf1a878d0a1c0 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Oct 01 2015 18:11:44 +0000 Subject: Initial packaging --- diff --git a/.gitignore b/.gitignore index e69de29..61d391f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/custodia-0.1.0.tar.gz diff --git a/0001-Allow-tox-to-use-locally-installed-packages.patch b/0001-Allow-tox-to-use-locally-installed-packages.patch new file mode 100644 index 0000000..ca9b598 --- /dev/null +++ b/0001-Allow-tox-to-use-locally-installed-packages.patch @@ -0,0 +1,60 @@ +From 88d03775870a5247ac01cb85742402c0e2ed8dd1 Mon Sep 17 00:00:00 2001 +From: Simo Sorce +Date: Mon, 3 Aug 2015 14:28:10 -0400 +Subject: [PATCH] Allow tox to use locally installed packages + +Signed-off-by: Simo Sorce +--- + tox.ini | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tox.ini b/tox.ini +index e737ba262f7fe608256caef781ef44537ee8bd08..3572322077bbe87daa0b9d73e4c27e46d45c9997 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -7,6 +7,7 @@ deps = + coverage + -r{toxinidir}/requirements.txt + cryptography ++sitepackages = True + commands = + coverage run -m pytest --capture=no --strict {posargs} + coverage report -m +@@ -17,6 +18,7 @@ deps = + flake8 + flake8-import-order + pep8-naming ++sitepackages = True + commands = + flake8 {posargs} + +@@ -26,15 +28,17 @@ deps = + flake8 + flake8-import-order + pep8-naming ++sitepackages = True + commands = + flake8 {posargs} + + [testenv:doc] ++basepython = python2.7 + deps = + doc8 + docutils + markdown +-basepython = python2.7 ++sitepackages = True + commands = + doc8 --allow-long-titles README + python setup.py check --restructuredtext --metadata --strict +@@ -43,6 +47,7 @@ commands = + + [testenv:sphinx] + basepython = python2.7 ++sitepackages = True + changedir = docs/source + deps = + sphinx < 1.3.0 +-- +2.4.2 + diff --git a/custodia-0.1.0.tar.gz.sha512sum.txt b/custodia-0.1.0.tar.gz.sha512sum.txt new file mode 100644 index 0000000..c58d770 --- /dev/null +++ b/custodia-0.1.0.tar.gz.sha512sum.txt @@ -0,0 +1 @@ +a7030b61299305955f4935a43b1caf5f9e4c84434cbca6ce4d7407a3d5e75d42547b693397482d57ed93677ded5194d97b20a87368c75ae30f275d492c45c9fb dist/custodia-0.1.0.tar.gz diff --git a/custodia.spec b/custodia.spec new file mode 100644 index 0000000..ccabfb2 --- /dev/null +++ b/custodia.spec @@ -0,0 +1,107 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + +Name: custodia +Version: 0.1.0 +Release: 1%{?dist} +Summary: A service to manage, retrieve and store secrets for other processes. + +License: GPLv3+ +URL: https://github.com/simo5/%{name} +Source0: https://github.com/simo5/%{name}/releases/download/v%{version}/custodia-%{version}.tar.gz +Source1: https://github.com/simo5/%{name}/releases/download/v%{version}/custodia-%{version}.tar.gz.sha512sum.txt + +BuildArch: noarch + +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: python-jwcrypto +BuildRequires: python-tox +BuildRequires: python-coverage +BuildRequires: pytest +Requires: python-jwcrypto +Requires: python-custodia + +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-jwcrypto +%endif + +Patch01: 0001-Allow-tox-to-use-locally-installed-packages.patch + +%description +A service to manage, retrieve and store secrets for other processes. + +%package -n python-custodia +Summary: Subpackage with python custodia modules +Requires: python-jwcrypto + +%description -n python-custodia +Subpackage with python custodia modules + +%if 0%{?with_python3} +%package -n python3-custodia +Summary: Subpackage with python3 custodia modules +Requires: python3-jwcrypto + +%description -n python3-custodia +Subpackage with python custodia modules +%endif + +%prep +grep `sha512sum %{SOURCE0}` %{SOURCE1} || (echo "Checksum invalid!" && exit 1) +%autosetup + +%build +%{__python2} setup.py build +%if 0%{?with_python3} +%{__python3} setup.py build +%endif + + +%check +mkdir docs/source/_static +tox -e py27 +%if 0%{?with_python3} +tox -e py34 +%endif + + +%install +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +mv %{buildroot}/usr/share/doc/custodia _doc_staging +rm -rf %{buildroot}%{python2_sitelib}/%{name}/tests +rm -rf %{buildroot}%{python2_sitelib}/%{name}/__pycache__/tests +mkdir -p %{buildroot}/%{_sbindir} +mv %{buildroot}/%{_bindir}/custodia %{buildroot}/%{_sbindir}/custodia +%if 0%{?with_python3} +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} +rm -rf %{buildroot}/usr/share/doc/custodia +rm -rf %{buildroot}%{python3_sitelib}/%{name}/tests +rm -rf %{buildroot}%{python3_sitelib}/%{name}/__pycache__/tests +rm -rf %{buildroot}/%{_bindir}/custodia +%endif + + +%files +%doc README API.md _doc_staging/* +%license LICENSE +%{_mandir}/man7/custodia* +%{_sbindir}/custodia + +%files -n python-custodia +%license LICENSE +%{python2_sitelib}/* + +%if 0%{?with_python3} +%files -n python3-custodia +%license LICENSE +%{python3_sitelib}/* +%endif + + +%changelog +* Mon Aug 17 2015 Simo Sorce - 0.1.0-1 +- Initial packaging diff --git a/sources b/sources index e69de29..54966b9 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +fa3c2610c8175028c4d29a5938a7e350 custodia-0.1.0.tar.gz