import rhncfg-5.10.120-10.module+el8+2859+0dc20def

This commit is contained in:
CentOS Sources 2019-05-07 05:37:26 -04:00 committed by Andrew Lukoshko
commit 494e771a12
12 changed files with 1161 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/rhncfg-5.10.120.tar.gz

1
.rhncfg.metadata Normal file
View File

@ -0,0 +1 @@
21e98df25126c1745d47c7b96595d25478661b92 SOURCES/rhncfg-5.10.120.tar.gz

View File

@ -0,0 +1,23 @@
diff --git a/rhncfg.spec b/rhncfg.spec
index dc569f6..c6006c4 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -11,7 +11,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -255,6 +255,9 @@ fi
%endif
%changelog
+* Mon Mar 05 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-2
+- rebuild for rhel8
+
* Fri Feb 09 2018 Michael Mraka <michael.mraka@redhat.com> 5.10.120-1
- remove install/clean section initial cleanup
- removed Group from specfile

View File

@ -0,0 +1,32 @@
diff --git a/rhncfg.spec b/rhncfg.spec
index c6006c4..1078816 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -2,7 +2,7 @@
%global rhnconf %{_sysconfdir}/sysconfig/rhn
%global client_caps_dir %{rhnconf}/clientCaps.d
-%if 0%{?fedora} || 0%{?suse_version} > 1320
+%if 0%{?fedora} || 0%{?suse_version} > 1320 || 0%{?rhel} >= 8
%global build_py3 1
%global default_py3 1
%endif
@@ -11,7 +11,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -255,6 +255,9 @@ fi
%endif
%changelog
+* Wed Mar 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-3
+- build rhncfg for python3 (tkasparek@redhat.com)
+
* Mon Mar 05 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-2
- rebuild for rhel8

View File

