dfa03f9
%{?python_enable_dependency_generator}
4c6c8a0
# virtual provides:
4c6c8a0
#   clufter        -> clufter-cli
4c6c8a0
#   clufter-lib    -> python.+-clufter (any if multiple)
4c6c8a0
#   python-clufter -> python2-clufter (subject of change)
4c6c8a0
ff813d2
# conditionals:
ff813d2
%bcond_with python2
ff813d2
b377517
# https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation
b377517
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
b377517
1390a93
Name:           clufter
22a7ab4
Version:        0.77.2
d70afaf
Release:        7%{?dist}
1390a93
Summary:        Tool/library for transforming/analyzing cluster configuration formats
1390a93
License:        GPLv2+
66c5d87
URL:            https://pagure.io/%{name}
1390a93
dc9bab4
BuildRequires:  gcc
50e9d32
# required for autosetup macro
dc9bab4
BuildRequires:  git-core
3a5918c
%if 0%{defined gpgverify}
3a5918c
# required for OpenPGP package signature verification (per guidelines)
3a5918c
BuildRequires: gnupg2
3a5918c
%endif
1390a93
ff813d2
%if %{with python2}
4c6c8a0
# Python 2 related
1390a93
BuildRequires:  python2-devel
e101a0b
BuildRequires:  python2-setuptools
e101a0b
BuildRequires:  python2-lxml
ff813d2
%endif
1390a93
4c6c8a0
# Python 3 related
4c6c8a0
BuildRequires:  python3-devel
4c6c8a0
BuildRequires:  python3-setuptools
4c6c8a0
BuildRequires:  python3-lxml
180cc93
BuildRequires:  python3-distro
4c6c8a0
00260d6
# following to ensure "which bash" (and, in extension, "which sh") works
00260d6
BuildRequires:  bash which
00260d6
4c6c8a0
BuildRequires:  pkgconfig(libxml-2.0)
rpm-build 4d49a47
rpm-build 4d49a47
# schemadir path pointer (former since pacemaker 2.0.3)
rpm-build 4d49a47
%if 0%{?fedora} >= 32
rpm-build 4d49a47
BuildRequires:  pkgconfig(pacemaker-schemas)
rpm-build 4d49a47
%else
rpm-build 4d49a47
BuildRequires:  pkgconfig(pacemaker-cib)
rpm-build 4d49a47
%endif
rpm-build 4d49a47
# nschemas themselves (former since pacemaker 2.0.1)
22a7ab4
%if 0%{?fedora} >= 30
22a7ab4
BuildRequires:  pacemaker-schemas
22a7ab4
%else
4c6c8a0
BuildRequires:  pacemaker
22a7ab4
%endif
rpm-build 4d49a47
4c6c8a0
# needed to squash multi-file schemas to single file
4c6c8a0
BuildRequires:  jing
4c6c8a0
# needed for xsltproc and xmllint respectively
4c6c8a0
BuildRequires:  libxslt libxml2
4c6c8a0
d369ce3
#global test_version
6b67c3f
%global testver      %{?test_version}%{?!test_version:%{version}}
6b67c3f
1390a93
Source0:        https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{version}.tar.gz
6b67c3f
Source1:        https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{testver}-tests.tar.xz
4c6c8a0
Source2:        https://pagure.io/%{name}/raw/v%{version}/f/misc/fix-jing-simplified-rng.xsl
rpm-build 4d49a47
#Source3:        https://pagure.io/#{name}/raw/v#{version}/f/misc/pacemaker-borrow-schemas
rpm-build 4d49a47
Source3:        https://pagure.io/%{name}/raw/50377b47601b88381537fa13ab466fe2cb37c56a/f/misc/pacemaker-borrow-schemas
3a5918c
%if 0%{defined gpgverify}
3a5918c
Source10:       https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{version}.tar.gz.asc
3a5918c
# publicly stated signature key rollover policy:
3a5918c
# https://lists.clusterlabs.org/pipermail/users/2019-August/026234.html
3a5918c
Source11:       https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-2019-08-15-5CD7F9EF.keyring
3a5918c
%endif
9a2d84d
rpm-build 4d49a47
Patch0:         https://pagure.io/clufter/c/b83e3091a7febd715cc0502dc154e43edb2d44f1.patch#/compat-Python-3.9-no-longer-offers-collections.Mutable-ABCs.patch
rpm-build 4d49a47
Patch1:         https://pagure.io/clufter/c/2b1b834972a8834410d9e0c348c9aeda07c010af.patch#/compat-Python-3.9-no-longer-raises-ValueError-at-some-bound.patch
rpm-build 4d49a47
Patch2:         https://pagure.io/clufter/c/7f4125ceefaf1dd1fb66bf96509c4b0acf2d5e94.patch#/plugin_registry-fix-a-problem-with-native-plugins-missing.patch
rpm-build 4d49a47
1390a93
%description
1390a93
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
1390a93
stacks configuration conversion (as per RHEL trend), the command-filter-format
1390a93
framework (capable of XSLT) offers also other uses through its plugin library.
1390a93
1390a93
%package cli
1390a93
Summary:        Tool for transforming/analyzing cluster configuration formats
4c6c8a0
Provides:       %{name} = %{version}-%{release}
1390a93
1390a93
BuildRequires:  bash-completion
1390a93
1390a93
BuildRequires:  help2man
1390a93
cae7570
# following for pkg_resources module
4c6c8a0
Requires:       python3-setuptools
4c6c8a0
Requires:       python3-%{name} = %{version}-%{release}
79a135c
Requires:       %{_bindir}/nano
1390a93
BuildArch:      noarch
1390a93
1390a93
%description cli
1390a93
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
1390a93
stacks configuration conversion (as per RHEL trend), the command-filter-format
1390a93
framework (capable of XSLT) offers also other uses through its plugin library.
1390a93
1390a93
This package contains %{name} command-line interface for the underlying
4c6c8a0
library (packaged as python3-%{name}).
1390a93
ff813d2
%if %{with python2}
4c6c8a0
%package -n python2-%{name}
1390a93
Summary:        Library for transforming/analyzing cluster configuration formats
1390a93
License:        GPLv2+ and GFDL
1390a93
4c6c8a0
Provides:       %{name}-lib = %{version}-%{release}
4c6c8a0
%{?python_provide:%python_provide python2-%{name}}
4c6c8a0
Requires:       %{name}-bin = %{version}-%{release}
4c6c8a0
BuildArch:      noarch
1390a93
4c6c8a0
%description -n python2-%{name}
4c6c8a0
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
4c6c8a0
stacks configuration conversion (as per RHEL trend), the command-filter-format
4c6c8a0
framework (capable of XSLT) offers also other uses through its plugin library.
6b67c3f
4c6c8a0
This package contains %{name} library including built-in plugins.
ff813d2
%endif
4c6c8a0
4c6c8a0
%package -n python3-%{name}
4c6c8a0
Summary:        Library for transforming/analyzing cluster configuration formats
4c6c8a0
License:        GPLv2+ and GFDL
4c6c8a0
4c6c8a0
Provides:       %{name}-lib = %{version}-%{release}
4c6c8a0
%{?python_provide:%python_provide python3-%{name}}
ff813d2
%if %{without python2}
ff813d2
Obsoletes:      python-%{name} < %{version}-%{release}
ff813d2
Obsoletes:      python2-%{name} < %{version}-%{release}
ff813d2
%endif
4c6c8a0
Requires:       %{name}-bin = %{version}-%{release}
4c6c8a0
BuildArch:      noarch
1390a93
4c6c8a0
%description -n python3-%{name}
1390a93
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
1390a93
stacks configuration conversion (as per RHEL trend), the command-filter-format
1390a93
framework (capable of XSLT) offers also other uses through its plugin library.
1390a93
1390a93
This package contains %{name} library including built-in plugins.
1390a93
4c6c8a0
%package bin
4c6c8a0
Summary:        Common internal compiled files for %{name}
4c6c8a0
License:        GPLv2+
4c6c8a0
4c6c8a0
Requires:       %{name}-common = %{version}-%{release}
4c6c8a0
4c6c8a0
%description bin
4c6c8a0
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
4c6c8a0
stacks configuration conversion (as per RHEL trend), the command-filter-format
4c6c8a0
framework (capable of XSLT) offers also other uses through its plugin library.
4c6c8a0
4c6c8a0
This package contains internal, arch-specific files for %{name}.
4c6c8a0
4c6c8a0
%package common
4c6c8a0
Summary:        Common internal data files for %{name}
4c6c8a0
License:        GPLv2+
4c6c8a0
BuildArch:      noarch
4c6c8a0
4c6c8a0
%description common
4c6c8a0
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
4c6c8a0
stacks configuration conversion (as per RHEL trend), the command-filter-format
4c6c8a0
framework (capable of XSLT) offers also other uses through its plugin library.
4c6c8a0
4c6c8a0
This package contains internal, arch-agnostic files for %{name}.
4c6c8a0
1390a93
%package lib-general
1390a93
Summary:        Extra %{name} plugins usable for/as generic/auxiliary products
4c6c8a0
Requires:       %{name}-lib = %{version}-%{release}
1390a93
BuildArch:      noarch
1390a93
1390a93
%description lib-general
1390a93
This package contains set of additional plugins targeting variety of generic
1390a93
formats often serving as a byproducts in the intermediate steps of the overall
1390a93
process arrangement: either experimental commands or internally unused,
1390a93
reusable formats and filters.
1390a93
1390a93
%package lib-ccs
1390a93
Summary:        Extra plugins for transforming/analyzing CMAN configuration
1390a93
Requires:       %{name}-lib-general = %{version}-%{release}
1390a93
BuildArch:      noarch
1390a93
1390a93
%description lib-ccs
1390a93
This package contains set of additional plugins targeting CMAN cluster
1390a93
configuration: either experimental commands or internally unused, reusable
1390a93
formats and filters.
1390a93
1390a93
%package lib-pcs
1390a93
Summary:        Extra plugins for transforming/analyzing Pacemaker configuration
1390a93
Requires:       %{name}-lib-general = %{version}-%{release}
1390a93
BuildArch:      noarch
1390a93
1390a93
%description lib-pcs
1390a93
This package contains set of additional plugins targeting Pacemaker cluster
1390a93
configuration: either experimental commands or internally unused, reusable
1390a93
formats and filters.
1390a93
1390a93
%prep
3a5918c
%if 0%{defined gpgverify}
3a5918c
%{gpgverify} --keyring='%{SOURCE11}' --signature='%{SOURCE10}' --data='%{SOURCE0}'
3a5918c
%endif
rpm-build 4d49a47
%setup -b1 -q
rpm-build 4d49a47
pushd clufter
rpm-build 4d49a47
%global __scm git_am
rpm-build 4d49a47
%__scm_setup_git
rpm-build 4d49a47
%autopatch -p1
rpm-build 4d49a47
popd
1390a93
6b67c3f
%if "%{testver}" != "%{version}"
6b67c3f
    %{__cp} -a ../"%{name}-%{testver}"/* .
6b67c3f
%endif
6b67c3f
1390a93
## for some esoteric reason, the line above has to be empty
edd2a11
%{__python3} setup.py saveopts -f setup.cfg pkg_prepare \
edd2a11
                      --ccs-flatten='%{_libexecdir}/%{name}-%{version}/ccs_flatten' \
edd2a11
                      --editor='%{_bindir}/nano' \
edd2a11
                      --extplugins-shared='%{_datarootdir}/%{name}/ext-plugins' \
edd2a11
                      --ra-metadata-dir='%{_datadir}/cluster' \
edd2a11
                      --ra-metadata-ext='metadata' \
edd2a11
                      --shell-posix='%(which sh 2>/dev/null || echo /bin/SHELL-POSIX)' \
edd2a11
                      --shell-bashlike='%(which bash 2>/dev/null || echo /bin/SHELL-BASHLIKE)'
edd2a11
%{__python3} setup.py saveopts -f setup.cfg pkg_prepare \
4c6c8a0
  --report-bugs='https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}'
1390a93
1390a93
%build
ff813d2
%if %{with python2}
4c6c8a0
%py2_build
ff813d2
%endif
4c6c8a0
# see https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale;
4c6c8a0
# specifically:
4c6c8a0
#   File "setup.py", line 466, in _pkg_prepare_file
4c6c8a0
#     content = fr.read()
4c6c8a0
#   File "/usr/lib64/python3.5/encodings/ascii.py", line 26, in decode
4c6c8a0
#     return codecs.ascii_decode(input, self.errors)[0]
4c6c8a0
# UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 221: ordinal not in range(128)
4c6c8a0
export LC_ALL=C.UTF-8 LANG=C.UTF-8
4c6c8a0
%py3_build
4c6c8a0
b377517
%{__python3} -I ./run-dev --skip-ext --completion-bash 2>/dev/null \
1390a93
  | sed 's|run[-_]dev|%{name}|g' > .bashcomp
9a2d84d
# generate man pages (proper commands and aliases from a sorted sequence)
1390a93
%{__mkdir_p} -- .manpages/man1
b377517
{ echo; %{__python3} -I ./run-dev -l | sed -n 's|^  \(\S\+\).*|\1|p' \
ff813d2
  | sort; } > .subcmds
6b67c3f
sed -e 's:\(.\+\):\\\&\\fIrun_dev-\1\\fR\\\|(1), :' \
6b67c3f
  -e '1s|\(.*\)|\[SEE ALSO\]\n|' \
9a2d84d
  -e '$s|\(.*\)|\1\nand perhaps more|' \
9a2d84d
  .subcmds > .see-also
9a2d84d
help2man -N -h -H -i .see-also \
b377517
  -n "$(sed -n '2s|[^(]\+(\([^)]\+\))|\1|p' README)" \
b377517
  '%{__python3} -I ./run-dev' | sed 's|run\\\?[-_]dev|%{name}|g' \
9a2d84d
  > ".manpages/man1/%{name}.1"
9a2d84d
while read cmd; do
6b67c3f
  [ -n "${cmd}" ] || continue
9a2d84d
  echo -e "#\!/bin/sh\n{ [ \$# -ge 1 ] && [ \"\$1\" = \"--version\" ] \
b377517
  && %{__python3} -I ./run-dev \"\$@\" \
b377517
  || %{__python3} -I ./run-dev \"${cmd}\" \"\$@\"; }" > ".tmp-${cmd}"
9a2d84d
  chmod +x ".tmp-${cmd}"
9a2d84d
  grep -v "^${cmd}\$" .subcmds \
6b67c3f
    | grep -e '^$' -e "$(echo ${cmd} | cut -d- -f1)\(-\|\$\)" \
6b67c3f
    | sed -e 's:\(.\+\):\\\&\\fIrun_dev-\1\\fR\\\|(1), :' \
6b67c3f
      -e '1s|\(.*\)|\[SEE ALSO\]\n\\\&\\fIrun_dev\\fR\\\|(1), \n|' \
9a2d84d
      -e '$s|\(.*\)|\1\nand perhaps more|' > .see-also
9a2d84d
  # XXX uses ";;&" bashism
9a2d84d
  case "${cmd}" in
9a2d84d
  ccs[2-]*)
9a2d84d
    sed -i \
9a2d84d
      '1s:\(.*\):\1\n\\\&\\fIcluster.conf\\fR\\\|(5), \\\&\\fIccs\\fR\\\|(7), :' \
9a2d84d
    .see-also
9a2d84d
    ;;&
66c5d87
  ccs2pcs*)
66c5d87
    sed -i \
66c5d87
      '1s:\(.*\):\1\n\\\&\\fI%{_defaultdocdir}/%{name}-%{version}/rgmanager-pacemaker\\fR\\\|, :' \
66c5d87
    .see-also
66c5d87
    ;;&
9a2d84d
  *[2-]pcscmd*)
9a2d84d
    sed -i '1s:\(.*\):\1\n\\\&\\fIpcs\\fR\\\|(8), :' .see-also
9a2d84d
    ;;&
9a2d84d
  esac
9a2d84d
  help2man -N -h -H -i .see-also -n "${cmd}" "./.tmp-${cmd}" \
9a2d84d
    | sed 's|run\\\?[-_]dev|%{name}|g' \
9a2d84d
  > ".manpages/man1/%{name}-${cmd}.1"
9a2d84d
done < .subcmds
1390a93
bbcfa62
OUTPUTDIR=.schemas POSTPROCESS="%{SOURCE2}" sh "%{SOURCE3}" --clobber
6b67c3f
1390a93
%install
ff813d2
%if %{with python2}
4c6c8a0
%py2_install
ff813d2
%endif
4c6c8a0
# see build section
4c6c8a0
export LC_ALL=C.UTF-8 LANG=C.UTF-8
4c6c8a0
%py3_install
1390a93
1390a93
# following is needed due to umask 022 not taking effect(?) leading to 775
1390a93
%{__chmod} -- g-w '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten'
1390a93
# %%{_bindir}/%%{name} should have been created
1390a93
test -f '%{buildroot}%{_bindir}/%{name}' \
1390a93
  || %{__install} -D -pm 644 -- '%{buildroot}%{_bindir}/%{name}' \
1390a93
                                '%{buildroot}%{_bindir}/%{name}'
4c6c8a0
4c6c8a0
# move data files from python-specific locations to a single common one
4c6c8a0
# and possibly symlink that back
4c6c8a0
%{__mkdir_p} -- '%{buildroot}%{_datarootdir}/%{name}/formats'
4c6c8a0
for format in cib corosync; do
4c6c8a0
  %{__cp} -a -t '%{buildroot}%{_datarootdir}/%{name}/formats' \
4c6c8a0
          -- "%{buildroot}%{python3_sitelib}/%{name}/formats/${format}"
ff813d2
%if %{with python2}
4c6c8a0
  %{__rm} -f -- "%{buildroot}%{python2_sitelib}/%{name}/formats/${format}"/*
4c6c8a0
  ln -s -t "%{buildroot}%{python2_sitelib}/%{name}/formats/${format}" \
4c6c8a0
     -- $(pushd "%{buildroot}%{_datarootdir}/%{name}/formats/${format}" >/dev/null; \
4c6c8a0
          ls -1A | sed "s:.*:%{_datarootdir}/%{name}/formats/${format}/\\0:")
ff813d2
%endif
4c6c8a0
  %{__rm} -f -- "%{buildroot}%{python3_sitelib}/%{name}/formats/${format}"/*
4c6c8a0
  ln -s -t "%{buildroot}%{python3_sitelib}/%{name}/formats/${format}" \
4c6c8a0
     -- $(pushd "%{buildroot}%{_datarootdir}/%{name}/formats/${format}" >/dev/null; \
4c6c8a0
          ls -1A | sed "s:.*:%{_datarootdir}/%{name}/formats/${format}/\\0:")
4c6c8a0
done
4c6c8a0
4c6c8a0
# move ext-plugins from python-specific locations to a single common one
4c6c8a0
# incl. the different sorts of precompiled bytecodes
4c6c8a0
%{__mkdir_p} -- '%{buildroot}%{_datarootdir}/%{name}/ext-plugins'
ff813d2
%if %{with python2}
4c6c8a0
mv -t '%{buildroot}%{_datarootdir}/%{name}/ext-plugins' \
4c6c8a0
   -- '%{buildroot}%{python2_sitelib}/%{name}'/ext-plugins/*/
