Blame SPECS/clufter.spec

c999e3
Name:           clufter
c999e3
Version:        0.50.4
c999e3
Release:        1%{?dist}
c999e3
Group:          System Environment/Base
c999e3
Summary:        Tool/library for transforming/analyzing cluster configuration formats
c999e3
License:        GPLv2+
c999e3
URL:            https://github.com/jnpkrn/%{name}
c999e3
c999e3
# required for autosetup macro
c999e3
BuildRequires:  git
c999e3
c999e3
BuildRequires:  python2-devel
c999e3
BuildRequires:  python-setuptools
c999e3
BuildRequires:  python-lxml
c999e3
c999e3
Source0:        https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{version}.tar.gz
c999e3
c999e3
%description
c999e3
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
c999e3
stacks configuration conversion (as per RHEL trend), the command-filter-format
c999e3
framework (capable of XSLT) offers also other uses through its plugin library.
c999e3
c999e3
%package cli
c999e3
Group:          System Environment/Base
c999e3
Summary:        Tool for transforming/analyzing cluster configuration formats
c999e3
c999e3
BuildRequires:  bash-completion
c999e3
c999e3
BuildRequires:  help2man
c999e3
c999e3
# following for pkg_resources module
c999e3
Requires:       python-setuptools
c999e3
Requires:       python-%{name} = %{version}-%{release}
c999e3
Provides:       %{name} = %{version}-%{release}
c999e3
BuildArch:      noarch
c999e3
c999e3
%description cli
c999e3
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
c999e3
stacks configuration conversion (as per RHEL trend), the command-filter-format
c999e3
framework (capable of XSLT) offers also other uses through its plugin library.
c999e3
c999e3
This package contains %{name} command-line interface for the underlying
c999e3
library (packaged as python-%{name}).
c999e3
c999e3
%package -n python-%{name}
c999e3
Group:          System Environment/Libraries
c999e3
Summary:        Library for transforming/analyzing cluster configuration formats
c999e3
License:        GPLv2+ and GFDL
c999e3
c999e3
BuildRequires:  pkgconfig(libxml-2.0)
c999e3
c999e3
Requires:       python-lxml
c999e3
Requires:       %{_bindir}/nano
c999e3
c999e3
%description -n python-%{name}
c999e3
While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster
c999e3
stacks configuration conversion (as per RHEL trend), the command-filter-format
c999e3
framework (capable of XSLT) offers also other uses through its plugin library.
c999e3
c999e3
This package contains %{name} library including built-in plugins.
c999e3
c999e3
%package lib-general
c999e3
Group:          System Environment/Libraries
c999e3
Summary:        Extra %{name} plugins usable for/as generic/auxiliary products
c999e3
Requires:       python-%{name} = %{version}-%{release}
c999e3
BuildArch:      noarch
c999e3
c999e3
%description lib-general
c999e3
This package contains set of additional plugins targeting variety of generic
c999e3
formats often serving as a byproducts in the intermediate steps of the overall
c999e3
process arrangement: either experimental commands or internally unused,
c999e3
reusable formats and filters.
c999e3
c999e3
%package lib-ccs
c999e3
Group:          System Environment/Libraries
c999e3
Summary:        Extra plugins for transforming/analyzing CMAN configuration
c999e3
Requires:       python-%{name} = %{version}-%{release}
c999e3
Requires:       %{name}-lib-general = %{version}-%{release}
c999e3
BuildArch:      noarch
c999e3
c999e3
%description lib-ccs
c999e3
This package contains set of additional plugins targeting CMAN cluster
c999e3
configuration: either experimental commands or internally unused, reusable
c999e3
formats and filters.
c999e3
c999e3
%package lib-pcs
c999e3
Group:          System Environment/Libraries
c999e3
Summary:        Extra plugins for transforming/analyzing Pacemaker configuration
c999e3
Requires:       python-%{name} = %{version}-%{release}
c999e3
Requires:       %{name}-lib-general = %{version}-%{release}
c999e3
BuildArch:      noarch
c999e3
c999e3
%description lib-pcs
c999e3
This package contains set of additional plugins targeting Pacemaker cluster
c999e3
configuration: either experimental commands or internally unused, reusable
c999e3
formats and filters.
c999e3
c999e3
%prep
c999e3
%autosetup -p1 -S git
c999e3
c999e3
## for some esoteric reason, the line above has to be empty
c999e3
%{__python2} setup.py saveopts -f setup.cfg pkg_prepare \
c999e3
                      --ccs-flatten='%{_libexecdir}/%{name}-%{version}/ccs_flatten' \
