/
python-bareos.spec
65 lines (52 loc) · 1.71 KB
/
python-bareos.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%global srcname bareos
%if 0%{?rhel} || 0%{?suse_version} == 1110 || 0%{?suse_version} == 1315
%bcond_without python2
%else
%bcond_with python2
%endif
%if 0%{?with_python2}
%global PYVER 2
%define noarch 0
%else
%global PYVER 3
%define noarch 1
%endif
%global pyXsuf %{PYVER}
%global pyXcmd python%{PYVER}
Name: python-%{srcname}
Version: 0.3
Release: 1%{?dist}
Summary: Python module to interact with a Bareos backup system
Group: Productivity/Archiving/Backup
License: AGPL-3.0
URL: https://github.com/joergsteffens/python-bareos/
#Source0: http://pypi.python.org/packages/source/e/%%{srcname}/%%{srcname}-%%{version}.tar.gz
Source: %{name}-%{version}.tar.gz
BuildRequires: python-devel python-setuptools
%if %noarch
BuildArch: noarch
%endif
%{?python_provide:%python_provide python-%{srcname}}
%description
A python module to interact with a Bareos backup system. Also some tools based on this module.
%define pyX_sitelib %(%{pyXcmd} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%prep
%setup -q
%build
%{pyXcmd} setup.py build
%install
# Must do the python2 install first because the scripts in /usr/bin are
# overwritten with every setup.py install, and in general we want the
# python3 version to be the default.
%{pyXcmd} setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
# does not work, as it tries to download other packages from pip
#%%{__python2} setup.py test
#%%{pyXcmd} setup.py -q test
# Note that there is no %%files section for the unversioned python module if we are building for several python runtimes
%files
%defattr(-,root,root,-)
%doc README.rst
%{pyX_sitelib}/*
%{_bindir}/*
%changelog