From 4c6c8a0ef9fad64a860e6a32e9ba0aca6117283c Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Mar 22 2017 15:56:52 +0000 Subject: 0.70.0-1 - split -bin and -common packages ...the former becoming the only arch-specific - also move python-specific (entry points, main files) back from -cli package - also rename python-clufter to python2-clufter (former is a legacy alias) - also leverage the above modularization to package python3-clufter in parallel - bump upstream package (version rolling the above changes out) Signed-off-by: Jan Pokorný --- diff --git a/clufter.spec b/clufter.spec index a08207f..a8f18ed 100644 --- a/clufter.spec +++ b/clufter.spec @@ -1,6 +1,11 @@ +# virtual provides: +# clufter -> clufter-cli +# clufter-lib -> python.+-clufter (any if multiple) +# python-clufter -> python2-clufter (subject of change) + Name: clufter -Version: 0.59.8 -Release: 2%{?dist} +Version: 0.70.0 +Release: 1%{?dist} Group: System Environment/Base Summary: Tool/library for transforming/analyzing cluster configuration formats License: GPLv2+ @@ -9,19 +14,35 @@ URL: https://pagure.io/%{name} # required for autosetup macro BuildRequires: git +# Python 2 related BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-lxml +# Python 3 related +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-lxml + # following to ensure "which bash" (and, in extension, "which sh") works BuildRequires: bash which +BuildRequires: pkgconfig(libxml-2.0) +# needed for schemadir path pointer +BuildRequires: pkgconfig(pacemaker) +# needed for schemas themselves +BuildRequires: pacemaker +# needed to squash multi-file schemas to single file +BuildRequires: jing +# needed for xsltproc and xmllint respectively +BuildRequires: libxslt libxml2 + #global test_version %global testver %{?test_version}%{?!test_version:%{version}} Source0: https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{version}.tar.gz Source1: https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{testver}-tests.tar.xz -Source2: https://pagure.io/clufter/raw/v${version}/f/misc/fix-jing-simplified-rng.xsl +Source2: https://pagure.io/%{name}/raw/v%{version}/f/misc/fix-jing-simplified-rng.xsl %description While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster @@ -31,15 +52,15 @@ framework (capable of XSLT) offers also other uses through its plugin library. %package cli Group: System Environment/Base Summary: Tool for transforming/analyzing cluster configuration formats +Provides: %{name} = %{version}-%{release} BuildRequires: bash-completion BuildRequires: help2man # following for pkg_resources module -Requires: python-setuptools -Requires: python-%{name} = %{version}-%{release} -Provides: %{name} = %{version}-%{release} +Requires: python3-setuptools +Requires: python3-%{name} = %{version}-%{release} BuildArch: noarch %description cli @@ -48,38 +69,77 @@ stacks configuration conversion (as per RHEL trend), the command-filter-format framework (capable of XSLT) offers also other uses through its plugin library. This package contains %{name} command-line interface for the underlying -library (packaged as python-%{name}). +library (packaged as python3-%{name}). -%package -n python-%{name} +%package -n python2-%{name} Group: System Environment/Libraries Summary: Library for transforming/analyzing cluster configuration formats License: GPLv2+ and GFDL -BuildRequires: pkgconfig(libxml-2.0) +Provides: %{name}-lib = %{version}-%{release} +%{?python_provide:%python_provide python2-%{name}} +Requires: %{name}-bin = %{version}-%{release} +Requires: python-lxml +Requires: %{_bindir}/nano +BuildArch: noarch -# needed for schemadir path pointer -BuildRequires: pkgconfig(pacemaker) -# needed for schemas themselves -BuildRequires: pacemaker -# needed to squash multi-file schemas to single file -BuildRequires: jing -# needed for xsltproc and xmllint respectively -BuildRequires: libxslt libxml2 +%description -n python2-%{name} +While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster +stacks configuration conversion (as per RHEL trend), the command-filter-format +framework (capable of XSLT) offers also other uses through its plugin library. -Requires: python-lxml +This package contains %{name} library including built-in plugins. + +%package -n python3-%{name} +Group: System Environment/Libraries +Summary: Library for transforming/analyzing cluster configuration formats +License: GPLv2+ and GFDL + +Provides: %{name}-lib = %{version}-%{release} +%{?python_provide:%python_provide python3-%{name}} +Requires: python3-lxml +Requires: %{name}-bin = %{version}-%{release} Requires: %{_bindir}/nano +BuildArch: noarch -%description -n python-%{name} +%description -n python3-%{name} While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster stacks configuration conversion (as per RHEL trend), the command-filter-format framework (capable of XSLT) offers also other uses through its plugin library. This package contains %{name} library including built-in plugins. +%package bin +Group: System Environment/Libraries +Summary: Common internal compiled files for %{name} +License: GPLv2+ + +Requires: %{name}-common = %{version}-%{release} + +%description bin +While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster +stacks configuration conversion (as per RHEL trend), the command-filter-format +framework (capable of XSLT) offers also other uses through its plugin library. + +This package contains internal, arch-specific files for %{name}. + +%package common +Group: System Environment/Libraries +Summary: Common internal data files for %{name} +License: GPLv2+ +BuildArch: noarch + +%description common +While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster +stacks configuration conversion (as per RHEL trend), the command-filter-format +framework (capable of XSLT) offers also other uses through its plugin library. + +This package contains internal, arch-agnostic files for %{name}. + %package lib-general Group: System Environment/Libraries Summary: Extra %{name} plugins usable for/as generic/auxiliary products -Requires: python-%{name} = %{version}-%{release} +Requires: %{name}-lib = %{version}-%{release} BuildArch: noarch %description lib-general @@ -91,7 +151,6 @@ reusable formats and filters. %package lib-ccs Group: System Environment/Libraries Summary: Extra plugins for transforming/analyzing CMAN configuration -Requires: python-%{name} = %{version}-%{release} Requires: %{name}-lib-general = %{version}-%{release} BuildArch: noarch @@ -103,7 +162,6 @@ formats and filters. %package lib-pcs Group: System Environment/Libraries Summary: Extra plugins for transforming/analyzing Pacemaker configuration -Requires: python-%{name} = %{version}-%{release} Requires: %{name}-lib-general = %{version}-%{release} BuildArch: noarch @@ -120,22 +178,30 @@ formats and filters. %endif ## for some esoteric reason, the line above has to be empty -%{__python2} setup.py saveopts -f setup.cfg pkg_prepare \ - --ccs-flatten='%{_libexecdir}/%{name}-%{version}/ccs_flatten' \ - --editor='%{_bindir}/nano' \ - --ra-metadata-dir='%{_datadir}/cluster' \ - --ra-metadata-ext='metadata' \ - --shell-posix='%(which sh 2>/dev/null || echo /bin/SHELL-POSIX)' \ - --shell-bashlike='%(which bash 2>/dev/null || echo /bin/SHELL-BASHLIKE)' %{__python} setup.py saveopts -f setup.cfg pkg_prepare \ ---report-bugs='https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=clufter' -# make Python interpreter executation sane (via -Es flags) -%{__python2} setup.py saveopts -f setup.cfg build_scripts \ - --executable='%{__python2} -Es' + --ccs-flatten='%{_libexecdir}/%{name}-%{version}/ccs_flatten' \ + --editor='%{_bindir}/nano' \ + --extplugins-shared='%{_datarootdir}/%{name}/ext-plugins' \ + --ra-metadata-dir='%{_datadir}/cluster' \ + --ra-metadata-ext='metadata' \ + --shell-posix='%(which sh 2>/dev/null || echo /bin/SHELL-POSIX)' \ + --shell-bashlike='%(which bash 2>/dev/null || echo /bin/SHELL-BASHLIKE)' +%{__python} setup.py saveopts -f setup.cfg pkg_prepare \ + --report-bugs='https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}' %build -%{__python2} setup.py build -./run-dev --skip-ext --completion-bash 2>/dev/null \ +%py2_build +# see https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale; +# specifically: +# File "setup.py", line 466, in _pkg_prepare_file +# content = fr.read() +# File "/usr/lib64/python3.5/encodings/ascii.py", line 26, in decode +# return codecs.ascii_decode(input, self.errors)[0] +# UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 221: ordinal not in range(128) +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +%py3_build + +%{__python} ./run-dev --skip-ext --completion-bash 2>/dev/null \ | sed 's|run[-_]dev|%{name}|g' > .bashcomp # generate man pages (proper commands and aliases from a sorted sequence) %{__mkdir_p} -- .manpages/man1 @@ -185,7 +251,7 @@ for f in "${schemadir}"/pacemaker-*.*.rng; do test -f "${f}" || continue base="$(basename "${f}")" case "${base}" in - pacemaker-1.0.rng|pacemaker-2.[12].rng) + pacemaker-1.0.rng|pacemaker-2.[126].rng) continue;; # skip non-defaults of upstream releases (avoid clutter) esac sentinel=10; old=; new="${f}" @@ -205,15 +271,43 @@ for f in "${schemadir}"/pacemaker-*.*.rng; do done %install +%py2_install +# see build section +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +%py3_install -# '--root' implies setuptools involves distutils to do old-style install -%{__python2} setup.py install --skip-build --root '%{buildroot}' # following is needed due to umask 022 not taking effect(?) leading to 775 %{__chmod} -- g-w '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten' # %%{_bindir}/%%{name} should have been created test -f '%{buildroot}%{_bindir}/%{name}' \ || %{__install} -D -pm 644 -- '%{buildroot}%{_bindir}/%{name}' \ '%{buildroot}%{_bindir}/%{name}' + +# move data files from python-specific locations to a single common one +# and possibly symlink that back +%{__mkdir_p} -- '%{buildroot}%{_datarootdir}/%{name}/formats' +for format in cib corosync; do + %{__cp} -a -t '%{buildroot}%{_datarootdir}/%{name}/formats' \ + -- "%{buildroot}%{python3_sitelib}/%{name}/formats/${format}" + %{__rm} -f -- "%{buildroot}%{python2_sitelib}/%{name}/formats/${format}"/* + ln -s -t "%{buildroot}%{python2_sitelib}/%{name}/formats/${format}" \ + -- $(pushd "%{buildroot}%{_datarootdir}/%{name}/formats/${format}" >/dev/null; \ + ls -1A | sed "s:.*:%{_datarootdir}/%{name}/formats/${format}/\\0:") + %{__rm} -f -- "%{buildroot}%{python3_sitelib}/%{name}/formats/${format}"/* + ln -s -t "%{buildroot}%{python3_sitelib}/%{name}/formats/${format}" \ + -- $(pushd "%{buildroot}%{_datarootdir}/%{name}/formats/${format}" >/dev/null; \ + ls -1A | sed "s:.*:%{_datarootdir}/%{name}/formats/${format}/\\0:") +done + +# move ext-plugins from python-specific locations to a single common one +# incl. the different sorts of precompiled bytecodes +%{__mkdir_p} -- '%{buildroot}%{_datarootdir}/%{name}/ext-plugins' +mv -t '%{buildroot}%{_datarootdir}/%{name}/ext-plugins' \ + -- '%{buildroot}%{python2_sitelib}/%{name}'/ext-plugins/*/ +%{__cp} -af -t '%{buildroot}%{_datarootdir}/%{name}/ext-plugins' \ + -- '%{buildroot}%{python3_sitelib}/%{name}'/ext-plugins/* +%{__rm} -rf -- '%{buildroot}%{python3_sitelib}/%{name}'/ext-plugins/*/ + declare bashcompdir="$(pkg-config --variable=completionsdir bash-completion \ || echo '%{_datadir}/bash-completion/completions')" declare bashcomp="${bashcompdir}/%{name}" @@ -238,7 +332,7 @@ cat >.bashcomp-files <<-EOF EOF %{__mkdir_p} -- '%{buildroot}%{_mandir}' %{__cp} -a -t '%{buildroot}%{_mandir}' -- .manpages/* -%{__cp} -a -f -t '%{buildroot}%{python2_sitelib}/%{name}/formats/cib' \ +%{__cp} -a -f -t '%{buildroot}%{_datarootdir}/%{name}/formats/cib' \ -- .schemas/pacemaker-*.*.rng %{__mkdir_p} -- '%{buildroot}%{_defaultdocdir}/%{name}-%{version}' %{__cp} -a -t '%{buildroot}%{_defaultdocdir}/%{name}-%{version}' \ @@ -252,7 +346,10 @@ declare ret=0 \ ccs_flatten_dir="$(dirname '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten')" ln -s '%{buildroot}%{_datadir}/cluster'/*.'metadata' \ "${ccs_flatten_dir}" -PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" ./run-tests +PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" PYTHONEXEC="%{__python2} -Es" ./run-tests +# see build section +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" PYTHONEXEC="%{__python3} -Es" ./run-tests ret=$? %{__rm} -f -- "${ccs_flatten_dir}"/*.'metadata' [ ${ret} -eq 0 ] || exit ${ret} @@ -284,37 +381,42 @@ test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \ %files cli -f .bashcomp-files %{_mandir}/man1/*.1* %{_bindir}/%{name} -%{python2_sitelib}/%{name}/__main__.py* -%{python2_sitelib}/%{name}/main.py* -%{python2_sitelib}/%{name}/completion.py* -# only useful here, rest of egg-info pulled through internal dependency -%{python2_sitelib}/%{name}-*.egg-info/entry_points.txt -%files -n python-%{name} -%dir %{_defaultdocdir}/%{name}-%{version} -%{_defaultdocdir}/%{name}-%{version}/*[^[:digit:]] -%license %{_defaultdocdir}/%{name}-%{version}/*[[:digit:]].txt -%exclude %{python2_sitelib}/%{name}/__main__.py* -%exclude %{python2_sitelib}/%{name}/main.py* -%exclude %{python2_sitelib}/%{name}/completion.py* -%exclude %{python2_sitelib}/%{name}/ext-plugins/*/ +%files -n python2-%{name} %{python2_sitelib}/%{name} %{python2_sitelib}/%{name}-*.egg-info -# entry_points.txt only useful for -cli package -%exclude %{python2_sitelib}/%{name}-*.egg-info/entry_points.txt + +%files -n python3-%{name} +%{python3_sitelib}/%{name} +%{python3_sitelib}/%{name}-*.egg-info + +%files bin %{_libexecdir}/%{name}-%{version} + +%files common %{_datadir}/cluster +%{_datarootdir}/%{name} +%dir %{_defaultdocdir}/%{name}-%{version} +%{_defaultdocdir}/%{name}-%{version}/*[^[:digit:]] +%license %{_defaultdocdir}/%{name}-%{version}/*[[:digit:]].txt %files lib-general -%{python2_sitelib}/%{name}/ext-plugins/lib-general +%{_datarootdir}/%{name}/ext-plugins/lib-general %files lib-ccs -%{python2_sitelib}/%{name}/ext-plugins/lib-ccs +%{_datarootdir}/%{name}/ext-plugins/lib-ccs %files lib-pcs -%{python2_sitelib}/%{name}/ext-plugins/lib-pcs +%{_datarootdir}/%{name}/ext-plugins/lib-pcs %changelog +* Tue Mar 21 2017 Jan Pokorný - 0.70.0-1 +- split -bin and -common packages, the former becoming the only arch-specific +- also move python-specific (entry points, main files) back from -cli package +- also rename python-clufter to python2-clufter (former is a legacy alias) +- also leverage the above modularization to package python3-clufter in parallel +- bump upstream package (version rolling the above changes out) + * Fri Feb 10 2017 Fedora Release Engineering - 0.59.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 0ad89e2..4b0326a 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (clufter-0.59.8.tar.gz) = 56304e08980365fdbed57a56e41956962bab5151497464882bc3814faa1a541f0de83957394a2418907871cf39d82cb68a1df4e2d3b38ec08693918e9e853e04 -SHA512 (clufter-0.59.8-tests.tar.xz) = de4b0a15e3c66da71aa05bc310ccac0ec047fa924762293dfc1f162fd3cb56845f0da4d5c34de837c0bc8f513d9578d19e3f42f20150290db3791e848a7c5c0c +SHA512 (clufter-0.70.0.tar.gz) = bdb39de808b0e6dec82299579a8e3cd4286291e0bfbe71da48df2be1576e2e9da24c48a6052ba5645cd0e5e50a3e198869b2221885614726447cca906006b5de +SHA512 (clufter-0.70.0-tests.tar.xz) = be8a9bef1949f12b3dc3b56d72ea7f82cdb69f1d0e82b9eda4784eac69edfe817bf8e08149c486eb91adfd1ee47b466dd92e8d7ae70a2b09b6605f420ae8e7ae SHA512 (fix-jing-simplified-rng.xsl) = 069dc4c140b773adfbff8ab0f2ea18fc22666ded8adf005542b0b4f8da24a5916c958fa2f9f072bd0498bdef2e674082b917b8c3aabaf29a15e958b50128a6dc