forked from candlepin/subscription-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subscription-manager.spec
6622 lines (6237 loc) · 341 KB
/
subscription-manager.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
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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# For optional building of ostree-plugin sub package. Unrelated to systemd
# but the same versions apply at the moment.
%global has_ostree 0%{?suse_version} == 0
%global use_inotify 1
# Plugin for container (docker, podman) is not supported on RHEL
%if 0%{?rhel}
%global use_container_plugin 0
%else
%global use_container_plugin 1
%endif
%global dmidecode_arches %{ix86} x86_64 aarch64
%global completion_dir %{_datadir}/bash-completion/completions
%global run_dir /run
%global rhsm_plugins_dir /usr/share/rhsm-plugins
%if 0%{?suse_version}
%global use_container_plugin 0
%global use_inotify 0
%endif
%global use_dnf (0%{?fedora} || (0%{?rhel}))
%global create_libdnf_rpm (0%{?fedora} || 0%{?rhel} > 8)
%global python_sitearch %python3_sitearch
%global python_sitelib %python3_sitelib
%global __python %__python3
%if 0%{?suse_version}
%global py_package_prefix python3
%else
%global py_package_prefix python%{python3_pkgversion}
%endif
%global rhsm_package_name %{py_package_prefix}-subscription-manager-rhsm
%global _hardened_build 1
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro -Wl,-z,now}
%if %{has_ostree}
%global install_ostree INSTALL_OSTREE_PLUGIN=true
%else
%global install_ostree INSTALL_OSTREE_PLUGIN=false
%endif
%if %{use_container_plugin}
%global install_container INSTALL_CONTAINER_PLUGIN=true
%else
%global install_container INSTALL_CONTAINER_PLUGIN=false
%endif
%if 0%{?suse_version}
%global install_zypper_plugins INSTALL_ZYPPER_PLUGINS=true
%else
%global install_zypper_plugins INSTALL_ZYPPER_PLUGINS=false
%endif
# makefile defaults to INSTALL_DNF_PLUGINS=false
%if %{use_dnf}
%global install_dnf_plugins INSTALL_DNF_PLUGINS=true
%else
%global install_dnf_plugins INSTALL_DNF_PLUGINS=false
%endif
# Build a list of python package to exclude from the build.
# This is necessary because we have multiple rpms which may or may not
# need to be built depending on the distro which are all in one source tree.
# Because the contents of these optional rpms is often a python package in the
# same source tree, if we choose not to build that package and don't tell
# setup.py to exclude those packages, we end up with files that get installed
# in the buildroot which are not packaged. This fails various
# rpm build / verify post steps, which in certain build systems causes the
# entire build to be considered a failure.
# The implementation of building a list iteratively in a spec file looks a bit
# weird. As we want the final value of the global named "exclude_packages" to
# be an environment variable definition it needs to begin with the following
# (less the single quotes): 'EXCLUDE_PACKAGES="'
# After that we can then make all of our checks to see whether certain items
# should be added to the comma separated list or not.
# In setup.py we are parsing the value of the env var as a string separated
# by commas ignoring empty values. That makes the comma at the end of
# each conditional addition to the list still valid.
%global exclude_packages EXCLUDE_PACKAGES="
# add new exclude packages items after me
%if !%{use_container_plugin}
%global exclude_packages %{exclude_packages}*.plugin.container,
%endif
# add new exclude_packages items before me
%global exclude_packages %{exclude_packages}"
Name: subscription-manager
Version: 1.29.38
Release: 1%{?dist}
Summary: Tools and libraries for subscription and repository management
%if 0%{?suse_version}
Group: Productivity/Networking/System
License: GPL-2.0
%else
License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later
%endif
URL: http://www.candlepinproject.org/
# How to create the source tarball:
#
# git clone https://github.com/candlepin/subscription-manager.git
# yum install tito
# tito build --tag subscription-manager-$VERSION-$RELEASE --tgz
Source0: %{name}-%{version}.tar.gz
# Especially for the OpenSuse Build Service we need to have another lint config
%if 0%{?suse_version}
Source2: subscription-manager-rpmlintrc
%endif
# The following macro examples are preceeded by '%' to stop macro expansion
# in the comments. (See https://bugzilla.redhat.com/show_bug.cgi?id=1224660 for
# why this is necessary)
# A note about the %%{?foo:bar} %%{!?foo:quux} convention. The %%{?foo:bar}
# syntax evaluates foo and if it is **defined**, it expands to "bar" otherwise it
# expands to nothing. The %%{!?foo:quux} syntax similarily only the expansion
# occurs when foo is **undefined**. Since one and only one of the expressions will
# expand we can more concisely handle when a dependency has different names in
# SUSE versus RHEL. The traditional if syntax gets extremely confusing when
# nesting is required since RPM requires the various preamble directives to be
# at the start of a line making meaningful indentation impossible.
Requires: iproute
Requires: %{py_package_prefix}-iniparse
Requires: %{py_package_prefix}-decorator
Requires: virt-what
Requires: %{rhsm_package_name} = %{version}
Requires: subscription-manager-rhsm-certificates
%ifarch %{dmidecode_arches}
Requires: dmidecode
%endif
%if 0%{?suse_version}
Requires: %{py_package_prefix}-python-dateutil
Requires: %{py_package_prefix}-dbus-python
Requires: logrotate
Requires: cron
Requires: %{py_package_prefix}-gobject2
Requires: libzypp
Requires: %{py_package_prefix}-zypp-plugin
%else
Requires: %{py_package_prefix}-dateutil
Requires: %{py_package_prefix}-dbus
Requires: usermode
Requires: python3-gobject-base
%endif
# rhel 8 has different naming for setuptools going forward
%if (0%{?rhel} && 0%{?rhel} == 8)
Requires: platform-python-setuptools
%else
Requires: %{py_package_prefix}-setuptools
%endif
%if %{use_dnf}
%if %{create_libdnf_rpm}
Requires: python3-dnf
Requires: python3-dnf-plugins-core
Requires: python3-librepo
%else
Requires: dnf-plugin-subscription-manager = %{version}
%endif
%endif
%if %use_inotify
Requires: %{py_package_prefix}-inotify
%endif
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: python3-cloud-what = %{version}-%{release}
BuildRequires: %{py_package_prefix}-devel
BuildRequires: openssl-devel
BuildRequires: gcc
BuildRequires: %{py_package_prefix}-setuptools
BuildRequires: gettext
%if 0%{?suse_version}
BuildRequires: distribution-release
BuildRequires: libzypp
BuildRequires: systemd-rpm-macros
BuildRequires: python3-rpm-macros
BuildRequires: %{py_package_prefix}-python-dateutil
%else
BuildRequires: system-release
BuildRequires: %{py_package_prefix}-dateutil
%endif
BuildRequires: systemd
Obsoletes: subscription-manager-migration <= %{version}-%{release}
Obsoletes: subscription-manager-initial-setup-addon <= %{version}-%{release}
Obsoletes: rhsm-gtk <= %{version}-%{release}
%if !%{use_container_plugin}
Obsoletes: subscription-manager-plugin-container <= %{version}
%endif
%if %{use_dnf}
%if %{create_libdnf_rpm}
# The libdnf plugin is in separate RPM, but shubscription-manager should be dependent
# on this RPM, because somebody can install microdnf on host and installing of product
# certs would not work as expected without libdnf plugin
Requires: libdnf-plugin-subscription-manager = %{version}
# The dnf plugin is now part of subscription-manager
Obsoletes: dnf-plugin-subscription-manager < 1.29.0
%endif
%endif
Obsoletes: %{py_package_prefix}-syspurpose <= %{version}
%description
The Subscription Manager package provides programs and libraries to allow users
to manage subscriptions and yum repositories from the Red Hat entitlement
platform.
%if %{use_container_plugin}
%package -n subscription-manager-plugin-container
Summary: A plugin for handling container content
Requires: %{name} = %{version}-%{release}
%description -n subscription-manager-plugin-container
Enables handling of content of type 'containerImage' in any certificates
from the server. Populates /etc/docker/certs.d appropriately.
%endif
%if %{use_dnf}
# RPM containing libdnf plugin
%if %{create_libdnf_rpm}
%package -n libdnf-plugin-subscription-manager
Summary: Subscription Manager plugin for libdnf
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: json-c-devel
BuildRequires: libdnf-devel >= 0.22.5
Obsoletes: dnf-plugin-subscription-manager < 1.29.0
%description -n libdnf-plugin-subscription-manager
This package provides a plugin to interact with repositories from the Red Hat
entitlement platform; contains only one product-id binary plugin used by
e.g. microdnf.
%else
# RPM containing DNF plugin
%package -n dnf-plugin-subscription-manager
Summary: Subscription Manager plugins for DNF
%if (0%{?fedora} || 0%{?rhel})
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: json-c-devel
BuildRequires: libdnf-devel >= 0.22.5
Requires: json-c
Requires: libdnf >= 0.22.5
%endif
Requires: python3-dnf-plugins-core
Requires: python3-librepo
Requires: dnf >= 1.0.0
%description -n dnf-plugin-subscription-manager
This package provides plugins to interact with repositories and subscriptions
from the Red Hat entitlement platform; contains subscription-manager and
product-id plugins.
%endif
# This redefinition of debuginfo package has to be here, because we
# need to solve the issue described in this BZ:
# https://bugzilla.redhat.com/show_bug.cgi?id=1920568
# We need to obsolete old dnf-sub-man-plugin-debuginfo RPM
%package -n libdnf-plugin-subscription-manager-debuginfo
Summary: Debug information for package libdnf-plugin-subscription-manager
Obsoletes: dnf-plugin-subscription-manager-debuginfo < 1.29.0
%description -n libdnf-plugin-subscription-manager-debuginfo
This package provides debug information for package libdnf-plugin-subscription-manager.
Debug information is useful when developing applications that use this
package or when debugging this package.
%endif
%if %has_ostree
%package -n subscription-manager-plugin-ostree
Summary: A plugin for handling OSTree content.
Requires: %{py_package_prefix}-gobject-base
# plugin needs a slightly newer version of python-iniparse for 'tidy'
Requires: %{py_package_prefix}-iniparse >= 0.4
Requires: %{name} = %{version}-%{release}
%description -n subscription-manager-plugin-ostree
Enables handling of content of type 'ostree' in any certificates
from the server. Populates /ostree/repo/config as well as updates
the remote in the currently deployed .origin file.
%endif
%package -n %{rhsm_package_name}
Summary: A Python library to communicate with a Red Hat Unified Entitlement Platform
%if 0%{?suse_version}
Group: Development/Libraries/Python
%endif
%if 0%{?suse_version}
Requires: %{py_package_prefix}-python-dateutil
%else
Requires: %{py_package_prefix}-dateutil
%endif
Requires: %{py_package_prefix}-iniparse
Requires: subscription-manager-rhsm-certificates
# Required by Fedora packaging guidelines
%{?python_provide:%python_provide %{py_package_prefix}-rhsm}
Requires: python3-cloud-what = %{version}-%{release}
Requires: python3-rpm
Provides: python3-rhsm = %{version}-%{release}
Obsoletes: python3-rhsm <= 1.20.3-1
Provides: python-rhsm = %{version}-%{release}
Obsoletes: python-rhsm <= 1.20.3-1
%description -n %{rhsm_package_name}
A small library for communicating with the REST interface of a Red Hat Unified
Entitlement Platform. This interface is used for the management of system
entitlements, certificates, and access to content.
%package -n python3-cloud-what
Summary: Python package for detection of public cloud provider
%if 0%{?suse_version}
Group: Productivity/Networking/System
%endif
Requires: python3-requests
%ifarch %{dmidecode_arches}
Requires: dmidecode
%endif
%description -n python3-cloud-what
This package contains a Python module for detection and collection of public
cloud metadata and signatures.
%prep
%setup -q
%build
make -f Makefile VERSION=%{version}-%{release} CFLAGS="%{optflags}" \
LDFLAGS="%{__global_ldflags}" OS_DIST="%{dist}" PYTHON="%{__python}" \
%{?subpackages} %{exclude_packages}
%if %{use_dnf}
pushd src/plugins/libdnf
%cmake -DCMAKE_BUILD_TYPE="Release"
%if (0%{?rhel} && 0%{?rhel} <= 8)
%make_build
%else
%cmake_build
%endif
popd
%endif
%install
make -f Makefile install VERSION=%{version}-%{release} \
PYTHON=%{__python} PREFIX=%{_prefix} \
DESTDIR=%{buildroot} PYTHON_SITELIB=%{python_sitearch} \
OS_VERSION=%{?fedora}%{?rhel}%{?suse_version} OS_DIST=%{dist} \
COMPLETION_DIR=%{completion_dir} \
RUN_DIR=%{run_dir} \
%{?install_ostree} %{?install_container} \
%{?install_dnf_plugins} \
%{?install_zypper_plugins} \
%{?subpackages} \
%{?exclude_packages}
%if %{use_dnf}
pushd src/plugins/libdnf
mkdir -p %{buildroot}%{_libdir}/libdnf/plugins
%if (0%{?rhel} && 0%{?rhel} <= 8)
%make_install
%else
%cmake_install
%endif
popd
%endif
%find_lang rhsm
# fake out the redhat.repo file
%if %{use_dnf}
mkdir %{buildroot}%{_sysconfdir}/yum.repos.d
touch %{buildroot}%{_sysconfdir}/yum.repos.d/redhat.repo
%endif
# fake out the certificate directories
mkdir -p %{buildroot}%{_sysconfdir}/pki/consumer
mkdir -p %{buildroot}%{_sysconfdir}/pki/entitlement
%if %{use_container_plugin}
# Setup cert directories for the container plugin:
mkdir -p %{buildroot}%{_sysconfdir}/docker/certs.d/
mkdir %{buildroot}%{_sysconfdir}/docker/certs.d/cdn.redhat.com
install -m 644 %{_builddir}/%{buildsubdir}/src/content_plugins/redhat-entitlement-authority.pem %{buildroot}%{_sysconfdir}/docker/certs.d/cdn.redhat.com/redhat-entitlement-authority.crt
%endif
# fix timestamps on our byte compiled files so they match across arches
find %{buildroot} -name \*.py* -exec touch -r %{SOURCE0} '{}' \;
%if !0%{?suse_version}
%py_byte_compile %{__python3} %{buildroot}%{rhsm_plugins_dir}/
%endif
# symlink services to /usr/sbin/ when building for SUSE distributions
%if 0%{?suse_version}
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcrhsm
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcrhsm-facts
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcrhsmcertd
%endif
# base/cli tools use the gettext domain 'rhsm', while the
# gnome-help tools use domain 'subscription-manager'
%files -f rhsm.lang
%defattr(-,root,root,-)
# Make some unusual directories and files for suse part of subscription-manager
%if 0%{?suse_version}
%dir %{_sysconfdir}/pki
%dir %{_prefix}/share/polkit-1
%dir %{_prefix}/share/polkit-1/actions
%dir %{_sysconfdir}/dbus-1
%dir %{_sysconfdir}/dbus-1/system.d
%attr(755,root,root) %dir %{_sysconfdir}/rhsm/zypper.repos.d
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/rhsm/zypper.conf
# zypper plugin
%{_prefix}/lib/zypp/plugins/services/rhsm
# links to /usr/sbin/service
%{_sbindir}/rcrhsm
%{_sbindir}/rcrhsm-facts
%{_sbindir}/rcrhsmcertd
%else
# symlink to console-helper
%{_bindir}/subscription-manager
# PAM config
%{_sysconfdir}/pam.d/subscription-manager
%{_sysconfdir}/security/console.apps/subscription-manager
%endif
%dir %{python_sitearch}/rhsmlib/candlepin
%dir %{python_sitearch}/rhsmlib/dbus
%dir %{python_sitearch}/rhsmlib/dbus/facts
%dir %{python_sitearch}/rhsmlib/dbus/objects
%dir %{python_sitearch}/rhsmlib/facts
%dir %{python_sitearch}/rhsmlib/services
%dir %{python_sitearch}/subscription_manager-%{version}-*.egg-info
%dir %{python_sitearch}/subscription_manager/api
%dir %{python_sitearch}/subscription_manager/branding
%dir %{python_sitearch}/subscription_manager/cli_command
%dir %{python_sitearch}/subscription_manager/model
%dir %{python_sitearch}/subscription_manager/plugin
%dir %{python_sitearch}/subscription_manager/scripts
%dir %{_var}/spool/rhsm
%attr(755,root,root) %{_sbindir}/subscription-manager
%attr(755,root,root) %{_bindir}/rhsmcertd
%attr(755,root,root) %{_libexecdir}/rhsmcertd-worker
%attr(755,root,root) %{_libexecdir}/rhsm-package-profile-uploader
# our config dirs and files
%attr(755,root,root) %dir %{_sysconfdir}/pki/consumer
%attr(755,root,root) %dir %{_sysconfdir}/pki/entitlement
%attr(755,root,root) %dir %{_sysconfdir}/rhsm/facts
%attr(755,root,root) %dir %{_sysconfdir}/rhsm/syspurpose
%attr(644,root,root) %{_sysconfdir}/rhsm/syspurpose/valid_fields.json
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/rhsm/rhsm.conf
%if %{use_dnf}
%ghost %{_sysconfdir}/yum.repos.d/redhat.repo
%endif
# dnf plugin config
%if %{use_dnf}
# remove the repo file when we are deleted
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnf/plugins/subscription-manager.conf
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnf/plugins/product-id.conf
%endif
# misc system config
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/logrotate.d/subscription-manager
%attr(755,root,root) %dir %{_var}/log/rhsm
%attr(755,root,root) %dir %{_var}/spool/rhsm/debug
%ghost %attr(755,root,root) %dir %{run_dir}/rhsm
%attr(750,root,root) %dir %{_var}/lib/rhsm
%attr(750,root,root) %dir %{_var}/lib/rhsm/facts
%attr(750,root,root) %dir %{_var}/lib/rhsm/packages
%attr(750,root,root) %dir %{_var}/lib/rhsm/cache
%attr(750,root,root) %dir %{_var}/lib/rhsm/repo_server_val
%{completion_dir}/subscription-manager
%{completion_dir}/rct
%{completion_dir}/rhsm-debug
%{completion_dir}/rhsmcertd
%dir %{python_sitearch}/subscription_manager
# code, python modules and packages
%{python_sitearch}/subscription_manager-*.egg-info/*
%{python_sitearch}/subscription_manager/*.py*
%{python_sitearch}/subscription_manager/api/*.py*
%{python_sitearch}/subscription_manager/branding/*.py*
%{python_sitearch}/subscription_manager/cli_command/*.py*
%{python_sitearch}/subscription_manager/model/*.py*
%{python_sitearch}/subscription_manager/plugin/__init__.py*
%{python_sitearch}/subscription_manager/scripts/*.py*
%{python_sitearch}/subscription_manager/__pycache__
%{python_sitearch}/subscription_manager/api/__pycache__
%{python_sitearch}/subscription_manager/branding/__pycache__
%{python_sitearch}/subscription_manager/cli_command/__pycache__
%{python_sitearch}/subscription_manager/model/__pycache__
%{python_sitearch}/subscription_manager/plugin/__pycache__
%{python_sitearch}/subscription_manager/scripts/__pycache__
# subscription-manager plugins
%dir %{rhsm_plugins_dir}
%dir %{_sysconfdir}/rhsm/pluginconf.d
# When libdnf rpm is created, then dnf plugin is part of subscription-manager rpm
%if %{create_libdnf_rpm}
%{python_sitelib}/dnf-plugins/*
%endif
# rhsmlib
%dir %{python_sitearch}/rhsmlib
%{python_sitearch}/rhsmlib/*.py*
%{python_sitearch}/rhsmlib/candlepin/*.py*
%{python_sitearch}/rhsmlib/facts/*.py*
%{python_sitearch}/rhsmlib/services/*.py*
%{python_sitearch}/rhsmlib/dbus/*.py*
%{python_sitearch}/rhsmlib/dbus/facts/*.py*
%{python_sitearch}/rhsmlib/dbus/objects/*.py*
%{python_sitearch}/rhsmlib/__pycache__
%{python_sitearch}/rhsmlib/candlepin/__pycache__
%{python_sitearch}/rhsmlib/dbus/__pycache__
%{python_sitearch}/rhsmlib/dbus/facts/__pycache__
%{python_sitearch}/rhsmlib/dbus/objects/__pycache__
%{python_sitearch}/rhsmlib/facts/__pycache__
%{python_sitearch}/rhsmlib/services/__pycache__
# syspurpose
%dir %{python_sitearch}/syspurpose
%{python_sitearch}/syspurpose/*.py*
%{python_sitearch}/syspurpose/__pycache__
%{_datadir}/polkit-1/actions/com.redhat.*.policy
%{_datadir}/dbus-1/system-services/com.redhat.*.service
%attr(755,root,root) %{_libexecdir}/rhsm*-service
# Despite the name similarity dbus-1/system.d has nothing to do with systemd
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.*.conf
%attr(644,root,root) %{_unitdir}/*.service
%attr(644,root,root) %{_tmpfilesdir}/%{name}.conf
# Incude rt CLI tool
%dir %{python_sitearch}/rct
%{python_sitearch}/rct/*.py*
%{python_sitearch}/rct/__pycache__
%attr(755,root,root) %{_bindir}/rct
# Include consumer debug CLI tool
%dir %{python_sitearch}/rhsm_debug
%{python_sitearch}/rhsm_debug/*.py*
%{python_sitearch}/rhsm_debug/__pycache__
%attr(755,root,root) %{_bindir}/rhsm-debug
%doc
%{_mandir}/man8/subscription-manager.8*
%{_mandir}/man8/rhsmcertd.8*
%{_mandir}/man8/rct.8*
%{_mandir}/man8/rhsm-debug.8*
%{_mandir}/man5/rhsm.conf.5*
%doc LICENSE
%if %{use_container_plugin}
%files -n subscription-manager-plugin-container
%defattr(-,root,root,-)
%{_sysconfdir}/rhsm/pluginconf.d/container_content.ContainerContentPlugin.conf
%{rhsm_plugins_dir}/container_content.py*
%{rhsm_plugins_dir}/__pycache__/*container*
%{python_sitearch}/subscription_manager/plugin/container/__pycache__
%{python_sitearch}/subscription_manager/plugin/container/*.py*
# Copying Red Hat CA cert into each directory:
%attr(755,root,root) %dir %{_sysconfdir}/docker/certs.d/cdn.redhat.com
%attr(644,root,root) %{_sysconfdir}/docker/certs.d/cdn.redhat.com/redhat-entitlement-authority.crt
%endif
%if %has_ostree
%files -n subscription-manager-plugin-ostree
%defattr(-,root,root,-)
%{_sysconfdir}/rhsm/pluginconf.d/ostree_content.OstreeContentPlugin.conf
%{rhsm_plugins_dir}/ostree_content.py*
%{python_sitearch}/subscription_manager/plugin/ostree/*.py*
%{python_sitearch}/subscription_manager/plugin/ostree/__pycache__
%{rhsm_plugins_dir}/__pycache__/*ostree*
%endif
%if %{use_dnf}
# libdnf RPM
%if %{create_libdnf_rpm}
%files -n libdnf-plugin-subscription-manager
%defattr(-,root,root,-)
%{_libdir}/libdnf/plugins/product-id.so
%else
# DNF RPM
%files -n dnf-plugin-subscription-manager
%defattr(-,root,root,-)
%{python_sitelib}/dnf-plugins/*
%{_libdir}/libdnf/plugins/product-id.so
%endif
%endif
%files -n %{rhsm_package_name}
%defattr(-,root,root,-)
%dir %{python_sitearch}/rhsm
%{python_sitearch}/rhsm/*
%files -n python3-cloud-what
%defattr(-,root,root,-)
%attr(750,root,root) %dir %{_var}/cache/cloud-what
%dir %{python_sitearch}/cloud_what
%dir %{python_sitearch}/cloud_what/providers
%{python_sitearch}/cloud_what/*
%{python_sitearch}/cloud_what/__pycache__
%{python_sitearch}/cloud_what/providers/__pycache__
%pre
%if 0%{?suse_version}
%service_add_pre rhsm.service
%service_add_pre rhsm-facts.service
%service_add_pre rhsmcertd.service
%endif
%post
%if 0%{?suse_version}
%service_add_post rhsmcertd.service
%service_add_post rhsm.service
%service_add_post rhsm-facts.service
%tmpfiles_create %{_tmpfilesdir}/subscription-manager.conf
%else
%systemd_post rhsmcertd.service
%endif
# When subscription-manager is upgraded on RHEL 8 (from RHEL 8.2 to RHEL 8.3), then kill
# instance of rhsmd, because it is not necessary anymore and it can cause issues.
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1840364
%if ( 0%{?rhel} || 0%{?fedora} )
if [ "$1" = "2" ] ; then
killall rhsmd 2> /dev/null || true
fi
%endif
# Make all entitlement certificates and keys files readable by group and other
find /etc/pki/entitlement -mindepth 1 -maxdepth 1 -name '*.pem' | xargs --no-run-if-empty chmod go+r
if [ -x /bin/dbus-send ] ; then
dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig > /dev/null 2>&1 || :
fi
%if %{use_container_plugin}
%post -n subscription-manager-plugin-container
%{__python} %{rhsm_plugins_dir}/container_content.py || :
%endif
%preun
if [ $1 -eq 0 ] ; then
%if 0%{?suse_version}
%service_del_preun rhsm.service
%service_del_preun rhsm-facts.service
%service_del_preun rhsmcertd.service
%else
%systemd_preun rhsmcertd.service
%endif
if [ -x /bin/dbus-send ] ; then
dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig > /dev/null 2>&1 || :
fi
fi
%postun
%if 0%{?suse_version}
%service_del_postun rhsmcertd.service
%service_del_postun rhsm.service
%service_del_postun rhsm-facts.service
%else
%systemd_postun_with_restart rhsmcertd.service
%endif
%posttrans
# Remove old *.egg-info empty directories not removed be previous versions of RPMs
# due to this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1927245
rmdir %{python_sitearch}/subscription_manager-*-*.egg-info --ignore-fail-on-non-empty
# Remove old cache files
# The -f flag ensures that exit code 0 will be returned even if the file does not exist.
rm -f /var/lib/rhsm/cache/rhsm_icon.json
%changelog
* Thu Sep 14 2023 Pino Toscano <[email protected]> 1.29.38-1
- Translated using Weblate (Chinese (Simplified) (zh_CN)) ([email protected])
- ci: bump actions/checkout from 3 to 4
(49699333+dependabot[bot]@users.noreply.github.com)
- ENT-5603: Fix a typo in a comment ([email protected])
* Wed Aug 23 2023 Pino Toscano <[email protected]> 1.29.37-1
- Translated using Weblate (Korean) ([email protected])
- Update translation files ([email protected])
- 2225446: Hotfix of D-Bus policy ([email protected])
- TESTING: Update testing requirements ([email protected])
- Use Fedora registry to pull container images ([email protected])
- 2232316: dbus: check "force" again from the registration option
- dbus: run EntCertActionInvoker on PoolAttach ([email protected])
- ENT-5624: Properly translate error strings ([email protected])
- Mock IOError for Insights fact collection tests ([email protected])
- New extraction for translatable strings ([email protected])
* Wed Aug 02 2023 Pino Toscano <[email protected]> 1.29.36-1
- Translated using Weblate (Korean) ([email protected])
- ENT-5581: Update messaging around the "container mode" ([email protected])
- Remove 'dbus' marker for pytest ([email protected])
- Rewrite D-Bus tests to be testable without pytest-forked ([email protected])
- Drop further ethtool dependency mentions ([email protected])
- tests: fix test_file_monitor without pyinotify ([email protected])
- tests: switch from imp to importlib ([email protected])
- Fix the order of user env var checking for translations.
- 2215974: Collect network facts using 'ip' ([email protected])
- ENT-5582: Remove container detection envvar overwrite ([email protected])
- ENT-5603: Explicitly check for provided entitlement certificates
- fix test case ([email protected])
- Collect GCP Project information as cloud facts ([email protected])
- Collect Azure Subscription ID as a cloud fact (#3285) ([email protected])
- ENT-5580: Disable the proper container detection ([email protected])
- spec: convert License to SPDX ([email protected])
- 2093291: Make reading of cache file more reliable ([email protected])
- 2093291: Make code of DNF plugins testable ([email protected])
- spec: change subscription-manager dnf dep ([email protected])
- spec: update libdnf-plugin-subscription-manager deps ([email protected])
- tests: repair attach cases in SCA mode ([email protected])
* Tue May 16 2023 Pino Toscano <[email protected]> 1.29.35-1
- Translated using Weblate (Italian) ([email protected])
- Clean up tests using Cloud What detectors properly ([email protected])
- spec: Obsolete subscription-manager-migration ([email protected])
- Translated using Weblate (Chinese (Simplified) (zh_CN)) ([email protected])
- Translated using Weblate (Korean) ([email protected])
- Translated using Weblate (Georgian) ([email protected])
- Translated using Weblate (Italian) ([email protected])
- Update translation files ([email protected])
- New extraction for translatable strings ([email protected])
- Translated using Weblate (Italian) ([email protected])
- Typo fixes ([email protected])
- Avoid string puzzle ([email protected])
- Properly use ungettext for plural forms ([email protected])
- 2189664: cache: fix SyspurposeComplianceStatusCache on failed load
- dbus: don't catch exceptions in DomainSocketServer.run()
- cli: directly exit on InvalidCLIOptionError ([email protected])
- Revert "ENT-5549: Fix return code handling of CLI" ([email protected])
- ci: add dependabot config for GitHub Actions ([email protected])
- Update .git-blame-ignore-revs ([email protected])
- Format code with black==23.3.0 ([email protected])
- ENT-5535: Update black to version 23.3.0 ([email protected])
* Wed Apr 12 2023 Pino Toscano <[email protected]> 1.29.34-1
- Update TESTING.md ([email protected])
- Improved debug print of http traffic, when proxy is used ([email protected])
- ENT-5544: Remove Jenkins jobs, Containers ([email protected])
- ENT-5549: Remove unused code from entcertlib ([email protected])
- ENT-5549: Fix issues found when type-hinting ([email protected])
- ENT-5549: Fix return code handling of CLI ([email protected])
- ENT-5549: Fix found type hint issues ([email protected])
- ENT-5549: Fix object instantiation in EntitlementDirectory
- ENT-5549: Refactor ProductDirectory ([email protected])
- ENT-5549: Change internal implementation for some Cache methods
- ENT-5549: Clean up _sync_with_server arguments of cache objects
- ENT-5549: Remove 'autoheal' argument from Action clients ([email protected])
- Refactored code a little bit ([email protected])
- 2093291: Make locking more reliable ([email protected])
- test: add simple test for 2178610 ([email protected])
- Small improvement of debugging of http traffic ([email protected])
- 2093883: Fix issue with race condition in rhsm.service ([email protected])
- 2178610: do not collect unentitled products in SCA mode ([email protected])
- 2174297: register: do a simple strip() on environment(s) input
- Stop subclassing 'object' ([email protected])
- Remove pytest arguments for CentOS 9 Stream image ([email protected])
- tests: Install dnf-plugins-core every time ([email protected])
- 2169251: connection: restore UEPConnection.getJob() ([email protected])
- ENT-5106: Type-hint subscription_manager/ files ([email protected])
* Thu Feb 16 2023 Pino Toscano <[email protected]> 1.29.33-1
- Translated using Weblate (French) ([email protected])
- Translated using Weblate (Chinese (Simplified) (zh_CN)) ([email protected])
- Translated using Weblate (Japanese) ([email protected])
- Translated using Weblate (Japanese) ([email protected])
- Translated using Weblate (French) ([email protected])
- Translated using Weblate (Korean) ([email protected])
- Update translation files ([email protected])
- Translated using Weblate (Korean) ([email protected])
- ENT-5542: Build package using GitHub Actions ([email protected])
- Test libdnf plugin using GitHub Actions ([email protected])
- libdnf: fix return value of findProductId() ([email protected])
- ENT-5541: Publish PR coverage ([email protected])
- New extraction for translatable strings ([email protected])
- Translated using Weblate (Kannada) ([email protected])
- Translated using Weblate (Spanish) ([email protected])
- Simplify test setup for D-Bus fact collection ([email protected])
- ENT-3759: Test on GitHub Actions ([email protected])
* Mon Jan 16 2023 Pino Toscano <[email protected]> 1.29.32-1
- Translated using Weblate (French) ([email protected])
- Translated using Weblate (Chinese (Simplified) (zh_CN)) ([email protected])
- Translated using Weblate (Georgian) ([email protected])
- Translated using Weblate (Korean) ([email protected])
- Update translation files ([email protected])
- utils: import pkg_resources only when needed ([email protected])
- ENT-5536: Fix FileMonitor tests ([email protected])
- Alter import of rhsm.config functions ([email protected])
- Handle tests in containers better ([email protected])
- Call parent methods in DBusServerStubProvider ([email protected])
- Base D-Bus tests on SubManFixture ([email protected])
- ENT-5532: Call rhsm-package-profile-uploader with --force-upload
- 2108549: do not detect containers in OCP as such ([email protected])
- tests: extend InContainerTests for path checks ([email protected])
- Resolved issues in PR feedback ([email protected])
- Updated request handling in connection.py ([email protected])
- Resolve issues from PR review ([email protected])
- Removed fixme since activateMachine() is still used ([email protected])
- Black/flake8 fixes ([email protected])
- FIXME: renamed default argument to not shadow inbuilt type
- FIXME: removed Restlib and using only BaseRestLib ([email protected])
- FIXME: updated unregisterConsumer() to return True if status code is 204
- FIXME: changed unbindBySerial/unbindByPoolId to return bool
- FIXME: changed default value of facts in updateConsumerFacts()
- FIXME: sanitized email/lang variables in activateMachine()
- FIXME: made email argument required in activatemachine()
- FIXME: changed default value of serials argument to None
- FIXME: removed unused username/password arguments ([email protected])
- FIXME: raise exceptions where sanitizing guest Id returns None
- FIXME: renamed response argument to result in validateResponse()
- FIXME: rename info argument to params in _request() ([email protected])
- FIXME: added error message when redeeming subscription fails
- FIXME: removed unused UEPConnection class methods ([email protected])
- Fixed profile tests setting Package release numbers as int instead of str
- FIXME: changed epoch data type to str in Package class ([email protected])
- FIXME: added null-checks for stdout/stderr wrapper ([email protected])
- FIXME: re-iterated a fix is not needed for urlparse ([email protected])
- FIXME: added exception messages to parse_url() ([email protected])
- FIXME: changed lists to tuples in StatusSpinnerStyle class
- FIXME: fixed type hints for _normalize_string() ([email protected])
- FIXME: use super() instead of class name ([email protected])
- FIXME: fixed strings not being translated in is_log_level_valid()
- FIXME: resolved improper use of tempfile in save() ([email protected])
- FIXME: fixed config_file argument not being used in save()
- FIXME: updated default value for files_name argument in read()
- FIXME: fixed minor typo in bogus() ([email protected])
- FIXME: changed read() to return self instead of None ([email protected])
- FIXME: set default argument 'facts' to None in registerConsumer()
- FIXME: renamed argument 'type' to 'consumer_type' in registerConsumer()
- FIXME: ping() resolved in rhsm/connection.py ([email protected])
- Remove test dependency 'mock' ([email protected])
- Fix failures of D-Bus' Register tests ([email protected])
- Mark D-Bus tests ([email protected])
- 2131789: Outsource uploading DNF profile to rhsmcertd ([email protected])
- Catch generic OSError during HTTPSConnection.connect() ([email protected])
- New extraction for translatable strings ([email protected])
- Translated using Weblate (French) ([email protected])
- Translated using Weblate (Korean) ([email protected])
- Fix formatting of proxy errors w/o errno ([email protected])
- Catch also CertificateLoadingError for identity cert loading
- ENT-4286: Additional fix for exception handling ([email protected])
- Remove D-Bus env vars from container and CI files ([email protected])
- 2121350: Implement "force" register option in rhsm dbus python binding
- Show locals in pytest output ([email protected])
- Improve formatting of CertificateLoadingError ([email protected])
- Raise a new CertificateLoadingError on X.509 loading failures
- Improve formatting of UnknownContentException ([email protected])
- connection: improve the internal UnknownContentException
- utils: add terminal_printable_content ([email protected])
- connection: rename NetworkException to UnknownContentException
- Improve formatting of ProxyException ([email protected])
- connection: improve the internal ProxyException ([email protected])
- Improve formatting of socket.gaierror ([email protected])
- Improve formatting of ConnectionError ([email protected])
- Improve formatting of BadCertificateException ([email protected])
- connection: extend BadCertificateException w/ SSL exception
- connection: drop dead code ([email protected])
- ENT-4286: Simplify exception reporting with system_exit()
- 2136694: Clear progress messages properly ([email protected])
- rhsmcertd reads default_log_level from rhsm.conf ([email protected])
- 2097679: Additional fix for non-interactive parameters ([email protected])
- 2097679: Fixed script hang in non-interactive execution ([email protected])
* Wed Oct 19 2022 Christopher Snyder <[email protected]> 1.29.31-1
- warning: refname 'subscription-manager-1.29.30-1' is ambiguous.
- Translated using Weblate (Georgian) ([email protected])
- tests: fix typos in test method names ([email protected])
- 2125227: Fixed incorrect registration warning with yum/dnf
- 2094942: Fixed expected message for manual attach case ([email protected])
- ENT-5102: Type-hint rhsmlib/facts ([email protected])
- 2094942: Improve warning message (auto-attach in SCA mode)
- Update INSTALL.md ([email protected])
- Remove unused classes of DBus tests ([email protected])
- ENT-5317: Update DBus tests of Unregister objects ([email protected])
- ENT-5317: Update DBus tests of Register objects ([email protected])
- ENT-5317: Update DBus tests of Products object ([email protected])
- ENT-5317: Update DBus tests of AllFacts object ([email protected])
- ENT-5317: Update DBus tests of Entitlement object ([email protected])
- Fix typo in method name of EntitlementService ([email protected])
- ENT-5317: Update DBus tests of Consumer object ([email protected])
- ENT-5317: Update DBus tests of Attach object ([email protected])
- Fix possible parsing issues of dmidecode output ([email protected])
- ENT-5317: New way to test DBus methods, starting with Config
- cockpit: disable the reference branch for sub-man-cockpit
- TESTING.md: Remove mention of pytest-xdist ([email protected])
- INSTALL.md: Update list of packages to be installed ([email protected])
- Stop calling pytest with --failed-first ([email protected])
- GCP: Better computing of cached token TTL ([email protected])
- 2101510: Fix D-Bus Register() and update entitlement certs
- 2120744: Close keycloak connection properly ([email protected])
- 2094942: [RFE] Improve the message, when SCA is enabled ([email protected])
- Replaced list[] with List[] and dict[] with Dict[]. ([email protected])
- Update TESTING.md ([email protected])
- Update README.md ([email protected])