c999e3
                      --editor='%{_bindir}/nano' \
c999e3
                      --ra-metadata-dir='%{_datadir}/cluster' \
c999e3
                      --ra-metadata-ext='metadata'
c999e3
c999e3
%build
c999e3
%{__python2} setup.py build
c999e3
./run-dev --skip-ext --completion-bash 2>/dev/null \
c999e3
  | sed 's|run[-_]dev|%{name}|g' > .bashcomp
c999e3
%{__mkdir_p} -- .manpages/man1
c999e3
help2man -N -h -H -n "$(sed -n '2s|[^(]\+(\([^)]\+\))|\1|p' README)" ./run-dev \
c999e3
  | sed 's|run[-_]dev|%{name}|g' \
c999e3
  > .manpages/man1/%{name}.1
c999e3
c999e3
%install
c999e3
c999e3
# '--root' implies setuptools involves distutils to do old-style install
c999e3
%{__python2} setup.py install --skip-build --root '%{buildroot}'
c999e3
# following is needed due to umask 022 not taking effect(?) leading to 775
c999e3
%{__chmod} -- g-w '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten'
c999e3
# %%{_bindir}/%%{name} should have been created
c999e3
test -f '%{buildroot}%{_bindir}/%{name}' \
c999e3
  || %{__install} -D -pm 644 -- '%{buildroot}%{_bindir}/%{name}' \
c999e3
                                '%{buildroot}%{_bindir}/%{name}'
c999e3
declare bashcompdir="$(pkg-config --variable=completionsdir bash-completion \
c999e3
                       || echo '%{_datadir}/bash-completion/completions')"
c999e3
declare bashcomp="${bashcompdir}/%{name}"
c999e3
%{__install} -D -pm 644 -- \
c999e3
  .bashcomp '%{buildroot}%{_sysconfdir}/%{name}/bash-completion'
c999e3
%{__mkdir_p} -- "%{buildroot}${bashcompdir}"
c999e3
ln -s '%{_sysconfdir}/%{name}/bash-completion' "%{buildroot}${bashcomp}"
c999e3
# own %%{_datadir}/bash-completion in case of ...bash-completion/completions,
c999e3
# more generally any path up to any of /, /usr, /usr/share, /etc
c999e3
while true; do
c999e3
  test "$(dirname "${bashcompdir}")" != "/" \
c999e3
  && test "$(dirname "${bashcompdir}")" != "%{_prefix}" \
c999e3
  && test "$(dirname "${bashcompdir}")" != "%{_datadir}" \
c999e3
  && test "$(dirname "${bashcompdir}")" != "%{_sysconfdir}" \
c999e3
  || break
c999e3
  bashcompdir="$(dirname "${bashcompdir}")"
c999e3
done
c999e3
cat >.bashcomp-files <<-EOF
c999e3
	${bashcompdir}
c999e3
	%dir %{_sysconfdir}/%{name}
c999e3
	%verify(not size md5 mtime) %{_sysconfdir}/%{name}/bash-completion