@ -0,0 +1,155 @@
diff --git a/rhncfg.spec b/rhncfg.spec
index 1078816..898a9a3 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -7,11 +7,15 @@
%global default_py3 1
%endif
+%if ( 0%{?fedora} && 0%{?fedora} < 28 ) || ( 0%{?rhel} && 0%{?rhel} < 8 )
+%global build_py2 1
+%endif
+
%define pythonX %{?default_py3: python3}%{!?default_py3: python2}
Name: rhncfg
Version: 5.10.120
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -30,6 +34,7 @@ Requires: libselinux-python
%description
The base libraries and functions needed by all rhncfg-* packages.
+%if 0%{?build_py2}
%package -n python2-%{name}
Summary: Spacewalk Configuration Client Libraries
%{?python_provide:%python_provide python2-%{name}}
@@ -44,6 +49,7 @@ Requires: python-hashlib
BuildRequires: python
%description -n python2-%{name}
Python 2 specific files for %{name}.
+%endif
%if 0%{?build_py3}
%package -n python3-%{name}
@@ -70,12 +76,14 @@ Requires: %{pythonX}-%{name}-client = %{version}-%{release}
A command line interface to the client features of the RHN Configuration
Management system.
+%if 0%{?build_py2}
%package -n python2-%{name}-client
Summary: Spacewalk Configuration Client
%{?python_provide:%python_provide python2-%{name}-client}
Requires: %{name}-client = %{version}-%{release}
%description -n python2-%{name}-client
Python 2 specific files for %{name}-client.
+%endif
%if 0%{?build_py3}
%package -n python3-%{name}-client
@@ -95,12 +103,14 @@ Requires: %{pythonX}-%{name}-management = %{version}-%{release}
%description management
A command line interface used to manage Spacewalk configuration.
+%if 0%{?build_py2}
%package -n python2-%{name}-management
Summary: Spacewalk Configuration Management Client
%{?python_provide:%python_provide python2-%{name}-management}
Requires: %{name}-management = %{version}-%{release}
%description -n python2-%{name}-management
Python 2 specific files for python2-%{name}-management.
+%endif
%if 0%{?build_py3}
%package -n python3-%{name}-management
@@ -120,6 +130,7 @@ Requires: %{pythonX}-%{name}-actions = %{version}-%{release}
%description actions
The code required to run configuration actions scheduled via the RHN Classic website or Red Hat Satellite or Spacewalk.
+%if 0%{?build_py2}
%package -n python2-%{name}-actions
Summary: Spacewalk Configuration Client Actions
%{?python_provide:%python_provide python2-%{name}-actions}
@@ -127,6 +138,7 @@ Requires: %{name}-actions = %{version}-%{release}
Requires: python2-%{name}-client
%description -n python2-%{name}-actions
Python 2 specific files for python2-%{name}-actions.
+%endif
%if 0%{?build_py3}
%package -n python3-%{name}-actions
@@ -146,8 +158,10 @@ make -f Makefile.rhncfg all
%install
install -d $RPM_BUILD_ROOT/%{python_sitelib}
+%if 0%{?build_py2}
make -f Makefile.rhncfg install PREFIX=$RPM_BUILD_ROOT ROOT=%{python_sitelib} \
MANDIR=%{_mandir} PYTHONVERSION=%{python_version}
+%endif
%if 0%{?build_py3}
install -d $RPM_BUILD_ROOT/%{python3_sitelib}
sed -i 's|#!/usr/bin/python|#!/usr/bin/python3|' config_*/*.py actions/*.py
@@ -194,8 +208,10 @@ fi
%{_sharedstatedir}/rhncfg/backups
%doc LICENSE
+%if 0%{?build_py2}
%files -n python2-%{name}
%{python_sitelib}/config_common
+%endif
%if 0%{?build_py3}
%files -n python3-%{name}
@@ -207,9 +223,11 @@ fi
%attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-client.conf
%{_mandir}/man8/rhncfg-client.8*
+%if 0%{?build_py2}
%files -n python2-%{name}-client
%{python_sitelib}/config_client
%{_bindir}/rhncfg-client-%{python_version}
+%endif
%if 0%{?build_py3}
%files -n python3-%{name}-client
@@ -222,9 +240,11 @@ fi
%attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-manager.conf
%{_mandir}/man8/rhncfg-manager.8*
+%if 0%{?build_py2}
%files -n python2-%{name}-management
%{python_sitelib}/config_management
%{_bindir}/rhncfg-manager-%{python_version}
+%endif
%if 0%{?build_py3}
%files -n python3-%{name}-management
@@ -238,12 +258,14 @@ fi
%{_mandir}/man8/rhn-actions-control.8*
%ghost %attr(600,root,root) %{_localstatedir}/log/rhncfg-actions
+%if 0%{?build_py2}
%files -n python2-%{name}-actions
%{python_sitelib}/rhn/actions
%{_bindir}/rhn-actions-control-%{python_version}
%if 0%{?suse_version}
%dir %{python_sitelib}/rhn
%endif
+%endif
%if 0%{?build_py3}
%files -n python3-%{name}-actions
@@ -255,6 +277,10 @@ fi
%endif
%changelog
+* Tue Mar 20 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-4
+- don't build python2 subpackages on systems with default python3
+ (tkasparek@redhat.com)
+
* Wed Mar 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-3
- build rhncfg for python3 (tkasparek@redhat.com)

View File

@ -0,0 +1,35 @@
diff --git a/rhncfg.spec b/rhncfg.spec
index 898a9a3..5911dc8 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -15,7 +15,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -28,7 +28,11 @@ Requires: %{pythonX}-%{name} = %{version}-%{release}
# provide rhn directories and no selinux on suse
BuildRequires: rhn-client-tools
%else
+%if 0%{?build_py2}
Requires: libselinux-python
+%else
+Requires: python3-libselinux
+%endif
%endif
%description
@@ -277,6 +281,9 @@ fi
%endif
%changelog
+* Mon May 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-5
+- require python3-libselinux on python3 only OS (tkasparek@redhat.com)
+
* Tue Mar 20 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-4
- don't build python2 subpackages on systems with default python3
(tkasparek@redhat.com)

View File

@ -0,0 +1,82 @@
diff --git a/config_common/file_utils.py b/config_common/file_utils.py
index 29db4e2..4b18fe3 100644
--- a/config_common/file_utils.py
+++ b/config_common/file_utils.py
@@ -182,7 +182,7 @@ class FileProcessor:
#rip off the leading '0' from the mode returned by stat()
if cur_perm[0] == '0':
- cur_perm = cur_perm[1:]
+ cur_perm = cur_perm[2:] if cur_perm[1] == 'o' else cur_perm[1:]
#perm_status gets displayed with the verbose option.
if cur_perm == str(file_struct['filemode']):
@@ -223,7 +223,7 @@ class FileProcessor:
raise e
else:
result = ''.join(diff(temp_file, path,
- display_diff=get_config('display_diff')))
+ display_diff=get_config('display_diff'), is_binary=file_struct['is_binary']))
if temp_file:
os.unlink(temp_file)
@@ -236,26 +236,26 @@ class FileProcessor:
raise Exception("Missing key %s" % k)
-def diff(src, dst, srcname=None, dstname=None, display_diff=False):
- def f_content(path, name):
+def diff(src, dst, srcname=None, dstname=None, display_diff=False, is_binary=False):
+ def f_content(path, name, is_binary):
statinfo = None
if os.access(path, os.R_OK):
- f = open(path, 'U')
+ f = open(path, 'Ub' if is_binary else 'U')
content = f.readlines()
f.close()
statinfo = os.stat(path)
f_time = time.ctime(statinfo.st_mtime)
- if content and content[-1] and content[-1][-1] != "\n":
+ if not is_binary and content and content[-1] and content[-1][-1] != "\n":
content[-1] += "\n"
else:
content = []
f_time = time.ctime(0)
if not name:
name = path
- return (content, name, f_time, statinfo)
+ return (str(content), name, f_time, statinfo)
- (src_content, src_name, src_time, src_stat) = f_content(src, srcname)
- (dst_content, dst_name, dst_time, dst_stat) = f_content(dst, dstname)
+ (src_content, src_name, src_time, src_stat) = f_content(src, srcname, is_binary)
+ (dst_content, dst_name, dst_time, dst_stat) = f_content(dst, dstname, is_binary)
diff_u = difflib.unified_diff(src_content, dst_content,
src_name, dst_name,
diff --git a/rhncfg.spec b/rhncfg.spec
index 5911dc8..1b9003b 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -15,7 +15,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -281,6 +281,12 @@ fi
%endif
%changelog
+* Mon May 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-6
+- Resolves: #1577138 - when loading a file take into account if it's binary or
+ not (tkasparek@redhat.com)
+- Resolves: #1572652 - do not report that files differ due to python3 octal
+ number represenatation (tkasparek@redhat.com)
+
* Mon May 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-5
- require python3-libselinux on python3 only OS (tkasparek@redhat.com)

View File

@ -0,0 +1,38 @@
diff --git a/rhncfg.spec b/rhncfg.spec
index 1b9003b..54b6050 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -15,7 +15,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -28,10 +28,10 @@ Requires: %{pythonX}-%{name} = %{version}-%{release}
# provide rhn directories and no selinux on suse
BuildRequires: rhn-client-tools
%else
-%if 0%{?build_py2}
-Requires: libselinux-python
-%else
+%if 0%{?default_py3}
Requires: python3-libselinux
+%else
+Requires: libselinux-python
%endif
%endif
@@ -281,6 +281,10 @@ fi
%endif
%changelog
+* Tue Jul 24 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-7
+- Resolves: #1601754 - require python3 version of dependencies on systems with
+ default py3 (tkasparek@redhat.com)
+
* Mon May 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-6
- Resolves: #1577138 - when loading a file take into account if it's binary or
not (tkasparek@redhat.com)

View File

@ -0,0 +1,37 @@
diff --git a/config_common/file_utils.py b/config_common/file_utils.py
index 4b18fe3..f334bd5 100644
--- a/config_common/file_utils.py
+++ b/config_common/file_utils.py
@@ -252,7 +252,7 @@ def diff(src, dst, srcname=None, dstname=None, display_diff=False, is_binary=Fal
f_time = time.ctime(0)
if not name:
name = path
- return (str(content), name, f_time, statinfo)
+ return (content, name, f_time, statinfo)
(src_content, src_name, src_time, src_stat) = f_content(src, srcname, is_binary)
(dst_content, dst_name, dst_time, dst_stat) = f_content(dst, dstname, is_binary)
diff --git a/rhncfg.spec b/rhncfg.spec
index 54b6050..f5e1833 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -15,7 +15,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -281,6 +281,10 @@ fi
%endif
%changelog
+* Tue Nov 06 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-8
+- Resolves: rhbz#1645005 - unified_diff takes list, not string as a paremeter
+ (tkasparek@redhat.com)
+
* Tue Jul 24 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-7
- Resolves: #1601754 - require python3 version of dependencies on systems with
default py3 (tkasparek@redhat.com)

View File

@ -0,0 +1,85 @@
diff --git a/config_common/file_utils.py b/config_common/file_utils.py
index f334bd5..380f7a3 100644
--- a/config_common/file_utils.py
+++ b/config_common/file_utils.py
@@ -33,6 +33,9 @@ from config_common import utils
from config_common.local_config import get as get_config
from rhn.i18n import bstr, sstr
+decodestring = base64.decodestring
+if hasattr(base64, 'decodebytes'):
+ decodestring = base64.decodebytes
class FileProcessor:
file_struct_fields = {
@@ -77,7 +80,7 @@ class FileProcessor:
contents = file_struct['file_contents']
if contents and (encoding == 'base64'):
- contents = base64.decodestring(bstr(contents))
+ contents = decodestring(bstr(contents))
delim_start = file_struct['delim_start']
delim_end = file_struct['delim_end']
@@ -222,8 +225,8 @@ class FileProcessor:
else:
raise e
else:
- result = ''.join(diff(temp_file, path,
- display_diff=get_config('display_diff'), is_binary=file_struct['is_binary']))
+ result = ''.join(diff(temp_file, path, display_diff=get_config('display_diff'),
+ is_binary=True if file_struct['is_binary'] == 'Y' else False))
if temp_file:
os.unlink(temp_file)
@@ -240,8 +243,9 @@ def diff(src, dst, srcname=None, dstname=None, display_diff=False, is_binary=Fal
def f_content(path, name, is_binary):
statinfo = None
if os.access(path, os.R_OK):
- f = open(path, 'Ub' if is_binary else 'U')
- content = f.readlines()
+ f = open(path, ('rb' if is_binary else 'r') if int(sys.version[0]) == 3 else \
+ ('Ub' if is_binary else 'U'))
+ content = [sstr(i) for i in f.readlines()]
f.close()
statinfo = os.stat(path)
f_time = time.ctime(statinfo.st_mtime)
diff --git a/config_common/utils.py b/config_common/utils.py
index 6669869..21ad4c1 100644
--- a/config_common/utils.py
+++ b/config_common/utils.py
@@ -32,7 +32,9 @@ from rhn.i18n import bstr
hashlib_has_usedforsecurity = False
-if 'usedforsecurity' in inspect.getargspec(hashlib.new)[0]:
+if not hasattr(inspect, 'getfullargspec'):
+ inspect.getfullargspec = inspect.getargspec
+if 'usedforsecurity' in inspect.getfullargspec(hashlib.new)[0]:
hashlib_has_usedforsecurity = True
_normpath_re = re.compile("^(%s)+" % os.sep)
diff --git a/rhncfg.spec b/rhncfg.spec
index f5e1833..cc2068e 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -15,7 +15,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -281,6 +281,10 @@ fi
%endif
%changelog
+* Mon Feb 04 2019 Michael Mraka <michael.mraka@redhat.com> 5.10.120-9
+- Resolves: #1665858 - diff expects string not bytes
+- Resolves: #1622961 - avoid deprecated fucntions when running on python3
+
* Tue Nov 06 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-8
- Resolves: rhbz#1645005 - unified_diff takes list, not string as a paremeter
(tkasparek@redhat.com)

View File

@ -0,0 +1,33 @@
diff --git a/rhncfg.spec b/rhncfg.spec
index cc2068e..658d25f 100644
--- a/rhncfg.spec
+++ b/rhncfg.spec
@@ -15,7 +15,7 @@
Name: rhncfg
Version: 5.10.120
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
@@ -60,7 +60,7 @@ Python 2 specific files for %{name}.
Summary: Spacewalk Configuration Client Libraries
%{?python_provide:%python_provide python3-%{name}}
Requires: %{name} = %{version}-%{release}
-Requires: python3
+%{?__python3:Requires: %{__python3}}
Requires: python3-rhnlib >= 2.8.3
Requires: python3-spacewalk-usix
Requires: python3-rhn-client-tools >= 2.8.4
@@ -281,6 +281,10 @@ fi
%endif
%changelog
+* Tue Mar 05 2019 Michael Mraka <michael.mraka@redhat.com> 5.10.120-10
+- Resolves: #1633713 - Require the Python interpreter directly instead of using
+ the package name
+
* Mon Feb 04 2019 Michael Mraka <michael.mraka@redhat.com> 5.10.120-9
- Resolves: #1665858 - diff expects string not bytes
- Resolves: #1622961 - avoid deprecated fucntions when running on python3

639
SPECS/rhncfg.spec Normal file
View File

@ -0,0 +1,639 @@
%global rhnroot %{_datadir}/rhn
%global rhnconf %{_sysconfdir}/sysconfig/rhn
%global client_caps_dir %{rhnconf}/clientCaps.d
%if 0%{?fedora} || 0%{?suse_version} > 1320 || 0%{?rhel} >= 8
%global build_py3 1
%global default_py3 1
%endif
%if ( 0%{?fedora} && 0%{?fedora} < 28 ) || ( 0%{?rhel} && 0%{?rhel} < 8 )
%global build_py2 1
%endif
%define pythonX %{?default_py3: python3}%{!?default_py3: python2}
Name: rhncfg
Version: 5.10.120
Release: 10%{?dist}
Summary: Spacewalk Configuration Client Libraries
License: GPLv2
URL: https://github.com/spacewalkproject/spacewalk
Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz
Patch0: rhncfg-5.10.120-1-to-rhncfg-5.10.120-2-el8.patch
Patch1: rhncfg-5.10.120-2-el8-to-rhncfg-5.10.120-3-el8.patch
Patch2: rhncfg-5.10.120-3-el8-to-rhncfg-5.10.120-4-el8.patch
Patch3: rhncfg-5.10.120-4-el8-to-rhncfg-5.10.120-5-el8.patch
Patch4: rhncfg-5.10.120-5-el8-to-rhncfg-5.10.120-6-el8.patch
Patch5: rhncfg-5.10.120-6-el8-to-rhncfg-5.10.120-7-el8.patch
Patch6: rhncfg-5.10.120-7-el8-to-rhncfg-5.10.120-8-el8.patch
Patch7: rhncfg-5.10.120-8-el8-to-rhncfg-5.10.120-9-el8.patch
Patch8: rhncfg-5.10.120-9-el8-to-rhncfg-5.10.120-10-el8.patch
BuildArch: noarch
BuildRequires: docbook-utils
Requires: %{pythonX}-%{name} = %{version}-%{release}
%if 0%{?suse_version}
# provide rhn directories and no selinux on suse
BuildRequires: rhn-client-tools
%else
%if 0%{?default_py3}
Requires: python3-libselinux
%else
Requires: libselinux-python
%endif
%endif
%description
The base libraries and functions needed by all rhncfg-* packages.
%if 0%{?build_py2}
%package -n python2-%{name}
Summary: Spacewalk Configuration Client Libraries
%{?python_provide:%python_provide python2-%{name}}
Requires: %{name} = %{version}-%{release}
Requires: python
Requires: rhnlib >= 2.8.3
Requires: spacewalk-usix
Requires: python2-rhn-client-tools >= 2.8.4
%if 0%{?rhel} <= 5
Requires: python-hashlib
%endif
BuildRequires: python
%description -n python2-%{name}
Python 2 specific files for %{name}.
%endif
%if 0%{?build_py3}
%package -n python3-%{name}
Summary: Spacewalk Configuration Client Libraries
%{?python_provide:%python_provide python3-%{name}}
Requires: %{name} = %{version}-%{release}
%{?__python3:Requires: %{__python3}}
Requires: python3-rhnlib >= 2.8.3
Requires: python3-spacewalk-usix
Requires: python3-rhn-client-tools >= 2.8.4
BuildRequires: python3
BuildRequires: python3-rpm-macros
%description -n python3-%{name}
Python 3 specific files for %{name}.
%endif
%package client
Summary: Spacewalk Configuration Client
Requires: %{name} = %{version}-%{release}
Requires: %{pythonX}-%{name}-client = %{version}-%{release}
%description client
A command line interface to the client features of the RHN Configuration
Management system.
%if 0%{?build_py2}
%package -n python2-%{name}-client
Summary: Spacewalk Configuration Client
%{?python_provide:%python_provide python2-%{name}-client}
Requires: %{name}-client = %{version}-%{release}
%description -n python2-%{name}-client
Python 2 specific files for %{name}-client.
%endif
%if 0%{?build_py3}
%package -n python3-%{name}-client
Summary: Spacewalk Configuration Client
%{?python_provide:%python_provide python3-%{name}-client}
Requires: %{name}-client = %{version}-%{release}
%description -n python3-%{name}-client
Python 3 specific files for %{name}-client.
%endif
%package management
Summary: Spacewalk Configuration Management Client
Requires: %{name} = %{version}-%{release}
Requires: %{pythonX}-%{name}-management = %{version}-%{release}
%description management
A command line interface used to manage Spacewalk configuration.
%if 0%{?build_py2}
%package -n python2-%{name}-management
Summary: Spacewalk Configuration Management Client
%{?python_provide:%python_provide python2-%{name}-management}
Requires: %{name}-management = %{version}-%{release}
%description -n python2-%{name}-management
Python 2 specific files for python2-%{name}-management.
%endif
%if 0%{?build_py3}
%package -n python3-%{name}-management
Summary: Spacewalk Configuration Management Client
%{?python_provide:%python_provide python3-%{name}-management}
Requires: %{name}-management = %{version}-%{release}
%description -n python3-%{name}-management
Python 2 specific files for python3-%{name}-management.
%endif
%package actions
Summary: Spacewalk Configuration Client Actions
Requires: %{name} = %{version}-%{release}
Requires: %{pythonX}-%{name}-actions = %{version}-%{release}
%description actions
The code required to run configuration actions scheduled via the RHN Classic website or Red Hat Satellite or Spacewalk.
%if 0%{?build_py2}
%package -n python2-%{name}-actions
Summary: Spacewalk Configuration Client Actions
%{?python_provide:%python_provide python2-%{name}-actions}
Requires: %{name}-actions = %{version}-%{release}
Requires: python2-%{name}-client
%description -n python2-%{name}-actions
Python 2 specific files for python2-%{name}-actions.
%endif
%if 0%{?build_py3}
%package -n python3-%{name}-actions
Summary: Spacewalk Configuration Client Actions
%{?python_provide:%python_provide python3-%{name}-actions}
Requires: %{name}-actions = %{version}-%{release}
Requires: python3-%{name}-client
%description -n python3-%{name}-actions
Python 3 specific files for python2-%{name}-actions.
%endif
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
make -f Makefile.rhncfg all
%install
install -d $RPM_BUILD_ROOT/%{python_sitelib}
%if 0%{?build_py2}
make -f Makefile.rhncfg install PREFIX=$RPM_BUILD_ROOT ROOT=%{python_sitelib} \
MANDIR=%{_mandir} PYTHONVERSION=%{python_version}
%endif
%if 0%{?build_py3}
install -d $RPM_BUILD_ROOT/%{python3_sitelib}
sed -i 's|#!/usr/bin/python|#!/usr/bin/python3|' config_*/*.py actions/*.py
make -f Makefile.rhncfg install PREFIX=$RPM_BUILD_ROOT ROOT=%{python3_sitelib} \
MANDIR=%{_mandir} PYTHONVERSION=%{python3_version}
%endif
mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/rhncfg/backups
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/spool/rhn
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log
touch $RPM_BUILD_ROOT/%{_localstatedir}/log/rhncfg-actions
# create links to default script version
%define default_suffix %{?default_py3:-%{python3_version}}%{!?default_py3:-%{python_version}}
for i in \
/usr/bin/rhncfg-client \
/usr/bin/rhncfg-manager \
/usr/bin/rhn-actions-control \
; do
ln -s $(basename "$i")%{default_suffix} "$RPM_BUILD_ROOT$i"
done
%if 0%{?suse_version}
%py_compile -O %{buildroot}/%{python_sitelib}
%if 0%{?build_py3}
%py3_compile -O %{buildroot}/%{python3_sitelib}
%endif
%endif
%clean
%post
if [ -f %{_localstatedir}/log/rhncfg-actions ]
then
chown root %{_localstatedir}/log/rhncfg-actions
chmod 600 %{_localstatedir}/log/rhncfg-actions
fi
%files
%if 0%{?suse_version}
%dir %{_sharedstatedir}
%endif
%dir %{_sharedstatedir}/rhncfg
%dir %{_localstatedir}/spool/rhn
%{_sharedstatedir}/rhncfg/backups
%doc LICENSE
%if 0%{?build_py2}
%files -n python2-%{name}
%{python_sitelib}/config_common
%endif
%if 0%{?build_py3}
%files -n python3-%{name}
%{python3_sitelib}/config_common
%endif
%files client
%{_bindir}/rhncfg-client
%attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-client.conf
%{_mandir}/man8/rhncfg-client.8*
%if 0%{?build_py2}
%files -n python2-%{name}-client
%{python_sitelib}/config_client
%{_bindir}/rhncfg-client-%{python_version}
%endif
%if 0%{?build_py3}
%files -n python3-%{name}-client
%{python3_sitelib}/config_client
%{_bindir}/rhncfg-client-%{python3_version}
%endif
%files management
%{_bindir}/rhncfg-manager
%attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-manager.conf
%{_mandir}/man8/rhncfg-manager.8*
%if 0%{?build_py2}
%files -n python2-%{name}-management
%{python_sitelib}/config_management
%{_bindir}/rhncfg-manager-%{python_version}
%endif
%if 0%{?build_py3}
%files -n python3-%{name}-management
%{python3_sitelib}/config_management
%{_bindir}/rhncfg-manager-%{python3_version}
%endif
%files actions
%{_bindir}/rhn-actions-control
%config(noreplace) %{client_caps_dir}/*
%{_mandir}/man8/rhn-actions-control.8*
%ghost %attr(600,root,root) %{_localstatedir}/log/rhncfg-actions
%if 0%{?build_py2}
%files -n python2-%{name}-actions
%{python_sitelib}/rhn/actions
%{_bindir}/rhn-actions-control-%{python_version}
%if 0%{?suse_version}
%dir %{python_sitelib}/rhn
%endif
%endif
%if 0%{?build_py3}
%files -n python3-%{name}-actions
%{python3_sitelib}/rhn/actions
%{_bindir}/rhn-actions-control-%{python3_version}
%if 0%{?suse_version}
%dir %{python3_sitelib}/rhn
%endif
%endif
%changelog
* Tue Mar 05 2019 Michael Mraka <michael.mraka@redhat.com> 5.10.120-10
- Resolves: #1633713 - Require the Python interpreter directly instead of using
the package name
* Mon Feb 04 2019 Michael Mraka <michael.mraka@redhat.com> 5.10.120-9
- Resolves: #1665858 - diff expects string not bytes
- Resolves: #1622961 - avoid deprecated fucntions when running on python3
* Tue Nov 06 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-8
- Resolves: rhbz#1645005 - unified_diff takes list, not string as a paremeter
(tkasparek@redhat.com)
* Tue Jul 24 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-7
- Resolves: #1601754 - require python3 version of dependencies on systems with
default py3 (tkasparek@redhat.com)
* Mon May 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-6
- Resolves: #1577138 - when loading a file take into account if it's binary or
not (tkasparek@redhat.com)
- Resolves: #1572652 - do not report that files differ due to python3 octal
number represenatation (tkasparek@redhat.com)
* Mon May 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-5
- require python3-libselinux on python3 only OS (tkasparek@redhat.com)
* Tue Mar 20 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-4
- don't build python2 subpackages on systems with default python3
(tkasparek@redhat.com)
* Wed Mar 14 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-3
- build rhncfg for python3 (tkasparek@redhat.com)
* Mon Mar 05 2018 Tomas Kasparek <tkasparek@redhat.com> 5.10.120-2
- rebuild for rhel8
* Fri Feb 09 2018 Michael Mraka <michael.mraka@redhat.com> 5.10.120-1
- remove install/clean section initial cleanup
- removed Group from specfile
- removed BuildRoot from specfiles
* Tue Jan 02 2018 Jiri Dostal <jdostal@redhat.com> 5.10.119-1
- 1528252 - Add --config option to rhncfg-manager and rhncfg-client.
* Tue Dec 12 2017 Tomas Kasparek <tkasparek@redhat.com> 5.10.118-1
- 1498813 - add better handling of interrupted system calls
* Mon Oct 23 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.117-1
- rhncfg: add missing dirs to filelist for SUSE and enable py3 build on
Tumbleweed
* Wed Oct 18 2017 Jan Dobes 5.10.116-1
- rhncfg - unused string import
* Thu Oct 12 2017 Eric Herget <eherget@redhat.com> 5.10.115-1
- 1474872 - rhncfg-manager download-channel failed during download utf8
* Fri Oct 06 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.114-1
- write in binary mode
- import method from standard path
* Thu Oct 05 2017 Tomas Kasparek <tkasparek@redhat.com> 5.10.113-1
- 1498813 - store output in the action file so partial output can arrive to
server
- 1494389 - Revert "[1260527] RHEL7 reboot loop"
- 1494389 - Revert "1260527 - fix Python 2.4 syntax (RHEL5)"
* Thu Oct 05 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.112-1
- install files into python_sitelib/python3_sitelib
- move rhncfg-actions files into proper python2/python3 subpackages
- move rhncfg-management files into proper python2/python3 subpackages
- move rhncfg-client files into proper python2/python3 subpackages
- move rhncfg files into proper python2/python3 subpackages
- split rhncfg-actions into python2/python3 specific packages
- split rhncfg-management into python2/python3 specific packages
- split rhncfg-client into python2/python3 specific packages
- split rhncfg into python2/python3 specific packages
* Wed Sep 06 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.111-1
- purged changelog entries for Spacewalk 2.0 and older
* Wed Aug 09 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.110-1
- precompile py3 bytecode on Fedora 23+
- use standard brp-python-bytecompile
* Mon Aug 07 2017 Eric Herget <eherget@redhat.com> 5.10.109-1
- another pass to update copyright year
* Wed Aug 02 2017 Tomas Kasparek <tkasparek@redhat.com> 5.10.108-1
- 1455513 - print different message if file does not exist
- 1455513 - print a name of file which does not exist during diff
- 1455513 - tell user which file differs
* Tue Aug 01 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.107-1
- move version and release before sources
* Mon Jul 31 2017 Eric Herget <eherget@redhat.com> 5.10.106-1
- update copyright year
* Tue May 16 2017 Laurence Rochfort <laurence.rochfort@oracle.com>
- PR 543 - Add password config option to rhncfg-manager.
* Tue Apr 25 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.104-1
- 1105723 - execute remote commands in clean environment
* Fri Apr 07 2017 Michael Mraka <michael.mraka@redhat.com> 5.10.103-1
- fix missing import in rhncfg
- Updated links to github in spec files
- Migrating Fedorahosted to GitHub
* Wed Feb 22 2017 Eric Herget <eherget@redhat.com> 5.10.102-1
- 1361269 - Symlink target overwritten when the symlink is replaced by a file
managed by rhncfg-client
* Wed Feb 15 2017 Tomas Kasparek <tkasparek@redhat.com> 5.10.101-1
- require spacewalk-usix indead of spacewalk-backend-usix
* Thu Nov 24 2016 Jiri Dostal <jdostal@redhat.com> 5.10.100-1
- 1260527 - fix Python 2.4 syntax (RHEL5)
* Fri Nov 11 2016 Jiri Dostal <jdostal@redhat.com> 5.10.99-1
- [1260527] RHEL7 reboot loop
* Thu Oct 20 2016 Gennadii Altukhov <galt@redhat.com> 5.10.98-1
- 1381343 - make rhncfg action configfile compatible with Python 2/3
* Thu Sep 22 2016 Jan Dobes 5.10.97-1
- python 3.5 dropped MAXFD from subprocess, workaround by getting this value
directly
* Tue Jul 26 2016 Eric Herget <eherget@redhat.com> 5.10.96-1
- 1345843 - sane output when diff of binary config files
- 1358484 - dest file in diff output prefixed with '+++'
* Mon Jun 13 2016 Tomas Kasparek <tkasparek@redhat.com> 5.10.95-1
- Show info message as string - not array
- headers.get_all exists only in python 3
- verify doesn't work with binary files
* Thu Jun 09 2016 Gennadii Altukhov <galt@redhat.com> 5.10.94-1
- 1343653 - Uploading binary file by rhncfg-manager doesn't work in Fedora 23
* Wed May 25 2016 Tomas Kasparek <tkasparek@redhat.com> 5.10.93-1
- updating copyright years
* Wed May 18 2016 Tomas Kasparek <tkasparek@redhat.com> 5.10.92-1
- convert string to work in python 3
- method os.path.walk doesn't exist in Python 3
* Tue May 17 2016 Tomas Kasparek <tkasparek@redhat.com> 5.10.91-1
- fix 'ValueError: invalid literal for int() with base 10' in python 3
* Tue May 03 2016 Gennadii Altukhov <galt@redhat.com> 5.10.90-1
- fix remote command doesn't work in Python 3
- Fix typo
* Fri Apr 29 2016 Gennadii Altukhov <galt@redhat.com> 5.10.89-1
- used defined values from rpclib
- Fix: 'generator' object has no attribute 'next' in Python 3
- sys.exc_type and sys.exc_value is deprecated since version 1.5
- open /dev/tty to work in python 3
- basestring contains type str and bytes in python3
- urllib compatibility in python 2/3
- function raw_input doesn't exist in python 3
- fixed TypeError: expected bytes-like object, not str
- modified raise to work in python 2/3
- rewrite function map and filter to clause 'for'
- method iteritems was renamed to items
- fix module ConfigParser was moved in python3
- fix library xmlrpc was moved in python3
- compatibility for octal format of number
- replaced method has_key to work with python 2/3
- replaced call apply to work in python 3
- modified exception and raise to work in python 2/3
- build package for fedora 23+ with default python 3
- replaced string module calls to work in python 2/3
- modified imports to compatibility with python 2/3
- function print compatibility for python 2 and 3
* Mon Feb 29 2016 Gennadii Altukhov <galt@redhat.com> 5.10.88-1
- 1309003 fixing removing of temporary files during transaction rollback for
rhncfg-manager.
- 1309006 fixing removing directories which rhncfg-manager didn't create.
* Thu Oct 29 2015 Jan Dobes 5.10.87-1
- 518128 - python 2.4 compatibility
* Thu Oct 29 2015 Jan Dobes 5.10.86-1
- 518128 - remove temporary files when exception occurs
* Tue Aug 25 2015 Tomas Kasparek <tkasparek@redhat.com> 5.10.85-1
- specify that md5 is not used for security purposes
* Fri Jul 10 2015 Matej Kollar <mkollar@redhat.com> 5.10.84-1
- Unused code removal
* Thu Mar 19 2015 Grant Gainey 5.10.83-1
- Updating copyright info for 2015
* Thu Mar 05 2015 Matej Kollar <mkollar@redhat.com> 5.10.82-1
- 1199197 - Avoid addition of None and str
* Mon Jan 19 2015 Matej Kollar <mkollar@redhat.com> 5.10.81-1
- 1177656 - Normalize path sooner
* Tue Jan 13 2015 Matej Kollar <mkollar@redhat.com> 5.10.80-1
- 1177656 - Fix directory creation
- Getting rid of Tabs and trailing spaces in Python
- Getting rid of Tabs and trailing spaces in LICENSE, COPYING, and README files
* Fri Oct 03 2014 Stephen Herr <sherr@redhat.com> 5.10.79-1
- 1148250 - errror in rhncfg if selinux off, rhel 5, and new libselinux-python
* Tue Sep 16 2014 Stephen Herr <sherr@redhat.com> 5.10.78-1
- 1142337 - rhncfg throws exception when verifying config files with macros
* Thu Sep 11 2014 Stephen Herr <sherr@redhat.com> 5.10.77-1
- 1133652 - make rhncfg support sha256 and use it by default
* Mon Aug 25 2014 Stephen Herr <sherr@redhat.com> 5.10.76-1
- 1133652 - validate the content of config files before deploying
* Thu Jul 31 2014 Stephen Herr <sherr@redhat.com> 5.10.75-1
- Avoid traceback with a configfiles upload action with no selinux context
* Tue Jul 22 2014 Stephen Herr <sherr@redhat.com> 5.10.74-1
- 1120802 - make webui config dir diff work
- bumping rhncfg version to avoid tag collision with 2.2
* Thu Jul 17 2014 Stephen Herr <sherr@redhat.com> 5.10.72-1
- 1120802 - remove debuging output and fix perm comparison from previous patch
- 1120802 - ensure webui config file diff looks at owner and permissions
* Wed Jul 16 2014 Stephen Herr <sherr@redhat.com> 5.10.71-1
- 1113848 - make sure webui doesn't say there are diffs if there aren't
- bz1113848 - Reverting changes of 1003459 and making GUI results compatible to
rhncfg-client
* Fri Jul 11 2014 Milan Zazrivec <mzazrivec@redhat.com> 5.10.70-1
- fix copyright years
* Thu May 29 2014 Michael Mraka <michael.mraka@redhat.com> 5.10.69-1
- list / elist: allow to specify list of files
* Thu Apr 24 2014 Stephen Herr <sherr@redhat.com> 5.10.68-1
- 1089729 - fix for assigning all groups user belongs to running process
* Mon Apr 14 2014 Michael Mraka <michael.mraka@redhat.com> 5.10.67-1
- fixes bnc871549 uncaught exception config deploy
* Fri Mar 14 2014 Michael Mraka <michael.mraka@redhat.com> 5.10.66-1
- show server modified time with rhncfg-client diff
* Thu Oct 10 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.65-1
- cleaning up old svn Ids
* Fri Oct 04 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.64-1
- Adding fallback support for numeric UID/GID
* Mon Sep 30 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.63-1
- removed trailing whitespaces
* Mon Sep 23 2013 Grant Gainey <ggainey@redhat.com> 5.10.62-1
- 1006480 - Another problem was hidden by the previous one - Have to lay down
directories to where the rhncfg-actions logfile is set - Make it clearer
that the scripts-output should go to a different place than where the
rhncfg code logs itself to
* Tue Sep 17 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.61-1
- Grammar error occurred
* Wed Sep 11 2013 Grant Gainey <ggainey@redhat.com> 5.10.60-1
- 1006480 - os.write() is for file-descriptors, not *files*
* Mon Sep 09 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.59-1
- 918036 - update man page for rhncfg-manager
* Thu Sep 05 2013 Milan Zazrivec <mzazrivec@redhat.com> 5.10.58-1
- 1002880 - Selinux status check for diff function from cli
* Wed Sep 04 2013 Stephen Herr <sherr@redhat.com> 5.10.57-1
- 908011 - require correct rhn-client-tools for RHEL 5
* Wed Aug 28 2013 Stephen Herr <sherr@redhat.com> 5.10.56-1
- 1002193 - remove spacewalk-backend-libs dependency from rhncfg
* Wed Jul 17 2013 Tomas Kasparek <tkasparek@redhat.com> 5.10.55-1
- updating copyright years
* Wed Jun 26 2013 Dimitar Yordanov <dyordano@redhat.com> 5.10.54-1
- 918034 - rhncfg-* --server-name now overwrites rhncfg-*.conf
* Thu Jun 20 2013 Matej Kollar <mkollar@redhat.com> 5.10.53-1
- Fix and simplyfy deci_to_octal conversion
* Wed Jun 19 2013 Jan Dobes 5.10.52-1
- 957506 - unicode support for Remote Command scripts
* Tue Jun 18 2013 Dimitar Yordanov <dyordano@redhat.com> 5.10.51-1
- 918036 - RFE - rhncfg-manager supports --username and --password from CLI
* Mon Jun 17 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.50-1
- branding fixes in man pages
- more branding cleanup
* Mon Jun 17 2013 Tomas Kasparek <tkasparek@redhat.com> 5.10.49-1
- rebranding few more strings in client stuff
* Wed Jun 12 2013 Tomas Kasparek <tkasparek@redhat.com> 5.10.48-1
- rebranding RHN Satellite to Red Hat Satellite in client stuff
* Tue May 21 2013 Tomas Kasparek <tkasparek@redhat.com> 5.10.47-1
- branding clean-up of client tools
* Fri Apr 12 2013 Grant Gainey 5.10.46-1
- 951243 - Let remote-cmds log to the local machine in addition to sending
results back to SW
* Tue Apr 09 2013 Stephen Herr <sherr@redhat.com> 5.10.45-1
- 947639 - make rhncfg less stupid
* Thu Apr 04 2013 Stephen Herr <sherr@redhat.com> 5.10.44-1
- 948605 - make diffs initiated from Satellite obey display_diff config option
- Purging %%changelog entries preceding Spacewalk 1.0, in active packages.
* Tue Feb 12 2013 Michael Mraka <michael.mraka@redhat.com> 5.10.43-1
- cleanup old accidentaly commited eclipse project files
* Wed Feb 06 2013 Stephen Herr <sherr@redhat.com> 5.10.42-1
- 908011 - make rhncfg depend on correct version of rhn-client-tools for RHEL
- 908011 - make rhncfg depend on newer rhn-client-tools
* Mon Feb 04 2013 Jan Pazdziora 5.10.41-1
- 856608 - moved rhncfg dependency on spacewalk-backend-libs to base package
All sub-packages now require it
* Mon Jan 28 2013 Stephen Herr <sherr@redhat.com> 5.10.40-1
- 903534 - Web UI config diff always shows 'binary files differ'