summaryrefslogtreecommitdiff
path: root/lorax.spec
blob: 4da09fcb5cecb129aeb0095410979a43bf9b8aa8 (plain)
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
%define debug_package %{nil}
%define disable_cross 0

Name:           lorax
Version:        33.6
Release:        12
Summary:        A set of tools used to create bootable images
License:        GPLv2+
URL:            https://github.com/weldr/lorax
Source0:        https://github.com/weldr/lorax/archive/%{name}-%{version}-1.tar.gz
Source1:        sw64.tar.gz
Source2:        0001-support-loongarch-for-lorax.patch
Source3:        0001-add-sw64-architecture.patch

Patch0:		0001-ignore-the-dir-that-without-kernel-version.patch
Patch1:		0001-add-text-mode-selection-menu-in-grub-configuration.patch
Patch2:		0001-use-tty0-other-than-ttyAMA0-in-rescue-mode.patch
Patch3:		0001-delete-kernel-modules-pkg.patch
Patch4:		0001-disable-isolabel-character-change.patch
Patch5:		disable-graphics-install.patch
Patch6:		disable-GeoIP.patch
Patch7:		eliminate-difference.patch
Patch8:		lorax-enable-GUI-installation.patch
Patch9:		lorax-enable-anaconda-KdumpSpoke.patch
Patch10:	lorax-delete-udisk2-iscsi.patch
Patch11:	backport-Do-not-use-loglevel-option-when-running-Anaconda.patch
Patch12:	backport-Improve-lmc-no-virt-error-handling.patch
Patch13:	backport-Add-POSTIN-scriptlet-error-to-the-log-monitor-list.patch
Patch14:	backport-Remove-LD_PRELOAD-libgomp.so.1-from-lmc-no-virt.patch
Patch15:        backport-runtime-install-don-t-install-notification-daemon.patch
Patch16:        add-param-name_prefix-to-make-name-used-by-register_blueprint-unique.patch
%ifarch loongarch64
Patch100:       0001-support-loongarch-for-lorax.patch
%endif
%ifarch sw_64
Patch200:       0001-add-sw64-architecture.patch
%endif

# openEuler summer ospp
Patch10000: summer-ospp-replace-isomd5sum-with-isosm3sum.patch

BuildRequires:  python3-devel python3-sphinx_rtd_theme python3-magic 
BuildRequires:  python3-pytest-mock python3-pocketlint python3-gevent
BuildRequires:  python3-mock python3-urllib3 python3-dnf python3-librepo 
BuildRequires:  python3-libselinux python3-mako python3-kickstart

Requires:       lorax-templates GConf2 cpio device-mapper dosfstools e2fsprogs
Requires:       findutils gawk xorriso glib2 glibc glibc-common gzip isosm3sum
Requires:       module-init-tools parted squashfs-tools util-linux xz-lzma-compat xz pigz
Requires:       pbzip2 dracut kpartx libselinux-python3 python3-mako python3-kickstart
Requires:       python3-dnf python3-librepo python3-pycdlib
      
%ifarch %{ix86} x86_64
Requires:       syslinux >= 6.03-1
Requires:       syslinux-nonlinux >= 6.03-1
%endif

%ifarch %{arm}
Requires:       uboot-tools 
%endif

Provides:       appliance-tools-minimizer = %{version}-%{release}
Obsoletes:      appliance-tools-minimizer < 007.7-3
Provides:       lorax-templates-generic = %{version}-%{release}
Obsoletes:      lorax-templates-generic < %{version}-%{release}
Provides:       lorax-templates = %{version}-%{release}

%description
Tools for creating images, including the Anaconda boot.iso, live disk images, iso's,
and filesystem images.

It also includes livemedia-creator which is used to create bootable livemedia,
including live isos and disk images. It can use libvirtd for the install, or
Anaconda's image install feature.

The package including lorax-templates-generic
lorax-templates-generic,Generic build templates for lorax and livemedia-creator

%if 0%{?disable_cross}
%package       lmc-virt
Summary:       livemedia-creator libvirt dependencies
Requires:      lorax = %{version}-%{release} qemu edk2-ovmf
Recommends:    qemu-kvm

%description   lmc-virt
Additional dependencies required by livemedia-creator when using it with qemu.
%endif

%package       lmc-novirt
Summary:       livemedia-creator no-virt dependencies
Requires:      lorax = %{version}-%{release} anaconda-core anaconda-tui system-logos