c999e3
EOF
c999e3
%{__mkdir_p} -- '%{buildroot}%{_mandir}'
c999e3
%{__cp} -a -- .manpages/* '%{buildroot}%{_mandir}'
c999e3
%{__mkdir_p} -- '%{buildroot}%{_defaultdocdir}/%{name}-%{version}'
c999e3
%{__install} -pm 644 -- gpl-2.0.txt doc/*.txt \
c999e3
                        '%{buildroot}%{_defaultdocdir}/%{name}-%{version}'
c999e3
c999e3
%check
c999e3
# just a basic sanity check
c999e3
# we need to massage RA metadata files and PATH so the local run works
c999e3
# XXX we could also inject buildroot's site_packages dir to PYTHONPATH
c999e3
declare ret=0 \
c999e3
        ccs_flatten_dir="$(dirname '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten')"
c999e3
ln -s '%{buildroot}%{_datadir}/cluster'/*.'metadata' \
c999e3
      "${ccs_flatten_dir}"
c999e3
PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" ./run-check
c999e3
ret=$?
c999e3
%{__rm} -f -- "${ccs_flatten_dir}"/*.'metadata'
c999e3
[ ${ret} -eq 0 ] || exit ${ret}
c999e3
c999e3
%post cli
c999e3
if [ $1 -gt 1 ]; then  # no gain regenerating it w/ fresh install (same result)
c999e3
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
c999e3
%{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
c999e3
fi
c999e3
c999e3
%post lib-general
c999e3
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
c999e3
# if the completion file is not present, suppose it is not desired
c999e3
test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \
c999e3
  && %{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
c999e3
c999e3
%post lib-ccs
c999e3
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
c999e3
# if the completion file is not present, suppose it is not desired
c999e3
test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \
c999e3
  && %{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
c999e3
c999e3
%post lib-pcs
c999e3
declare bashcomp="%{_sysconfdir}/%{name}/bash-completion"
c999e3
# if the completion file is not present, suppose it is not desired
c999e3
test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \
c999e3
  && %{_bindir}/%{name} --completion-bash > "${bashcomp}" 2>/dev/null || :
c999e3
c999e3
%files cli -f .bashcomp-files
c999e3
%{_mandir}/man1/*.1*
c999e3
%{_bindir}/%{name}
c999e3
%{python2_sitelib}/%{name}/__main__.py*
c999e3
%{python2_sitelib}/%{name}/main.py*
c999e3
%{python2_sitelib}/%{name}/completion.py*
c999e3
c999e3
%files -n python-%{name}
c999e3
%dir %{_defaultdocdir}/%{name}-%{version}
c999e3
%{_defaultdocdir}/%{name}-%{version}/*[^[:digit:]].txt
c999e3
%license %{_defaultdocdir}/%{name}-%{version}/*[[:digit:]].txt
c999e3
%exclude %{python2_sitelib}/%{name}/__main__.py*
c999e3
%exclude %{python2_sitelib}/%{name}/main.py*
c999e3
%exclude %{python2_sitelib}/%{name}/completion.py*
c999e3
%exclude %{python2_sitelib}/%{name}/ext-plugins/*/
c999e3
%{python2_sitelib}/%{name}
c999e3
%{python2_sitelib}/%{name}-*.egg-info
c999e3
%{_libexecdir}/%{name}-%{version}
c999e3
%{_datadir}/cluster
c999e3
c999e3
%files lib-general
c999e3
%{python2_sitelib}/%{name}/ext-plugins/lib-general
c999e3
c999e3
%files lib-ccs
c999e3
%{python2_sitelib}/%{name}/ext-plugins/lib-ccs
c999e3
c999e3
%files lib-pcs
c999e3
%{python2_sitelib}/%{name}/ext-plugins/lib-pcs
c999e3
c999e3
%changelog
c999e3
* Wed Sep 09 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.50.4-1
c999e3
- bump upstream package
c999e3
c999e3
* Thu Sep 03 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.50.3-1
c999e3
- bump upstream package
c999e3
c999e3
* Wed Aug 12 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.50.2-1
c999e3
- bump upstream package
c999e3
c999e3
* Tue Jul 14 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.50.1-1
c999e3
- bump upstream package
c999e3
c999e3
* Fri Jul 03 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.50.0-1
c999e3
- bump upstream package (intentional jump on upstream front)
c999e3
c999e3
* Fri Jun 19 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.12.0-1
c999e3
- move completion module to clufter-cli sub-package
c999e3
- bump upstream package
c999e3
c999e3
* Wed Apr 15 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.11.0-1
c999e3
- bump upstream package
c999e3
c999e3
* Fri Mar 20 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.10.3-1
c999e3
- bump upstream package
c999e3
c999e3
* Mon Mar 16 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.10.2-1
c999e3
- bump upstream package
c999e3
c999e3
* Fri Mar 06 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.10.1-2
c999e3
- packaging fixes (%{name}-cli requires python-setuptools, adjust for
c999e3
  older schema of Bash completions)
c999e3
c999e3
* Fri Mar 06 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.10.1-1
c999e3
- bump upstream package
c999e3
c999e3
* Thu Feb 26 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.10.0-1
c999e3
- packaging enhacements (structure, redundancy, ownership, scriptlets, symlink)
c999e3
- version bump so as not to collide with python-clufter co-packaged with pcs
c999e3
c999e3
* Tue Jan 20 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.3.5-1
c999e3
- packaging enhancements (pkg-config, license tag)
c999e3
c999e3
* Wed Jan 14 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.3.4-1
c999e3
- packaging enhancements (permissions, ownership)
c999e3
- man page for CLI frontend now included
c999e3
c999e3
* Tue Jan 13 2015 Jan Pokorný <jpokorny+rpm-clufter@redhat.com> - 0.3.3-1
c999e3
- initial build