ff813d2
%endif
4c6c8a0
%{__cp} -af -t '%{buildroot}%{_datarootdir}/%{name}/ext-plugins' \
4c6c8a0
        -- '%{buildroot}%{python3_sitelib}/%{name}'/ext-plugins/*
4c6c8a0
%{__rm} -rf -- '%{buildroot}%{python3_sitelib}/%{name}'/ext-plugins/*/
4c6c8a0
b377517
# byte-compilation
22a7ab4
# py_byte_compile macro introduced in Fedora in python3 for f13, f30 is
22a7ab4
# then boundary where no to use sanity options (against revamped version
22a7ab4
# of that macro, since it exactly abuses what shall not be done in the
22a7ab4
# buildroot, alas...)
b377517
%if %{with python2}
22a7ab4
%if ("%{?quote:1}" != "" && "%{?quote:1}" != "1" && (0%{?fedora} && 0%{?fedora} <= 30 || 0%{?rhel} && 0%{?rhel} <= 8))
d29130b
%py_byte_compile %{quote:%{__python2} -Es} %{python2_sitelib}/%{name}
d29130b
%py_byte_compile %{quote:%{__python2} -Es} %{buildroot}%{_datarootdir}/%{name}/ext-plugins
d29130b
%else
d29130b
%py_byte_compile %{__python2} %{python2_sitelib}/%{name}
d29130b
%py_byte_compile %{__python2} %{buildroot}%{_datarootdir}/%{name}/ext-plugins
d29130b
%endif
d29130b
%endif
22a7ab4
%if ("%{?quote:1}" != "" && "%{?quote:1}" != "1" && (0%{?fedora} && 0%{?fedora} <= 30 || 0%{?rhel} && 0%{?rhel} <= 8))
d29130b
%py_byte_compile %{quote:%{__python3} -I} %{python3_sitelib}/%{name}
d29130b
%py_byte_compile %{quote:%{__python3} -I} %{buildroot}%{_datarootdir}/%{name}/ext-plugins
d29130b
%else
d29130b
%py_byte_compile %{__python3} %{python3_sitelib}/%{name}
d29130b
%py_byte_compile %{__python3} %{buildroot}%{_datarootdir}/%{name}/ext-plugins
b377517
%endif
b377517
1390a93
declare bashcompdir="$(pkg-config --variable=completionsdir bash-completion \
1390a93
                       || echo '%{_datadir}/bash-completion/completions')"
