-
Notifications
You must be signed in to change notification settings - Fork 49
/
tdnf.spec.in
455 lines (406 loc) · 15.9 KB
/
tdnf.spec.in
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
Summary: dnf/yum equivalent using C libs
Name: tdnf
Version: @PROJECT_VERSION@
Release: 0%{?buildtag}%{?dist}
Vendor: VMware, Inc.
Distribution: Photon
License: LGPLv2.1,GPLv2
URL: https://github.com/vmware/%{name}
Group: Applications/RPM
Source0: %{name}-%{version}.tar.gz
%define sha512 %{name}=4c6756aa1778464e3d8eefe69271809f9b9b29ba4ab7756f6c230352f9bcc40eabc541f21f385adfc8d78420101411038e49cf56409ec889beac062571c21d5f
Requires: rpm-libs >= 4.16.1.3-1
%if %{defined rhel} || %{defined fedora}
Requires: libcurl
Requires: expat
%else
Requires: curl-libs
Requires: expat-libs
%endif
Requires: %{name}-cli-libs = %{version}-%{release}
Requires: libsolv >= 0.7.19
Requires: zlib
BuildRequires: popt-devel
BuildRequires: rpm-devel
BuildRequires: openssl-devel >= 1.1.1
BuildRequires: libsolv-devel >= 0.7.19
BuildRequires: curl-devel
BuildRequires: expat-devel
BuildRequires: sqlite-devel
BuildRequires: zlib-devel
BuildRequires: systemd
BuildRequires: systemd-rpm-macros
#metalink plugin
BuildRequires: expat-devel
#repogpgcheck plugin
BuildRequires: gpgme-devel
BuildRequires: gcc
BuildRequires: make
BuildRequires: cmake
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if 0%{?with_check}
BuildRequires: createrepo_c
BuildRequires: glib
BuildRequires: python3-pip
BuildRequires: photon-release
BuildRequires: photon-repos
BuildRequires: python3-requests
BuildRequires: python3-urllib3
BuildRequires: python3-pyOpenSSL
BuildRequires: python3-pytest
%endif
Obsoletes: yum
Provides: yum
%description
%{name} is a yum/dnf equivalent which uses libsolv and libcurl
%define _tdnfpluginsdir %{_libdir}/%{name}-plugins
%package devel
Summary: A Library providing a C API for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libsolv-devel
%description devel
Development files for %{name}
%package pytests
Summary: Test suite for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}-automatic = %{version}-%{release}
Requires: %{name}-plugin-repogpgcheck = %{version}-%{release}
Requires: %{name}-plugin-metalink = %{version}-%{release}
Requires: %{name}-python = %{version}-%{release}
Requires: python3-pytest
Requires: python3-requests
Requires: rpm-build
Requires: build-essential
Requires: createrepo
Requires: shadow
Requires: sudo
Requires: e2fsprogs
Requires: util-linux
Requires: findutils
%description pytests
Test suite for %{name}
%package cli-libs
Summary: Library providing cli libs for %{name} like clients
Group: Development/Libraries
%description cli-libs
Library providing cli libs for %{name} like clients.
%package plugin-metalink
Summary: tdnf plugin providing metalink functionality for repo configurations
Group: Development/Libraries
Requires: gpgme
%description plugin-metalink
tdnf plugin providing metalink functionality for repo configurations
%package plugin-repogpgcheck
Summary: %{name} plugin providing gpg verification for repository metadata
Group: Development/Libraries
Requires: gpgme
%description plugin-repogpgcheck
%{name} plugin providing gpg verification for repository metadata
%package python
Summary: python bindings for %{name}
Group: Development/Libraries
Requires: python3
%description python
python bindings for %{name}
%package automatic
Summary: %{name} - automated upgrades
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%{?systemd_requires}
%description automatic
Systemd units that can periodically download package upgrades and apply them.
%prep
%autosetup -p1 -n %{name}-%{version}
%build
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DSYSTEMD_DIR=%{_unitdir} \
..
%make_build
%make_build python
%if 0%{?with_check}
%check
pip3 install flake8
cd build && make %{?_smp_mflags} check
%endif
%install
pushd build
%make_install
popd
find %{buildroot} -name '*.a' -delete
mkdir -p %{buildroot}/var/cache/%{name} %{buildroot}%{_unitdir}
ln -sfv %{name} %{buildroot}%{_bindir}/tyum
ln -sfv %{name} %{buildroot}%{_bindir}/yum
ln -sfv %{name} %{buildroot}%{_bindir}/tdnfj
pushd build/python
python3 setup.py install --skip-build --prefix=%{_prefix} --install-lib=%{python3_sitelib} --root=%{buildroot}
popd
find %{buildroot} -name '*.pyc' -delete
%pre
%post
/sbin/ldconfig
%posttrans
# must be postrans because we read the rpm db
# cannot use tdnf because that is still running even in postrans
[ -d /var/lib/tdnf ] || mkdir -p /var/lib/tdnf
[ -f /var/lib/tdnf/history.db ] || %{_libdir}/tdnf/tdnf-history-util init
if [ -f /var/lib/tdnf/autoinstalled ] ; then
%{_libdir}/tdnf/tdnf-history-util mark remove $(cat /var/lib/tdnf/autoinstalled) && \
rm /var/lib/tdnf/autoinstalled
fi
%triggerin -- motd
[ $2 -eq 1 ] || exit 0
if [ $1 -eq 1 ]; then
echo "detected install of %{name}/motd, enabling %{name}-cache-updateinfo.timer" >&2
systemctl enable %{name}-cache-updateinfo.timer >/dev/null 2>&1 || :
systemctl start %{name}-cache-updateinfo.timer >/dev/null 2>&1 || :
elif [ $1 -eq 2 ]; then
echo "detected upgrade of %{name}, daemon-reload" >&2
systemctl daemon-reload >/dev/null 2>&1 || :
fi
# transition old autoinstalled file to db
if [ -f /var/lib/tdnf/autoinstalled ] ; then
tdnf mark remove $(cat /var/lib/tdnf/autoinstalled)
mv /var/lib/tdnf/autoinstalled /var/lib/tdnf/autoinstalled.backup
fi
%triggerun -- motd
[ $1 -eq 1 ] && [ $2 -eq 1 ] && exit 0
echo "detected uninstall of %{name}/motd, disabling %{name}-cache-updateinfo.timer" >&2
systemctl --no-reload disable %{name}-cache-updateinfo.timer >/dev/null 2>&1 || :
systemctl stop %{name}-cache-updateinfo.timer >/dev/null 2>&1 || :
rm -f /var/cache/%{name}/cached-updateinfo.txt
%postun
/sbin/ldconfig
%triggerpostun -- motd
[ $1 -eq 1 ] && [ $2 -eq 1 ] || exit 0
echo "detected upgrade of %{name}/motd, restarting %{name}-cache-updateinfo.timer" >&2
systemctl try-restart %{name}-cache-updateinfo.timer >/dev/null 2>&1 || :
%post cli-libs
/sbin/ldconfig
%postun cli-libs
/sbin/ldconfig
%global automatic_services %{name}-automatic.timer %{name}-automatic-notifyonly.timer %{name}-automatic-install.timer
%post automatic
%systemd_post %{automatic_services}
%preun automatic
%systemd_preun %{automatic_services}
%postun automatic
%systemd_postun_with_restart %{automatic_services}
%files
%defattr(-,root,root,0755)
%{_bindir}/%{name}
%{_bindir}/tyum
%{_bindir}/yum
%{_bindir}/tdnfj
%{_bindir}/tdnf-config
%{_bindir}/tdnf-cache-updateinfo
%{_libdir}/libtdnf.so.*
%{_libdir}/tdnf/tdnf-history-util
%config(noreplace) %{_sysconfdir}/tdnf/tdnf.conf
%config %{_unitdir}/tdnf-cache-updateinfo.service
%config(noreplace) %{_unitdir}/tdnf-cache-updateinfo.timer
%config %{_sysconfdir}/motdgen.d/02-tdnf-updateinfo.sh
%dir /var/cache/tdnf
%{_datadir}/bash-completion/completions/tdnf
%files pytests
%defattr(-,root,root)
%{_datadir}/tdnf/pytests/
%{_bindir}/jsondumptest
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/*.h
%{_libdir}/libtdnf.so
%{_libdir}/libtdnfcli.so
%exclude %dir %{_libdir}/debug
%{_libdir}/pkgconfig/tdnf.pc
%{_libdir}/pkgconfig/tdnf-cli-libs.pc
%files cli-libs
%defattr(-,root,root)
%{_libdir}/libtdnfcli.so.*
%files plugin-metalink
%defattr(-,root,root)
%dir %{_sysconfdir}/tdnf/pluginconf.d
%config(noreplace) %{_sysconfdir}/tdnf/pluginconf.d/tdnfmetalink.conf
%{_tdnfpluginsdir}/libtdnfmetalink.so
%files plugin-repogpgcheck
%defattr(-,root,root)
%dir %{_sysconfdir}/%{name}/pluginconf.d
%config(noreplace) %{_sysconfdir}/%{name}/pluginconf.d/tdnfrepogpgcheck.conf
%{_tdnfpluginsdir}/libtdnfrepogpgcheck.so
%files python
%defattr(-,root,root)
%{python3_sitelib}/*
%files automatic
%defattr(-,root,root,0755)
%{_bindir}/%{name}-automatic
%config(noreplace) %{_sysconfdir}/%{name}/automatic.conf
%{_unitdir}/%{name}-automatic.timer
%{_unitdir}/%{name}-automatic.service
%{_unitdir}/%{name}-automatic-install.timer
%{_unitdir}/%{name}-automatic-install.service
%{_unitdir}/%{name}-automatic-notifyonly.timer
%{_unitdir}/%{name}-automatic-notifyonly.service
%changelog
* Fri Jun 09 2023 Shivani Agarwal <shivania2@vmware.com> 3.3.1-4
- Remove libxml2 dependency and add expat dependency
* Mon Jun 27 2022 Shreenidhi Shedi <sshedi@vmware.com> 3.3.1-3
- Exclude debug symbols properly
* Fri Jun 17 2022 Shreenidhi Shedi <sshedi@vmware.com> 3.3.1-2
- Spec improvements
* Tue May 10 2022 Oliver Kurth <okurth@vmware.com> 3.3.1-1
- update to 3.3.1
* Mon Feb 21 2022 Oliver Kurth <okurth@vmware.com> 3.2.5-1
- update to 3.2.5
* Thu Feb 03 2022 Oliver Kurth <okurth@vmware.com> 3.2.4-1
- update to 3.2.4
* Wed Dec 22 2021 Oliver Kurth <okurth@vmware.com> 3.2.3-1
- update to 3.2.3
* Fri Dec 10 2021 Oliver Kurth <okurth@vmware.com> 3.2.2-1
- update to 3.2.2
* Thu Dec 09 2021 Prashant S Chauhan <psinghchauha@vmware.com> 3.1.5-4
- Bump up to compile with python 3.10
* Mon Nov 15 2021 Shreenidhi Shedi <sshedi@vmware.com> 3.1.5-3
- Bump version as a part of rpm upgrade
* Mon Nov 08 2021 Satya Naga Vasamsetty <svasamsetty@vmware.com> 3.1.5-2
- openssl 3.0.0 compatibility
* Wed Oct 06 2021 Oliver Kurth <okurth@vmware.com> 3.1.5-1
- update to 3.1.5
- add minversions config option
- make pytests arch independent (does not affect functionality)
* Mon Aug 2 2021 Oliver Kurth <okurth@vmware.com> 3.1.4-1
- update to 3.1.4
- fix configreader key reading logic
* Tue Jun 29 2021 Oliver Kurth <okurth@vmware.com> 3.1.3-1
- update to 3.1.3
* Wed Jun 23 2021 Oliver Kurth <okurth@vmware.com> 3.1.2-1
- update to 3.1.2
* Fri Jun 11 2021 Oliver Kurth <okurth@vmware.com> 3.1.0-3
- rebuild with libsolv 0.7.19
* Thu Jun 03 2021 Shreenidhi Shedi <sshedi@vmware.com> 3.1.0-2
- fix segfaulting when gpgcheck is enabled & no key configured
* Tue Jun 01 2021 Oliver Kurth <okurth@vmware.com> 3.1.0-1
- update to 3.1.0
* Tue Apr 06 2021 Oliver Kurth <okurth@vmware.com> 3.0.2-1
- update to 3.0.2
* Thu Feb 18 2021 Oliver Kurth <okurth@vmware.com> 3.0.0-5
- update to v3.0.0 (GA)
- depend on curl-libs instead of curl
* Wed Feb 10 2021 Shreenidhi Shedi <sshedi@vmware.com> 3.0.0-4
- bump version as a part of rpm upgrade
* Wed Jan 20 2021 Oliver Kurth <okurth@vmware.com> 3.0.0-3
- update to v3.0.0-rc2
* Thu Oct 29 2020 Keerthana K <keerthanak@vmware.com> 3.0.0-2
- Fix coverity scan issues and fedora pytest issue.
* Tue Oct 27 2020 Keerthana K <keerthanak@vmware.com> 3.0.0-1
- Update to v3.0.0-beta
* Sun Sep 06 2020 Satya Naga Vasamsetty <svasamsetty@vmware.com> 2.1.1-3
- Rebuild with openssl 1.1.1
* Sat Aug 15 2020 Shreenidhi Shedi <sshedi@vmware.com> 2.1.1-2
- Cherry-pick some critical fixes from vmware/tdnf:dev
* Thu Jun 04 2020 Tapas Kundu <tkundu@vmware.com> 2.1.1-1
- Update to 2.1.1
* Tue Mar 24 2020 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.0-2
- Fix distroverpkg search to look for provides instead of name
* Thu Feb 20 2020 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.0-1
- Update to 2.1.0
* Sun Sep 08 2019 Ankit Jain <ankitja@vmware.com> 2.0.0-11
- Added more rules for skipconflicts and skipobsoletes to check command.
* Fri Mar 15 2019 Ankit Jain <ankitja@vmware.com> 2.0.0-10
- Added skipconflicts and skipobsoletes to check command.
* Thu Mar 14 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-9
- GPGCheck fix on RPM version 4.14.2
* Mon Mar 04 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-8
- makecache and refresh command updates.
* Thu Feb 14 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-7
- Fix to address issues when no repos are enabled.
* Wed Jan 23 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-6
- Fix Memory leak and curl status type.
* Wed Jan 02 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-5
- Added make check.
* Tue Dec 04 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-4
- Add support for libsolv caching.
- Fix bug in tdnf updateinfo command.
- Fix bug on list available command.
* Wed Nov 21 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-3
- Update to 2.0.0 beta release.
* Mon Oct 08 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-2
- Fix bug on tdnf crash when photon-iso repo only enabled without mounting cdrom.
* Fri Feb 09 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.0.0-1
- update to 2.0.0
* Tue Jan 30 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-3
- patch to error out early for permission issues.
* Tue Oct 10 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-2
- Fix bug in obsolete protected packages.
* Wed Oct 4 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-1
- update to v1.2.2
* Sat Sep 30 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-5
- Output problems while resolving to stderr (instead of stdout)
* Wed Sep 27 2017 Bo Gan <ganb@vmware.com> 1.2.1-4
- Improve suggestion in motd message
* Thu Sep 14 2017 Bo Gan <ganb@vmware.com> 1.2.1-3
- Add suggestion in motd message
* Fri Jul 21 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-2
- Modify quiet patch.
* Tue Jul 18 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-1
- Update to v1.2.1
* Tue May 30 2017 Bo Gan <ganb@vmware.com> 1.2.0-5
- Fix cache-updateinfo script again
* Fri May 12 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.0-4
- Patch repo refresh to allow quiet flags
* Wed May 10 2017 Bo Gan <ganb@vmware.com> 1.2.0-3
- Fix cache-updateinfo script
* Fri May 05 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.0-2
- Fix Requires for cli-libs
* Wed May 03 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.0-1
- update to v1.2.0
* Sun Apr 30 2017 Bo Gan <ganb@vmware.com> 1.1.0-5
- Do not write to stdout in motd triggers
* Thu Apr 20 2017 Bo Gan <ganb@vmware.com> 1.1.0-4
- motd hooks/triggers for updateinfo notification
* Fri Apr 14 2017 Dheerajs Shetty <dheerajs@vmware.com> 1.1.0-3
- Adding a patch to compile with latest hawkey version
* Mon Dec 19 2016 Xiaolin Li <xiaolinl@vmware.com> 1.1.0-2
- BuildRequires libsolv-devel.
* Thu Dec 08 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.1.0-1
- update to v1.1.0
* Thu Nov 17 2016 Alexey Makhalov <amakhalov@vmware.com> 1.0.9-3
- Use rpm-libs at runtime
* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.9-2
- GA - Bump release of all rpms
* Fri May 20 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.9-1
- Update to 1.0.9. Contains fixes for updateinfo.
* Wed May 4 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.8-3
- Fix link installs, fix devel header dir
* Fri Apr 1 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.8-2
- Update version which was missed with 1.0.8-1, apply string limits
* Fri Apr 1 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.8-1
- Code scan fixes, autotest path fix, support --releasever
* Thu Jan 14 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.7
- Fix return codes on install and check-update
- Add tests for install existing and update
* Wed Jan 13 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.6
- Support distroverpkg and add tests to work with make check
* Mon Dec 14 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.5
- Support for multiple packages in alter commands
- Support url vars for releasever and basearch
* Fri Oct 2 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.4
- Fix upgrade to work without args, Engage distro-sync
- Fix install to resolve to latest available
- Fix formats, fix refresh on download output
* Tue Sep 8 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.3
- Fix metadata creation issues. Engage refresh flag.
- Do not check gpgkey when gpgcheck is turned off in repo.
* Thu Jul 23 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.2
- Support reinstalls in transaction. Handle non-existent packages correctly.
* Mon Jul 13 2015 Alexey Makhalov <amakhalov@vmware.com> 1.0.1-2
- Create -debuginfo package. Use parallel make.
* Tue Jun 30 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.1
- Proxy support, keepcache fix, valgrind leaks fix
* Fri Jan 23 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0
- Initial build. First version