-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpython3-lxc.spec
122 lines (96 loc) · 3.19 KB
/
python3-lxc.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
%global srcname python3-lxc
%if 0%{?rhel} == 7
# Optional python3.4 support for CentOS 7
%global with_python34 1
%endif
%if 0%{?with_python34}
%global __python34 /usr/bin/python3.4
%define python34_sitelib %(%{__python34} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%define python34_sitearch %(%{__python34} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%define python34_version %(%{__python34} -c "import sys; sys.stdout.write(sys.version[:3])")
%define python34_version_nodots %(%{__python34} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%define python34_platform %(%{__python34} -Ic "import sysconfig; print(sysconfig.get_platform())")
%define py34_build() %{expand:\\\
CFLAGS="%{optflags}" %{__python34} %{py_setup} %{?py_setup_args} build --executable="%{__python34} %{py3_shbang_opts}" %{?*}
sleep 1
}
%define py34_install() %{expand:\\\
CFLAGS="%{optflags}" %{__python34} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%endif
%if 0%{?rhel} == 7
Name: python36-lxc
%else
Name: %{srcname}
%endif
Version: 3.0.4
Release: 0.2%{?dist}
Summary: Python 3 bindings for LXC
Group: Development/Libraries
License: LGPLv2+
URL: https://linuxcontainers.org/lxc
Source0: https://linuxcontainers.org/downloads/lxc/%{srcname}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: lxc-devel >= 3
BuildRequires: pkgconfig(python3) >= 3.2
%if 0%{?rhel} == 7
BuildRequires: python36-setuptools
Provides: %{srcname} = %{version}-%{release}
%endif
%description
%{summary}
%if 0%{?with_python34}
%package -n python34-lxc
Summary: Python 3 bindings for LXC
BuildRequires: python34-devel
BuildRequires: python34-setuptools
%description -n python34-lxc
%{summary}
%endif
%prep
%autosetup -n %{srcname}-%{version}
# fix python shebang in examples
sed -i 's|/usr/bin/env python3|/usr/bin/python3|g' examples/*
chmod -x examples/*
%build
%py3_build
%if 0%{?with_python34}
%py34_build
%endif
%install
%py3_install
%if 0%{?with_python34}
%py34_install
%endif
%check
%files
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc README.md
%doc examples/
%{python3_sitearch}/*
%if 0%{?with_python34}
%files -n python34-lxc
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc README.md
%doc examples/
%{python34_sitearch}/*
%endif
%changelog
* Sat Sep 28 2019 Reto Gantenbein <[email protected]> 3.0.4-0.2
- Rebuild for EPEL-8
* Thu Aug 15 2019 Reto Gantenbein <[email protected]> 3.0.4-0.1
- Update to 3.0.4
- Build Python 3.4 and 3.6 packages for CentOS
- Install examples
* Wed Nov 28 2018 Reto Gantenbein <[email protected]> 3.0.3-0.1
- Update to 3.0.3
* Sat Sep 22 2018 Reto Gantenbein <[email protected]> 3.0.2-0.2
- Fix build no C compiler is in the base build environment
* Sat Sep 15 2018 Reto Gantenbein <[email protected]> 3.0.2-0.1
- Update to 3.0.2
* Wed Jun 20 2018 Reto Gantenbein <[email protected]> 3.0.1-0.2
- Fix dependency and upgrade issues on CentOS 7
* Sat Mar 31 2018 Reto Gantenbein <[email protected]> 3.0.1-0.1
- Initial package