Skip to content

Commit

Permalink
packaging: add RPM package
Browse files Browse the repository at this point in the history
  • Loading branch information
kmichel-aiven authored and rdunklau committed Apr 27, 2022
1 parent 12cda2a commit 9901de7
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ['setuptools', 'wheel']
build-backend = 'setuptools.build_meta'
47 changes: 47 additions & 0 deletions rohmu.spec
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> - 1.0.0
- Initial RPM package spec

0 comments on commit 9901de7

Please sign in to comment.