-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnf-plugin-offline-upgrade.spec
107 lines (94 loc) · 2.86 KB
/
dnf-plugin-offline-upgrade.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
%{?!dnf_lowest_compatible: %global dnf_lowest_compatible 2.7.0}
%{?!dnf_not_compatible: %global dnf_not_compatible 3.0}
%global hawkey_version 0.7.0
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif
Name: dnf-plugin-offline-upgrade
Version: 0.1.0
Release: 1%{?dist}
Summary: Offline Upgrade Plugin for DNF
License: GPLv2+
URL: https://github.com/leapp-to/dnf-plugin-offline-upgrade
Source0: %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: cmake
%if %{with python3}
Requires: python3-%{name} = %{version}-%{release}
%else
Requires: python2-%{name} = %{version}-%{release}
%endif
Provides: dnf-command(offline-upgrade)
Provides: dnf-plugin-offline-upgrade = %{version}-%{release}
%description
Offline Upgrade Plugin for DNF
%package -n python2-%{name}
Summary: Offline Upgrade Plugin for DNF
%{?python_provide:%python_provide python2-%{name}}
BuildRequires: python2-dnf >= %{dnf_lowest_compatible}
BuildRequires: python2-dnf < %{dnf_not_compatible}
BuildRequires: python2-devel
Requires: python2-dnf >= %{dnf_lowest_compatible}
Requires: python2-dnf < %{dnf_not_compatible}
Requires: python2-hawkey >= %{hawkey_version}
Provides: python2-%{name} = %{version}-%{release}
Conflicts: python3-%{name} < %{version}-%{release}
Conflicts: python-%{name} < %{version}-%{release}
%description -n python2-%{name}
Offline Upgrade Plugin for DNF
%if %{with python3}
%package -n python3-%{name}
Summary: Offline Upgrade Plugin for DNF
%{?python_provide:%python_provide python3-%{name}}
BuildRequires: python3-devel
BuildRequires: python3-dnf >= %{dnf_lowest_compatible}
BuildRequires: python3-dnf < %{dnf_not_compatible}
Requires: python3-dnf >= %{dnf_lowest_compatible}
Requires: python3-dnf < %{dnf_not_compatible}
Requires: python3-hawkey >= %{hawkey_version}
Provides: python3-%{name} = %{version}-%{release}
Conflicts: python2-%{name} < %{version}-%{release}
Conflicts: python-%{name} < %{version}-%{release}
%description -n python3-%{name}
Offline Upgrade Plugin for DNF
%endif
%prep
%autosetup
mkdir build-py2
%if %{with python3}
mkdir build-py3
%endif
%build
pushd build-py2
%cmake ../
%make_build
popd
%if %{with python3}
pushd build-py3
%cmake ../ -DPYTHON_DESIRED:str=3
%make_build
popd
%endif
%install
pushd build-py2
%make_install
popd
%if %{with python3}
pushd build-py3
%make_install
popd
%endif
%files -n python2-%{name}
%doc README.rst
%{python2_sitelib}/dnf-plugins/offline_upgrade.*
%if %{with python3}
%files -n python3-%{name}
%doc README.rst
%{python3_sitelib}/dnf-plugins/offline_upgrade.py
%{python3_sitelib}/dnf-plugins/__pycache__/offline_upgrade.*
%endif
%changelog
* Tue Jun 05 2018 Arthur Mello <[email protected]> - 0.1.0-1
- Initial build