Skip to content

Commit 5b7204d

Browse files
extras: add an rpm spec file
This spec file can be used to generate RPMs from the source tarball. I've tried to use as many contemporary best practices for writing a python specfile from the fedora docs: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/ Signed-off-by: John Mulligan <[email protected]>
1 parent 22f019b commit 5b7204d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

extras/python-sambacc.spec

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
%global bname sambacc
2+
# set xversion to define the default version number
3+
%define xversion 0.1
4+
# set pversion for a customized python package version string
5+
%{?!pversion: %define pversion %{xversion}}
6+
# set rversion for a customized rpm version
7+
%{?!rversion: %define rversion %{xversion}}
8+
9+
10+
Name: python-%{bname}
11+
Version: %{rversion}
12+
Release: 1%{?dist}
13+
Summary: Samba Container Configurator
14+
15+
License: GPLv3+
16+
URL: https://github.com/samba-in-kubernetes/sambacc
17+
# sambacc is not released yet so we're leaving off the url for now
18+
# once packaged and released we can update this field
19+
Source: %{bname}-%{pversion}.tar.gz
20+
21+
BuildArch: noarch
22+
BuildRequires: python3-devel
23+
24+
%global _description %{expand:
25+
A Python library and set of CLI tools intended to act as a bridge between a container
26+
environment and Samba servers and utilities. It aims to consolidate, coordinate and
27+
automate all of the low level steps of setting up smbd, users, groups, and other
28+
supporting components.
29+
}
30+
31+
%description %_description
32+
33+
%package -n python3-%{bname}
34+
Summary: %{summary}
35+
# Distro requires that are technially optional for the lib
36+
Requires: python3-samba
37+
Requires: python3-pyxattr
38+
39+
%description -n python3-%{bname} %_description
40+
41+
42+
%prep
43+
%autosetup -n %{bname}-%{pversion}
44+
45+
%generate_buildrequires
46+
%pyproject_buildrequires -e py3
47+
48+
49+
%build
50+
%pyproject_wheel
51+
52+
53+
%install
54+
%pyproject_install
55+
%pyproject_save_files %{bname}
56+
57+
58+
%check
59+
%tox -e py3
60+
61+
62+
%files -n python3-%{bname} -f %{pyproject_files}
63+
%doc README.*
64+
%{_bindir}/samba-container
65+
%{_bindir}/samba-dc-container
66+
%{_datadir}/%{bname}/examples/
67+
68+
69+
%changelog

0 commit comments

Comments
 (0)