-
Notifications
You must be signed in to change notification settings - Fork 120
/
subscription-manager.spec
6764 lines (6372 loc) · 349 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.30.2
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
# on newer rhels and Fedora setuptools is not needed on runtime at all
%if (0%{?rhel} && 0%{?rhel} == 8)
Requires: platform-python-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
BuildRequires: glib2-devel
%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
%{_sysusersdir}/rhsm.conf
%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/*.py*
%{python_sitearch}/cloud_what/providers/*.py*
%{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 consumer certificates and keys readable by group rhsm
find /etc/pki/consumer -mindepth 1 -maxdepth 1 -name '*.pem' | xargs --no-run-if-empty chgrp rhsm
find /etc/pki/consumer -mindepth 1 -maxdepth 1 -name '*.pem' | xargs --no-run-if-empty chmod g+r
# 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 26 2024 Pino Toscano <[email protected]> 1.30.2-1
- Translated using Weblate (Georgian) ([email protected])
- feat: Create consumer cert & key owner by rhsm group ([email protected])
- feat: Add rhsm group during installation of subman RPM ([email protected])
- feat: dnf plugin - outsource uploading of profile to rhsmcertd.
- docs: remove references to removed commands ([email protected])
- feat: Remove auto-attach command ([email protected])
- feat: Eliminate command 'remove' from subscription-manager
- feat: Remove attach from bash completion script ([email protected])
- feat: Remove references on auto-attach in man page ([email protected])
- feat: Removed attach service ([email protected])
- feat: Removed D-Bus methods related to attach ([email protected])
- feat: Removed attach command and CLI option related to attach
- feat: Remove 'addons' subcommand(s) ([email protected])
- feat: Removed command "redeem" from subscription-manager ([email protected])
- Update the correct man page file. ([email protected])
- docs: Change reverse proxy to proxy in man page ([email protected])
- test(ci): Improve container pre-test script ([email protected])
* Wed Aug 21 2024 Pino Toscano <[email protected]> 1.30.1-1
- feat: forcefully switch automatic cloud registration to v1
* Fri Aug 16 2024 Pino Toscano <[email protected]> 1.30.0-1
- Translated using Weblate (Russian) ([email protected])
- Translated using Weblate (Korean) ([email protected])
- chore: Format register.py ([email protected])
- feat: Require SCA for registration ([email protected])
- doc: Update install and testing guide ([email protected])
- Fixed spec file to list packages twice ([email protected])
- code review comments fixes - update metadata and test. ([email protected])
- feat: Disable anonymous cloud registration temporarily ([email protected])
- Collect Azure VM Name and Resource Group Name as a cloud fact.
- fix: Improve wording in redhat.repo template ([email protected])
- Remove commands moved to syspurpose ([email protected])
- doc: drop references to "activate" ([email protected])
- feat: Remove import command ([email protected])
- fix: make SyspurposeComplianceStatusCache.get_overall_status() always usable
- fix: Change order of checks ([email protected])
- fix: Cache shouldn't try to get data from server without UUID
- feat: Add option to run smoke tests with fake IMDS servers.
- fix: Hide subscription management "errors" in container mode
- feat(ci): Update testing matrix ([email protected])
- fix(test): Properly stop method mock ([email protected])
- feat: Azure: added extended location and type of location fact
- fix: Update version of Azure metadata ([email protected])
- feat: Added Azure location to facts ([email protected])
- feat: Added zone GCP fact ([email protected])
- feat: Added more AWS cloud facts ([email protected])
- fix: Change type hint according returned value. ([email protected])
- feat: Add warning message about release version to dnf plugin
- Bump black from 23.3.0 to 24.3.0
(49699333+dependabot[bot]@users.noreply.github.com)
- Format code with black==24.3.0 ([email protected])
- Fix memory leaks in test-productdb.c ([email protected])
- Fix memory leaks in productdb.c ([email protected])
- fix: Function prototype without declaration is deprecated
- Removed unused includes of .h files ([email protected])
- libdnf: switch from g_error_free() to g_clear_error() in tests
- libdnf: do not build test code in plugin ([email protected])
- Change handling of deprecated `datetime.datetime.utcnow()`
- CCT-66: Update identity reporting in DNF plugin during autoregistration
- Remove automatic registration delay for rhsmcertd ([email protected])
- Remove API endpoint for automatic cloud registration v1 ([email protected])
- CCT-67: Use automatic registration v2 ([email protected])
- IdentityUpdateAction: Improve logging for updating identity certificates
- Identity: Add method to extract current owner ([email protected])
- rhsmcertd: Define exit codes ([email protected])
- rhsmcertd: Use module-level logger ([email protected])
- Add AnonymousCertificateManager ([email protected])
- Add CloudTokenCache for Candlepin JWT ([email protected])
- Implement API endpoints for Automatic registration v2 ([email protected])
- Update documentation for one API call in connection.py ([email protected])
- Fix type hint of RegisterService.register() ([email protected])
- rhsmcertd: Drop D-Bus loop code ([email protected])
- rhsmcertd: Add type hints ([email protected])
- rhsmcertd: Remove forgotten old comment ([email protected])
- Stop logging full lscpu output ([email protected])
- Prevent double-logging of syspurpose cache log statement ([email protected])
- Update the log message containing response time statistics
- CCT-266: Update TLS flags ([email protected])
* Thu Jan 18 2024 Pino Toscano <[email protected]> 1.29.40-1
- Translated using Weblate (Korean) ([email protected])
- Translated using Weblate (Chinese (Simplified) (zh_CN))
- spec: Add missing GLib dependency when building without DNF
- Remove deprecated `locale.*()` functions ([email protected])
- Remove version constraint of pytest ([email protected])
- RHEL-15110: RegisterServer is stopped, when not needed ([email protected])
- RHEL-15110: Fix issue with registration using gsd-subman ([email protected])
- Fix an error in debug logging of cloud-what ([email protected])
- ci: bump actions/upload-artifact from 3 to 4
(49699333+dependabot[bot]@users.noreply.github.com)
- Improve debug logging to make it faster to understand ([email protected])
* Thu Nov 23 2023 Pino Toscano <[email protected]> 1.29.39-1
- tito: drop bz requirement ([email protected])
- Translated using Weblate (Chinese (Simplified) (zh_CN)) ([email protected])
- RHEL-7206: Small change of message printed by dnf plugin ([email protected])
- CCT-118: Fix flake8 error E721 ([email protected])
- Fix type hint in rhsm ([email protected])
- Simplify autoregistration test setup ([email protected])
- RHEL-9435: Get AWS metadata via IMDSv2 ([email protected])
- Fixed inappropriate logical expression ([email protected])
- CCT-71: Try to ping server, when --proxy is used ([email protected])
- CCT-10: Ensure IPv6-based URLs are properly formatted ([email protected])
- RPM: Avoid needless runtime requirement on python3-setuptools
- cli: normalize hostname in error message ([email protected])
- connection: normalize hostname in ConnectionOSErrorException
- Improved printing of addresses and URLs ([email protected])
- Use username and password from --proxy=URL ([email protected])
- Use parse_url() from utils.py for parsing URL, when --proxy is used.
- 2225403: Parse URL properly ([email protected])
* 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])