-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsuse-migration-services-spec-template
217 lines (179 loc) · 7.72 KB
/
suse-migration-services-spec-template
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#
# spec file for package suse-migration-services
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} >= 1600
%define pythons %{primary_python}
%else
%define pythons python3
%endif
%global _sitelibdir %{%{pythons}_sitelib}
Name: suse-migration-services
Version: %%VERSION
Release: 0
Url: https://github.com/SUSE/suse-migration-services
Summary: SUSE Distribution Migration Services
License: GPL-3.0+
Group: System/Management
Source: suse-migration-services.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{pythons}-setuptools
BuildRequires: %{pythons}-Cerberus
BuildRequires: %{pythons}-PyYAML
%if 0%{?suse_version} >= 1600
BuildRequires: %{pythons}-pip
BuildRequires: %{pythons}-wheel
%endif
BuildRequires: systemd-rpm-macros
Requires: %{pythons}-Cerberus
Requires: %{pythons}-PyYAML
Requires: %{pythons}-setuptools
Requires: %{pythons}-migration
Requires: util-linux
Requires: kexec-tools
Requires: ca-certificates
Requires: dialog
Requires: rsync
Requires: suseconnect-ng
Requires: suse-migration-services = %{version}-%{release}
Requires(preun): systemd
Requires(postun): systemd
BuildArch: noarch
%description
Systemd services to prepare and run a distribution migration process.
%package -n %{pythons}-migration
Summary: The systemd services for the python migration module
Group: System/Management
%description -n %{pythons}-migration
Python based implementation for suse major code stream upgrade system
%package -n suse-migration-pre-checks
Summary: The pre-checks code used with the python migration module
Group: System/Management
Requires: %{pythons}-migration
Conflicts: suse-migration-sle15-activation < 2.0.33
%description -n suse-migration-pre-checks
Checks to be performed before starting a distribution migration process
%package -n suse-migration
Summary: The migrate tool for a container based upgrade
Group: System/Management
Requires: podman
Requires: sudo
BuildArch: noarch
%description -n suse-migration
The migrate tool to start the migration as container based process
%prep
%setup -q -n suse_migration_services-%{version}
%build
%if 0%{?suse_version} >= 1600
%pyproject_wheel
%else
%{pythons} setup.py build
%endif
%install
%if 0%{?suse_version} >= 1600
%pyproject_install
%else
%{pythons} setup.py install --prefix=%{_prefix} --root=%{buildroot}
%endif
install -D -m 755 tools/run_migration \
%{buildroot}%{_sbindir}/run_migration
install -D -m 644 systemd/suse-migration-mount-system.service \
%{buildroot}%{_unitdir}/suse-migration-mount-system.service
install -D -m 644 systemd/suse-migration-pre-checks.service \
%{buildroot}%{_unitdir}/suse-migration-pre-checks.service
install -D -m 644 systemd/suse-migration-post-mount-system.service \
%{buildroot}%{_unitdir}/suse-migration-post-mount-system.service
install -D -m 644 systemd/suse-migration-setup-host-network.service \
%{buildroot}%{_unitdir}/suse-migration-setup-host-network.service
install -D -m 644 systemd/suse-migration-prepare.service \
%{buildroot}%{_unitdir}/suse-migration-prepare.service
install -D -m 644 systemd/suse-migration.service \
%{buildroot}%{_unitdir}/suse-migration.service
install -D -m 644 systemd/suse-migration-container.service \
%{buildroot}%{_unitdir}/suse-migration-container.service
install -D -m 644 systemd/suse-migration-container-prepare.service \
%{buildroot}%{_unitdir}/suse-migration-container-prepare.service
install -D -m 644 systemd/suse-migration-container-product-setup.service \
%{buildroot}%{_unitdir}/suse-migration-container-product-setup.service
install -D -m 644 systemd/suse-migration-container-reboot.service \
%{buildroot}%{_unitdir}/suse-migration-container-reboot.service
install -D -m 644 systemd/suse-migration-container-emergency.service \
%{buildroot}%{_unitdir}/suse-migration-container-emergency.service
install -D -m 644 systemd/suse-migration-grub-setup.service \
%{buildroot}%{_unitdir}/suse-migration-grub-setup.service
install -D -m 644 systemd/suse-migration-update-bootloader.service \
%{buildroot}%{_unitdir}/suse-migration-update-bootloader.service
install -D -m 644 systemd/suse-migration-product-setup.service \
%{buildroot}%{_unitdir}/suse-migration-product-setup.service
install -D -m 644 systemd/suse-migration-regenerate-initrd.service \
%{buildroot}%{_unitdir}/suse-migration-regenerate-initrd.service
install -D -m 644 systemd/suse-migration-kernel-load.service \
%{buildroot}%{_unitdir}/suse-migration-kernel-load.service
install -D -m 644 systemd/suse-migration-reboot.service \
%{buildroot}%{_unitdir}/suse-migration-reboot.service
install -D -m 644 systemd/suse-migration-ssh-keys.service \
%{buildroot}%{_unitdir}/suse-migration-ssh-keys.service
install -D -m 644 systemd/suse-migration-console-log.service \
%{buildroot}%{_unitdir}/suse-migration-console-log.service
install -D -m 755 tools/migrate \
%{buildroot}%{_sbindir}/migrate
# preun / postun
# While the package provides services all services are one-shot.
# Additionally this services runs as part of a live ISO migration
# system which is used and booted only once. It's contents are
# packed into a readonly squashfs layer. Therefore there is no
# need for use of the "standard" systemd service handling macros.
%files
%{_sbindir}/run_migration
%{_bindir}/suse-migration-ssh-keys
%{_bindir}/suse-migration-mount-system
%{_bindir}/suse-migration-post-mount-system
%{_bindir}/suse-migration-setup-host-network
%{_bindir}/suse-migration-prepare
%{_bindir}/suse-migration
%{_bindir}/suse-migration-grub-setup
%{_bindir}/suse-migration-update-bootloader
%{_bindir}/suse-migration-product-setup
%{_bindir}/suse-migration-regenerate-initrd
%{_bindir}/suse-migration-kernel-load
%{_bindir}/suse-migration-reboot
%{_unitdir}/suse-migration-ssh-keys.service
%{_unitdir}/suse-migration-mount-system.service
%{_unitdir}/suse-migration-post-mount-system.service
%{_unitdir}/suse-migration-setup-host-network.service
%{_unitdir}/suse-migration-prepare.service
%{_unitdir}/suse-migration.service
%{_unitdir}/suse-migration-container.service
%{_unitdir}/suse-migration-container-prepare.service
%{_unitdir}/suse-migration-container-product-setup.service
%{_unitdir}/suse-migration-container-reboot.service
%{_unitdir}/suse-migration-container-emergency.service
%{_unitdir}/suse-migration-console-log.service
%{_unitdir}/suse-migration-grub-setup.service
%{_unitdir}/suse-migration-update-bootloader.service
%{_unitdir}/suse-migration-product-setup.service
%{_unitdir}/suse-migration-regenerate-initrd.service
%{_unitdir}/suse-migration-kernel-load.service
%{_unitdir}/suse-migration-reboot.service
%files -n %{pythons}-migration
%{python_sitelib}/*
%files -n suse-migration-pre-checks
%{_bindir}/suse-migration-pre-checks
%{_unitdir}/suse-migration-pre-checks.service
%files -n suse-migration
%{_sbindir}/migrate
%changelog