%description   lmc-novirt
Additional dependencies required by livemedia-creator when using it with --no-virt
to run Anaconda.

%package       composer
Summary:       Lorax Image Composer API Server
BuildRequires: python3-flask python3-gobject libgit2-glib python3-pytoml python3-semantic_version

Requires:      lorax = %{version}-%{release}
Requires(pre): /usr/bin/getent /usr/sbin/groupadd /usr/sbin/useradd

Requires:      python3-toml  python3-semantic_version libgit2 libgit2-glib
Requires:      python3-flask python3-gevent anaconda-tui qemu-img tar

%{?systemd_requires}
BuildRequires: systemd

%description   composer
lorax-composer provides a REST API for building images using lorax.

%package -n    composer-cli
Summary: A command line tool for use with the lorax-composer API server

Requires:      python3-urllib3

%description -n composer-cli
A command line tool for use with the lorax-composer API server. Examine recipes,
build images, etc. from the command line.

%package_help

%prep
%setup -q -n %{name}-%{name}-%{version}-1
%patch0 -p1
%ifarch aarch64
%patch1 -p1
%patch2 -p1
%endif
%patch3 -p1

%patch4 -p1
%ifarch aarch64
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%endif

%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%ifarch loongarch64
%patch100 -p1
%endif

%ifarch sw_64
%patch200 -p1
%endif

%patch10000 -p1

%build
%make_build

%install
%make_install DESTDIR=%{buildroot} mandir=%{_mandir} 
install -dp %{buildroot}/var/lib/lorax/composer/blueprints/
for toml in example-http-server.toml example-development.toml example-atlas.toml; do
    cp ./tests/pylorax/blueprints/$toml %{buildroot}/var/lib/lorax/composer/blueprints/
done

%ifarch sw_64
tar -zxvf %SOURCE1 -C %{buildroot}/%{_datadir}/lorax/templates.d/99-generic/config_files/
%endif

%pre composer
getent group weldr >/dev/null 2>&1 || groupadd -r weldr >/dev/null 2>&1 || :
getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin -c "User for lorax-composer" weldr >/dev/null 2>&1 || :

%post composer
%systemd_post lorax-composer.service
%systemd_post lorax-composer.socket

%preun composer
%systemd_preun lorax-composer.service
%systemd_preun lorax-composer.socket

%postun composer
%systemd_postun_with_restart lorax-composer.service
%systemd_postun_with_restart lorax-composer.socket