1390a93
declare bashcomp="${bashcompdir}/%{name}"
1390a93
%{__install} -D -pm 644 -- \
1390a93
  .bashcomp '%{buildroot}%{_sysconfdir}/%{name}/bash-completion'
1390a93
%{__mkdir_p} -- "%{buildroot}${bashcompdir}"
1390a93
ln -s '%{_sysconfdir}/%{name}/bash-completion' "%{buildroot}${bashcomp}"
1390a93
# own %%{_datadir}/bash-completion in case of ...bash-completion/completions,
1390a93
# more generally any path up to any of /, /usr, /usr/share, /etc
1390a93
while true; do
1390a93
  test "$(dirname "${bashcompdir}")" != "/" \
1390a93
  && test "$(dirname "${bashcompdir}")" != "%{_prefix}" \
1390a93
  && test "$(dirname "${bashcompdir}")" != "%{_datadir}" \
1390a93
  && test "$(dirname "${bashcompdir}")" != "%{_sysconfdir}" \
1390a93
  || break
1390a93
  bashcompdir="$(dirname "${bashcompdir}")"
1390a93
done
1390a93
cat >.bashcomp-files <<-EOF
1390a93
	${bashcompdir}
1390a93
	%dir %{_sysconfdir}/%{name}
1390a93
	%verify(not size md5 mtime) %{_sysconfdir}/%{name}/bash-completion
