From 9901de71b6bf94b00047e03e5b1083b1ed4d80f9 Mon Sep 17 00:00:00 2001 From: Kevin Michel Date: Wed, 27 Apr 2022 13:59:18 +0200 Subject: [PATCH] packaging: add RPM package --- CONTRIBUTING.md | 10 +++++++++- Makefile | 18 ++++++++++++++++++ pyproject.toml | 3 +++ rohmu.spec | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 pyproject.toml create mode 100644 rohmu.spec diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 379daf63..ef7825d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,15 @@ Contributions are very welcome on {{ PROJECT }}. When contributing please keep t ## Manual testing -### Configuration +## Building the package + +### On Fedora +```shell +sudo make fedora-dev-setup +make rpm +``` + +## Configuration # Opening a PR diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..0e3e2c05 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +short_ver = $(shell git describe --abbrev=0 --always) +long_ver = $(shell git describe --long 2>/dev/null || echo $(short_ver)-0-unknown-g`git describe --always`) + +.DEFAULT_GOAL := rpm + +.PHONY: fedora-dev-setup +fedora-dev-setup: + dnf builddep -y rohmu.spec + +.PHONY: rpm +rpm: rohmu/ + git archive --output=rohmu-rpm-src.tar --prefix=rohmu/ HEAD + rpmbuild -bb rohmu.spec \ + --define '_topdir $(PWD)/rpm' \ + --define '_sourcedir $(CURDIR)' \ + --define 'major_version $(short_ver)' \ + --define 'minor_version $(subst -,.,$(subst $(short_ver)-,,$(long_ver)))' + $(RM) rohmu-rpm-src.tar diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..7e01ab27 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ['setuptools', 'wheel'] +build-backend = 'setuptools.build_meta' diff --git a/rohmu.spec b/rohmu.spec new file mode 100644 index 00000000..d46a3d24 --- /dev/null +++ b/rohmu.spec @@ -0,0 +1,47 @@ +Name: rohmu +Version: %{major_version} +Release: %{minor_version}%{?dist} +Url: https://github.com/aiven/rohmu +Summary: Object storage encryption and compression library +License: ASL 2.0 +Source0: rohmu-rpm-src.tar +Requires: python3-botocore +Requires: python3-cryptography >= 0.8 +Requires: python3-dateutil +Requires: python3-pydantic +Requires: python3-requests +Requires: python3-snappy +Requires: python3-zstandard +BuildRequires: python3-devel +BuildRequires: python3-flake8 +BuildRequires: python3-pylint +BuildRequires: python3-pytest + +%undefine _missing_build_ids_terminate_build +%define debug_package %{nil} + +%description +Rohmu is an object storage encryption and compression library meant for backups. +Rohmu currently supports Amazon Web Services S3, Google Cloud Storage, +OpenStack Swift and Ceph (using S3 or Swift interfaces with RadosGW). +Support for Microsoft Azure is experimental. + +%{?python_disable_dependency_generator} + +%prep +%setup -q -n rohmu + +%build + +%install +python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} + +%files +%defattr(-,root,root,-) +%doc README.md +%license LICENSE +%{python3_sitelib}/* + +%changelog +* Wed Apr 27 2022 Kevin Michel - 1.0.0 +- Initial RPM package spec