%files
%defattr(-,root,root,-)
%doc AUTHORS docs/livemedia-creator.rst docs/product-images.rst
%doc docs/*ks ANNOUNCE POLICY
%license COPYING
%config(noreplace) %{_sysconfdir}/lorax/lorax.conf
%{python3_sitelib}/pylorax
%{python3_sitelib}/*.egg-info
%{_bindir}/image-minimizer
%{_bindir}/mk-s390-cdboot
%{_sbindir}/lorax
%{_sbindir}/mkefiboot
%{_sbindir}/livemedia-creator
%{_sbindir}/mkksiso
%dir %{_sysconfdir}/lorax
%dir %{_datadir}/lorax
%dir %{_datadir}/lorax/templates.d
%{_datadir}/lorax/templates.d/*
%{_tmpfilesdir}/lorax.conf
%exclude %{python3_sitelib}/pylorax/api

%if 0%{?disable_cross}
%files lmc-virt
%endif

%files lmc-novirt

%files composer
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/lorax/composer.conf
%{python3_sitelib}/pylorax/api
%{python3_sitelib}/lifted/*
%{_sbindir}/lorax-composer
%{_unitdir}/lorax-composer.*
%dir %{_datadir}/lorax/composer
%{_datadir}/lorax/composer/*
%{_datadir}/lorax/lifted/*
%{_tmpfilesdir}/lorax-composer.conf
%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/
%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/blueprints/
%attr(0771, weldr, weldr) %{_sharedstatedir}/lorax/composer/blueprints/*

%files -n composer-cli
%defattr(-,root,root,-)
%{_sysconfdir}/bash_completion.d/composer-cli
%{_bindir}/composer-cli
%{python3_sitelib}/composer/*

%files help
%defattr(-,root,root)
%doc HACKING.md README.md
%{_mandir}/man1/*.1*

%changelog
* Thu Sep 07 2023 raki007 <278366432@qq.com> - 33.6-12
- Type:enhance
- ID:NA
- SUG:NA
- DESC:summer ospp replace isomd5sum with isosm3sum

* Wed Jun 14 2023 yanglu <yanglu72@h-partners.com> - 33.6-11
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:ensure that the src package contains the loongson and sw patches

* Wed Dec 21 2022 Wenjuan Qiu <wenjuan.qiu@i-soft.com.cn> - 33.6-10
- Type:requirements
- ID:NA
- SUG:NA
- DESC:add sw_64 architecture support for lorax

* Sat Nov 26 2022 zhouyihang <zhouyihang3@h-partners.com> - 33.6-9
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:remove duplicate files in lorax

* Mon Mar 28 2022 Wenlong Zhang <zhangwenlong@loongson.cn> - 33.6-8
- ID:NA
- SUG:NA
- DESC: add loongarch support for lorax

* Sat Aug 13 2022 zhouyihang <zhouyihang3@h-partners.com> - 33.6-7
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add param name_prefix to make name used by register_blueprint() unique

* Sat Jan 08 2022 xihaochen <xihaochen@huawei.com> - 33.6-6
- Type:requriements
- Id:NA
- SUG:NA
- DESC:remove python-nose dependency

* Fri Apr 23 2021 zhangqiumiao <zhangqiumiao1@huawei.com> - 33.6-5
- runtime-install: don't install notification-daemon

* Mon Apr 12 2021 orange-snn <songnannan2@huawei.com> - 33.6-4
- add python3-pycdlib in requires for livecd

* Tue Mar 30 2021 yuboyun <yuboyun@huawei.com> - 33.6-3
- Do not use '--loglevel' option when running Anaconda
  Improve Imc no-virt error handling
  Add POSTIN scriptlet error to the log monitor list
  Remove LD_PRELOAD libgomp.so.1 from Imc --no-virt

* Tue Oct 13 2020 yuboyun <yuboyun@huawei.com> - 33.6-2
- add yaml file

* Mon Aug 3 2020 zhujunhao <zhujunhao8@huawei.com> - 33.6-1
- update to 33.6

* Thu Jun 18 2020 zhujunhao <zhujunhao8@huawei.com> - 31.9-1
- update to 31.9

* Mon Mar 16 2020 songnannan <songnannan2@huawei.com> - 29.16-10
- disbale the virt pacakge

* Mon Feb 24 2020 openEuler Buildteam <buildteam@openeuler.org> - 29.16-9
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:Fix live-iso creation on aarch64

* Thu Jan 16 2020 openEuler Buildteam <buildteam@openeuler.org> - 29.16-8
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:delete udisk2-iscsi

* Wed Jan 15 2020 openEuler Buildteam <buildteam@openeuler.org> - 29.16-7
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:fix selfbuild error

* Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 29.16-6
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:optimization the spec

* Mon Oct 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 29.16-5
- Type:bugfix
- Id:NA
- SUG:NA
- DESC: add lorax-lmc-virt package

* Fri Oct 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 29.16-4
- spec modify

* Fri Aug 23 2019 cangyi<cangyi@huawei.com> - 29.16-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:format patches

* Fri Aug 16 2019 fanghuiyu<fanghuiyu@huawei.com> - 29.16-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:enable GUI installation

* Wed Jul 3 2019 zhujunhao<zhujunhao5@huawei.com> - 29.16-1.h7
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:eliminate-difference

* Thu Mar 28 2019 tianhang<tianhang1@huawei.com> - 29.16-1.h6
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:disable GeoIP for anaconda

* Wed Feb 27 2019 hexiaowen<hexiaowen@huawei.com> - 29.16-1.h5
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:disable graphic install and add console cmdline

* Wed Feb 27 2019 hexiaowen<hexiaowen@huawei.com> - 29.16-1.h4
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:disable graphic install

* Fri Jan 11 2019 zhouyihang<zhouyihang1@huawei.com> - 29.16-1.h3
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:disable isolabel character change

* Thu Jan 10 2019 liuxueping<liuxueping1@huawei.com> - 29.16-1.h2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:delete kernel-modules pkgs

* Sat Dec 29 2018 liuxueping<liuxueping1@huawei.com> - 29.16-1.h1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:use tty0 rather than ttyAMA0 for rescue mode on aarch64 machine
       ignore the dir that without kernel version
       add text mode in aarch64 installation