1390a93
EOF
1390a93
%{__mkdir_p} -- '%{buildroot}%{_mandir}'
66c5d87
%{__cp} -a -t '%{buildroot}%{_mandir}' -- .manpages/*
4c6c8a0
%{__cp} -a -f -t '%{buildroot}%{_datarootdir}/%{name}/formats/cib' \
6b67c3f
              -- .schemas/pacemaker-*.*.rng
1390a93
%{__mkdir_p} -- '%{buildroot}%{_defaultdocdir}/%{name}-%{version}'
66c5d87
%{__cp} -a -t '%{buildroot}%{_defaultdocdir}/%{name}-%{version}' \
66c5d87
           -- gpl-2.0.txt doc/*.txt doc/rgmanager-pacemaker
1390a93
1390a93
%check
1390a93
# just a basic sanity check
1390a93
# we need to massage RA metadata files and PATH so the local run works
1390a93
# XXX we could also inject buildroot's site_packages dir to PYTHONPATH
1390a93
declare ret=0 \
1390a93
        ccs_flatten_dir="$(dirname '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten')"
1390a93
ln -s '%{buildroot}%{_datadir}/cluster'/*.'metadata' \
1390a93
      "${ccs_flatten_dir}"
ff813d2
%if %{with python2}
4c6c8a0
PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" PYTHONEXEC="%{__python2} -Es" ./run-tests
ff813d2
%endif
4c6c8a0
# see build section
4c6c8a0
export LC_ALL=C.UTF-8 LANG=C.UTF-8
b377517
PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" PYTHONEXEC="%{__python3} -I" ./run-tests
1390a93
ret=$?
1390a93
%{__rm} -f -- "${ccs_flatten_dir}"/*.'metadata'
1390a93
[ ${ret} -eq 0 ] || exit ${ret}
1390a93
1390a93
%post cli
1390a93
if [ $1 -gt 1 ]; then  # no gain regenerating it w/ fresh install (same result)
1390a93
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
1390a93
%{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
1390a93
fi
1390a93
1390a93
%post lib-general
1390a93
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
1390a93
# if the completion file is not present, suppose it is not desired
1390a93
test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \
1390a93
  && %{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
1390a93
1390a93
%post lib-ccs
1390a93
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
1390a93
# if the completion file is not present, suppose it is not desired
1390a93
test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \
1390a93
  && %{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
1390a93
1390a93
%post lib-pcs
1390a93
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
1390a93
# if the completion file is not present, suppose it is not desired
1390a93
test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \
1390a93
  && %{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
1390a93
1390a93
%files cli -f .bashcomp-files
1390a93
%{_mandir}/man1/*.1*
1390a93
%{_bindir}/%{name}
1390a93
ff813d2
%if %{with python2}
4c6c8a0
%files -n python2-%{name}
1390a93
%{python2_sitelib}/%{name}
1390a93
%{python2_sitelib}/%{name}-*.egg-info
ff813d2
%endif
4c6c8a0
4c6c8a0
%files -n python3-%{name}
4c6c8a0
%{python3_sitelib}/%{name}
4c6c8a0
%{python3_sitelib}/%{name}-*.egg-info
4c6c8a0
4c6c8a0
%files bin
1390a93
%{_libexecdir}/%{name}-%{version}
4c6c8a0
4c6c8a0
%files common
1390a93
%{_datadir}/cluster
4c6c8a0
%{_datarootdir}/%{name}
4c6c8a0
%dir %{_defaultdocdir}/%{name}-%{version}
4c6c8a0
%{_defaultdocdir}/%{name}-%{version}/*[^[:digit:]]
4c6c8a0
%license %{_defaultdocdir}/%{name}-%{version}/*[[:digit:]].txt
1390a93
1390a93
%files lib-general
4c6c8a0
%{_datarootdir}/%{name}/ext-plugins/lib-general
1390a93
1390a93
%files lib-ccs
4c6c8a0
%{_datarootdir}/%{name}/ext-plugins/lib-ccs
1390a93
1390a93
%files lib-pcs
4c6c8a0
%{_datarootdir}/%{name}/ext-plugins/lib-pcs
1390a93
1390a93
%changelog
d70afaf
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.77.2-7
d70afaf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d70afaf
rpm-build 4d49a47
* Fri Jan 17 2020 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.2-6
rpm-build 4d49a47
- restore buildability with upcoming Python 3.9: rhbz#1791769
rpm-build 4d49a47
- add patch to suppress spurious non-fatal failures in check scriptlet
rpm-build 4d49a47
11ea7d1
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.77.2-5
11ea7d1
- Rebuilt for Python 3.8.0rc1 (#1748018)
11ea7d1
216f176
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.77.2-4
216f176
- Rebuilt for Python 3.8
216f176
3a5918c
* Thu Aug 15 2019 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.2-3
3a5918c
- enable source file verification as mandated with packaging guidelines now
3a5918c
180cc93
* Wed Aug 14 2019 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.2-2
180cc93
- add forgotten BR: python3-distro dependency (in the anticipation of Py3.8)
180cc93
22a7ab4
* Wed Aug 14 2019 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.2-1
22a7ab4
- use Python interpreters for byte-compilation without extra arguments (f31+)
22a7ab4
- bump upstream package, see https://pagure.io/clufter/releases
22a7ab4
8550feb
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.77.1-9
8550feb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
8550feb
dfa03f9
* Mon Feb 18 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.77.1-8
dfa03f9
- Enable python dependency generator
dfa03f9
668deb2
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.77.1-7
668deb2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
668deb2
d29130b
* Thu Aug 02 2018 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.1-6
d29130b
- fix missing explicit BuildRequires to ensure environment for compiling
d29130b
  C code per the guidelines, and to fix FTBFS: rhbz#1603658
d29130b
  (contributed by Igor Gnatenko <ignatenkobrain@fedoraproject.org>)
d29130b
- fix a thinko in py_byte_compile space-contained argument passing
d29130b
  (https://github.com/rpm-software-management/rpm/issues/222#issuecomment-410026431)
d29130b
f51f7e3
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.77.1-5
f51f7e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
f51f7e3
c851edf
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.77.1-4
c851edf
- Rebuilt for Python 3.7
c851edf
b377517
* Mon Mar 19 2018 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.1-3
b377517
- fix previously omitted unqualified python invocations, drop no longer
b377517
  needed byte-compilation products through a full grip on such a process,
b377517
  and also use -I switch to python3 instead of possibly weaker -Es
b377517
ff813d2
* Mon Mar 19 2018 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.1-2
ff813d2
- stop creating Python 2 packages by default (nothing in Fedora uses it)
ff813d2
- fix a previously omitted unqualified python invocation
ff813d2
edd2a11
* Thu Mar 15 2018 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.1-1
edd2a11
- drop no longer favoured Group tag
edd2a11
- replace unqualified python invocations with explicit python3
edd2a11
- bump upstream package, see https://pagure.io/clufter/releases
edd2a11
8cb6411
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.77.0-3
8cb6411
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
8cb6411
e101a0b
* Wed Jan 03 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.77.0-2
e101a0b
- Update Python 2 dependency declarations to new packaging standards
e101a0b
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
e101a0b
be36e10
* Sun Nov 12 2017 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.77.0-1
be36e10
- bump upstream package, see https://pagure.io/clufter/releases
be36e10
27dacb0
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.76.0-3
27dacb0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
27dacb0
cd53ad6
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.76.0-2
cd53ad6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cd53ad6
bbcfa62
* Tue Jun 06 2017 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.76.0-1
bbcfa62
- factor "borrow validation schemas from pacemaker" out to a separate script
bbcfa62
- bump upstream package, see https://pagure.io/clufter/releases
bbcfa62
79a135c
* Fri May 26 2017 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.75.0-1
79a135c
- move nano fallback editor dependency to -cli package [PGissue#1]
79a135c
- bump upstream package, see https://pagure.io/clufter/releases
79a135c
4c6c8a0
* Tue Mar 21 2017 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.70.0-1
4c6c8a0
- split -bin and -common packages, the former becoming the only arch-specific
4c6c8a0
- also move python-specific (entry points, main files) back from -cli package
4c6c8a0
- also rename python-clufter to python2-clufter (former is a legacy alias)
4c6c8a0
- also leverage the above modularization to package python3-clufter in parallel
4c6c8a0
- bump upstream package (version rolling the above changes out)
4c6c8a0
6c350dd
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.59.8-2
6c350dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
6c350dd
a4f177e
* Wed Jan 18 2017 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.59.8-1
a4f177e
- bump upstream package, see
a4f177e
  https://github.com/jnpkrn/clufter/releases/tag/v0.59.8
a4f177e
00260d6
* Mon Dec 12 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.59.7-1
00260d6
- bump upstream package, see
00260d6
  https://github.com/jnpkrn/clufter/releases/tag/v0.59.7
00260d6
d369ce3
* Fri Oct 21 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.59.6-1
d369ce3
- bump upstream package, see https://pagure.io/clufter/releases
d369ce3
363efd4
* Tue Aug 09 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.59.5-1
363efd4
- bump upstream package, see https://pagure.io/clufter/releases
363efd4
f31a61d
* Wed Jul 27 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.59.1-1
f31a61d
- bump upstream package, see https://pagure.io/clufter/releases
f31a61d
1120b43
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.58.0-2
1120b43
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
1120b43
62e5f18
* Mon Jul 18 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.58.0-1
62e5f18
- bump upstream package, see https://pagure.io/clufter/releases
62e5f18
8c9ee71
* Fri Jul 01 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.57.0-1
8c9ee71
- bump upstream package, see https://pagure.io/clufter/releases
8c9ee71
  (cumulative update incl. 0.56.3 and 0.57.0 changes)
8c9ee71
- make Python interpreter execution sane
8c9ee71
- drop license compatibility macro as pointless for Fedora (and EPEL,
8c9ee71
  when it comes to it) at this point
8c9ee71
b1f1abd
* Fri Mar 18 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.56.2-1
b1f1abd
- bump upstream package, see
b1f1abd
  https://github.com/jnpkrn/clufter/releases/tag/v0.56.2
b1f1abd
6b67c3f
* Tue Feb 09 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.56.1-1
6b67c3f
- add ability to borrow validation schemas from pacemaker installed along
6b67c3f
- bump upstream package, see
6b67c3f
  https://github.com/jnpkrn/clufter/releases/tag/v0.56.1
6b67c3f
66c5d87
* Tue Feb 02 2016 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.56.0-1
66c5d87
- move entry_points.txt to clufter-cli sub-package
66c5d87
- general spec file refresh (pagure.io as a default project base, etc.)
66c5d87
- bump upstream package, see
66c5d87
  https://github.com/jnpkrn/clufter/releases/tag/v0.56.0
66c5d87
9a2d84d
* Mon Dec 21 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.55.0-1
9a2d84d
- auto-generate SEE ALSO sections for the man pages
9a2d84d
- bump upstream package (intentional jump on upstream front),
9a2d84d
  see https://github.com/jnpkrn/clufter/releases/tag/v0.55.0
9a2d84d
4eea7c9
* Fri Oct 09 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.50.5-1
4eea7c9
- generate man pages also for offered commands
4eea7c9
- bump upstream package
4eea7c9
b7138f5
* Thu Sep 10 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.50.4-1
b7138f5
- bump upstream package
b7138f5
d718fb2
* Mon Sep 07 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.50.3-1
d718fb2
- bump upstream package
d718fb2
1a829a7
* Wed Aug 12 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.50.2-1
1a829a7
- bump upstream package
1a829a7
b248592
* Wed Jul 15 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.50.1-1
b248592
- bump upstream package
b248592
280dbad
* Fri Jul 03 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.50.0-1
280dbad
- bump upstream package (intentional jump on upstream front)
280dbad
22da59d
* Fri Jun 19 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.12.0-1
22da59d
- bump upstream package
22da59d
adfdfb2
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.2-2
adfdfb2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
adfdfb2
f2412cd
* Mon Jun 01 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.11.2-1
f2412cd
- move completion module to clufter-cli sub-package
f2412cd
- bump upstream package
f2412cd
50e9d32
* Tue May 19 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.11.1-1
50e9d32
- bump upstream package
50e9d32
7427118
* Wed Apr 15 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.11.0-1
7427118
- bump upstream package
7427118
1cd461d
* Wed Apr 08 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.10.4-1
1cd461d
- bump upstream package
1cd461d
3eed983
* Mon Mar 23 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.10.3-1
3eed983
- bump upstream package
3eed983
cae7570
* Tue Mar 17 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.10.2-1
cae7570
- bump upstream package
cae7570
- add dependency on python-setuptools
cae7570
5cc76c0
* Wed Mar 04 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.10.1-1
5cc76c0
- bump upstream package
5cc76c0
1390a93
* Thu Feb 26 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.10.0-1
1390a93
- packaging enhacements (structure, redundancy, ownership, scriptlets, symlink)
1390a93
- version bump so as not to collide with python-clufter co-packaged with pcs
1390a93
1390a93
* Tue Jan 20 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.3.5-1
1390a93
- packaging enhancements (pkg-config, license tag)
1390a93
1390a93
* Wed Jan 14 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.3.4-1
1390a93
- packaging enhancements (permissions, ownership)
1390a93
- man page for CLI frontend now included
1390a93
1390a93
* Tue Jan 13 2015 Jan Pokorný <jpokorny+rpm-clufter@fedoraproject.org> - 0.3.3-1
1390a93
- initial build