Blame SPECS/booth.spec

afe0d5
# RPMs are split as follows:
afe0d5
# * booth:
afe0d5
#   - envelope package serving as a syntactic shortcut to install
afe0d5
#     booth-site (with architecture reliably preserved)
afe0d5
# * booth-core:
afe0d5
#   - package serving as a base for booth-{arbitrator,site},
afe0d5
#     carrying also basic documentation, license, etc.
afe0d5
# * booth-arbitrator:
afe0d5
#   - package to be installed at a machine accessible within HA cluster(s),
afe0d5
#     but not (necessarily) a member of any, hence no dependency
afe0d5
#     on anything from cluster stack is required
afe0d5
# * booth-site:
afe0d5
#   - package to be installed at a cluster member node
afe0d5
#     (requires working cluster environment to be useful)
afe0d5
# * booth-test:
afe0d5
#   - files for testing booth
afe0d5
#
afe0d5
# TODO:
afe0d5
# wireshark-dissector.lua currently of no use (rhbz#1259623), but if/when
afe0d5
# this no longer persists, add -wireshark package (akin to libvirt-wireshark)
afe0d5
afe0d5
%bcond_with html_man
afe0d5
%bcond_with glue
afe0d5
afe0d5
# Disable automatic compilation of Python files in extra directories
afe0d5
%global _python_bytecompile_extra 0
afe0d5
afe0d5
%global specver 5
afe0d5
%global boothver 1.0
afe0d5
# set following to the actual commit or, for final release, concatenate
afe0d5
# "boothver" macro to "v" (will yield a tag per the convention)
afe0d5
%global commit f2d38ce3d61502bda2a28e79db103737a691faf4
afe0d5
%global lparen (
afe0d5
%global rparen )
afe0d5
%global shortcommit %(c=%{commit}; case ${c} in
afe0d5
                      v*%{rparen} echo ${c:1};;
afe0d5
                      *%{rparen} echo ${c:0:7};; esac)
afe0d5
%global pre_release %(s=%{shortcommit}; [ ${s: -3:2} != rc ]; echo $?)
afe0d5
%global post_release %([ %{commit} = v%{shortcommit} ]; echo $?)
afe0d5
%global github_owner ClusterLabs
afe0d5
afe0d5
%if 0%{pre_release}
afe0d5
%global boothrel    0.%{specver}.%(s=%{shortcommit}; echo ${s: -3})
afe0d5
%else
afe0d5
%if 0%{post_release}
afe0d5
%global boothrel    %{specver}.%{shortcommit}.git
afe0d5
%else
afe0d5
%global boothrel    %{specver}
afe0d5
%endif
afe0d5
%endif
afe0d5
afe0d5
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}}
afe0d5
# https://fedoraproject.org/wiki/EPEL:Packaging?rd=Packaging:EPEL#The_.25license_tag
afe0d5
%{!?_licensedir:%global license %doc}
afe0d5
afe0d5
%global test_path   %{_datadir}/booth/tests
afe0d5
afe0d5
Name:           booth
afe0d5
Version:        %{boothver}
afe0d5
Release:        %{boothrel}%{dist}
afe0d5
Summary:        Ticket Manager for Multi-site Clusters
afe0d5
Group:          System Environment/Daemons
afe0d5
License:        GPLv2+
afe0d5
Url:            https://github.com/%{github_owner}/%{name}
afe0d5
Source0:        https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
afe0d5
Patch0:         0000-test-remove-superfluous-shebangs-for-import-only-mod.patch
afe0d5
Patch1:         0001-test-do-not-mix-tabs-with-spaces-in-Python-code.patch
afe0d5
Patch2:         0002-test-make-Python-files-supported-_also_-with-Python-.patch
afe0d5
Patch3:         0003-build-parametrize-Python-invocations-in-the-shebangs.patch
afe0d5
Patch4:         0004-test-drop-underqualified-identifier-in-unittest-s-2..patch
afe0d5
Patch5:         0005-test-drop-comment-out-superfluous-imports.patch
afe0d5
Patch6:         0006-test-avoid-dangerous-mutable-sticky-default-value.patch
afe0d5
Patch7:         0007-test-unit-test.py-daemon-will-not-stay-in-foreground.patch
afe0d5
Patch8:         0008-Refactor-fix-strncpy-may-miss-trailing-null-byte-war.patch
afe0d5
Patch9:         0009-maint-lsb-polish-arbitrator-s-initscript-fix-condres.patch
afe0d5
Patch10:        0010-maint-test-polish-live_test.sh.patch
afe0d5
Patch11:        0011-maint-ocf-script-eliminate-some-false-positives-with.patch
afe0d5
afe0d5
# direct build process dependencies
afe0d5
BuildRequires:  autoconf
afe0d5
BuildRequires:  automake
afe0d5
BuildRequires:  coreutils
afe0d5
BuildRequires:  make
afe0d5
## ./autogen.sh
afe0d5
BuildRequires:  /bin/sh
afe0d5
# general build dependencies
afe0d5
BuildRequires:  asciidoc
afe0d5
BuildRequires:  gcc
afe0d5
BuildRequires:  pkgconfig
afe0d5
# linking dependencies
afe0d5
BuildRequires:  libgcrypt-devel
afe0d5
BuildRequires:  libxml2-devel
afe0d5
## just for <pacemaker/crm/services.h> include
afe0d5
BuildRequires:  pacemaker-libs-devel
afe0d5
BuildRequires:  pkgconfig(glib-2.0)
afe0d5
BuildRequires:  zlib-devel
afe0d5
## logging provider
afe0d5
BuildRequires:  pkgconfig(libqb)
afe0d5
## random2range provider
afe0d5
BuildRequires:  pkgconfig(glib-2.0)
afe0d5
## nametag provider
afe0d5
BuildRequires:  pkgconfig(libsystemd)
afe0d5
# check scriptlet (for hostname and killall respectively)
afe0d5
BuildRequires:  hostname psmisc
afe0d5
BuildRequires:  python3-devel
afe0d5
# spec file specifics
afe0d5
## for _unitdir, systemd_requires and specific scriptlet macros
afe0d5
BuildRequires:  systemd
afe0d5
## for autosetup
afe0d5
BuildRequires:  git
afe0d5
afe0d5
# this is for a composite-requiring-its-components arranged
afe0d5
# as an empty package (empty files section) requiring subpackages
afe0d5
# (_isa so as to preserve the architecture)
afe0d5
Requires:       %{name}-core%{?_isa}
afe0d5
Requires:       %{name}-site
afe0d5
%files
afe0d5
# intentionally empty
afe0d5
afe0d5
%description
afe0d5
Booth manages tickets which authorize cluster sites located
afe0d5
in geographically dispersed locations to run resources.
afe0d5
It facilitates support of geographically distributed
afe0d5
clustering in Pacemaker.
afe0d5
afe0d5
# SUBPACKAGES #
afe0d5
afe0d5
%package        core
afe0d5
Summary:        Booth core files (executables, etc.)
afe0d5
Group:          System Environment/Daemons
afe0d5
# for booth-keygen (chown, dd)
afe0d5
Requires:       coreutils
afe0d5
# deal with pre-split arrangement
afe0d5
Conflicts:      %{name} < 1.0-1
afe0d5
afe0d5
%description    core
afe0d5
Core files (executables, etc.) for Booth, ticket manager for
afe0d5
multi-site clusters.
afe0d5
afe0d5
%package        arbitrator
afe0d5
Summary:        Booth support for running as an arbitrator
afe0d5
Group:          System Environment/Daemons
afe0d5
BuildArch:      noarch
afe0d5
Requires:       %{name}-core = %{version}-%{release}
afe0d5
%{?systemd_requires}
afe0d5
# deal with pre-split arrangement
afe0d5
Conflicts:      %{name} < 1.0-1
afe0d5
afe0d5
%description    arbitrator
afe0d5
Support for running Booth, ticket manager for multi-site clusters,
afe0d5
as an arbitrator.
afe0d5
afe0d5
%post arbitrator
afe0d5
%systemd_post booth@.service booth-arbitrator.service
afe0d5
afe0d5
%preun arbitrator
afe0d5
%systemd_preun booth@.service booth-arbitrator.service
afe0d5
afe0d5
%postun arbitrator
afe0d5
%systemd_postun_with_restart booth@.service booth-arbitrator.service
afe0d5
afe0d5
%package        site
afe0d5
Summary:        Booth support for running as a full-fledged site
afe0d5
Group:          System Environment/Daemons
afe0d5
BuildArch:      noarch
afe0d5
Requires:       %{name}-core = %{version}-%{release}
afe0d5
# for crm_{resource,simulate,ticket} utilities
afe0d5
Requires:       pacemaker >= 1.1.8
afe0d5
# for ocf-shellfuncs and other parts of OCF shell-based environment
afe0d5
Requires:       resource-agents
afe0d5
# deal with pre-split arrangement
afe0d5
Conflicts:      %{name} < 1.0-1
afe0d5
afe0d5
%description    site
afe0d5
Support for running Booth, ticket manager for multi-site clusters,
afe0d5
as a full-fledged site.
afe0d5
afe0d5
%package        test
afe0d5
Summary:        Test scripts for Booth
afe0d5
Group:          System Environment/Daemons
afe0d5
BuildArch:      noarch
afe0d5
# runtests.py suite (for hostname and killall respectively)
afe0d5
Requires:       hostname psmisc
afe0d5
# any of the following internal dependencies will pull -core package
afe0d5
## for booth@booth.service
afe0d5
Requires:       %{name}-arbitrator = %{version}-%{release}
afe0d5
## for booth-site and service-runnable scripts
afe0d5
## (and /usr/lib/ocf/resource.d/booth)
afe0d5
Requires:       %{name}-site = %{version}-%{release}
afe0d5
Requires:       gdb
afe0d5
Requires:       %{__python3}
afe0d5
Requires:       python3-pexpect
afe0d5
afe0d5
%description    test
afe0d5
Automated tests for running Booth, ticket manager for multi-site clusters.
afe0d5
afe0d5
# BUILD #
afe0d5
afe0d5
%prep
afe0d5
%autosetup -n %{name}-%{commit} -S git_am
afe0d5
afe0d5
%build
afe0d5
./autogen.sh
afe0d5
%{configure} \
afe0d5
        --with-initddir=%{_initrddir} \
afe0d5
        --docdir=%{_pkgdocdir} \
afe0d5
        --enable-user-flags \
afe0d5
        %{!?with_html_man:--without-html_man} \
afe0d5
        %{!?with_glue:--without-glue}
afe0d5
%{make_build}
afe0d5
afe0d5
%install
afe0d5
%{make_install}
afe0d5
mkdir -p %{buildroot}/%{_unitdir}
afe0d5
cp -a -t %{buildroot}/%{_unitdir} \
afe0d5
        -- conf/booth@.service conf/booth-arbitrator.service
afe0d5
install -D -m 644 -t %{buildroot}/%{_mandir}/man8 \
afe0d5
        -- docs/boothd.8
afe0d5
ln -s boothd.8 %{buildroot}/%{_mandir}/man8/booth.8
afe0d5
cp -a -t %{buildroot}/%{_pkgdocdir} \
afe0d5
        -- ChangeLog README-testing conf/booth.conf.example
afe0d5
# drop what we don't package anyway (COPYING added via tarball-relative path)
afe0d5
rm -rf %{buildroot}/%{_initrddir}/booth-arbitrator
afe0d5
rm -rf %{buildroot}/%{_pkgdocdir}/README.upgrade-from-v0.1
afe0d5
rm -rf %{buildroot}/%{_pkgdocdir}/COPYING
afe0d5
# tests
afe0d5
mkdir -p %{buildroot}/%{test_path}
afe0d5
cp -a -t %{buildroot}/%{test_path} \
afe0d5
        -- conf test unit-tests script/unit-test.py
afe0d5
chmod +x %{buildroot}/%{test_path}/test/booth_path
afe0d5
chmod +x %{buildroot}/%{test_path}/test/live_test.sh
afe0d5
mkdir -p %{buildroot}/%{test_path}/src
afe0d5
ln -s -t %{buildroot}/%{test_path}/src \
afe0d5
        -- %{_sbindir}/boothd
afe0d5
afe0d5
# https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation
afe0d5
%py_byte_compile %{__python3} %{buildroot}/%{test_path}
afe0d5
afe0d5
%check
afe0d5
# alternatively: test/runtests.py
afe0d5
VERBOSE=1 make check
afe0d5
afe0d5
%files          core
afe0d5
%license COPYING
afe0d5
%doc %{_pkgdocdir}/AUTHORS
afe0d5
%doc %{_pkgdocdir}/ChangeLog
afe0d5
%doc %{_pkgdocdir}/README
afe0d5
%doc %{_pkgdocdir}/booth.conf.example
afe0d5
# core command(s) + man pages
afe0d5
%{_sbindir}/booth*
afe0d5
%{_mandir}/man8/booth*.8*
afe0d5
# configuration
afe0d5
%dir %{_sysconfdir}/booth
afe0d5
%exclude %{_sysconfdir}/booth/booth.conf.example
afe0d5
afe0d5
%files          arbitrator
afe0d5
%{_unitdir}/booth@.service
afe0d5
%{_unitdir}/booth-arbitrator.service
afe0d5
afe0d5
%files          site
afe0d5
# OCF (agent + a helper)
afe0d5
## /usr/lib/ocf/resource.d/pacemaker provided by pacemaker
afe0d5
/usr/lib/ocf/resource.d/pacemaker/booth-site
afe0d5
%dir /usr/lib/ocf/lib/booth
afe0d5
     /usr/lib/ocf/lib/booth/geo_attr.sh
afe0d5
# geostore (command + OCF agent)
afe0d5
%{_sbindir}/geostore
afe0d5
%{_mandir}/man8/geostore.8*
afe0d5
## /usr/lib/ocf/resource.d provided by resource-agents
afe0d5
%dir /usr/lib/ocf/resource.d/booth
afe0d5
     /usr/lib/ocf/resource.d/booth/geostore
afe0d5
# helper (possibly used in the configuration hook)
afe0d5
%dir %{_datadir}/booth
afe0d5
     %{_datadir}/booth/service-runnable
afe0d5
afe0d5
%files          test
afe0d5
%doc %{_pkgdocdir}/README-testing
afe0d5
# /usr/share/booth provided by -site
afe0d5
%{test_path}
afe0d5
# /usr/lib/ocf/resource.d/booth provided by -site
afe0d5
/usr/lib/ocf/resource.d/booth/sharedrsc
afe0d5
afe0d5
%changelog
afe0d5
* Wed Sep 19 2018 Tomas Orsava <torsava@redhat.com> - 1.0-5.f2d38ce.git
afe0d5
- Require the Python interpreter directly instead of using the package name
afe0d5
- Related: rhbz#1619153
afe0d5
afe0d5
* Thu Jul 19 2018 Jan Pokorný <jpokorny+rpm-booth@redhat.com> - 1.0-4.f2d38ce.git
afe0d5
- revert back to using asciidoc instead of asciidoctor for generating man pages
afe0d5
  (rhbz#1603119)
afe0d5
- fix some issues in the shell scripts (rhbz#1602455)
afe0d5
afe0d5
* Mon Jul 16 2018 Jan Pokorný <jpokorny+rpm-booth@redhat.com> - 1.0-3.f2d38ce.git
afe0d5
- update for another, current snapshot beyond booth-1.0
afe0d5
  (commit f2d38ce), including:
afe0d5
  . support for solely manually managed tickets (9a365f9)
afe0d5
  . use asciidoctor instead of asciidoc for generating man pages (65e6a6b)
afe0d5
- switch to using Python 3 for the tests instead of Python 2
afe0d5
  (behind unversioned "python" references; rhbz#1590856)
afe0d5
afe0d5
* Thu Jun 21 2018 Troy Dawson <tdawson@redhat.com> - 1.0-2.570876d.git.3
afe0d5
- Fix python shebangs (#1580601)
afe0d5
afe0d5
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-2.570876d.git.2
afe0d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
afe0d5
afe0d5
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2.570876d.git.1
afe0d5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
afe0d5
afe0d5
* Wed May 25 2016 Jan Pokorný <jpokorny+rpm-booth@fedoraproject.org> - 1.0-3.570876d.git
afe0d5
- update per the changesets recently accepted by the upstream
afe0d5
  (memory/resource leaks fixes, patches previously attached separately
afe0d5
  that make unit test pass, internal cleanups, etc.)
afe0d5
afe0d5
* Thu May 05 2016 Jan Pokorný <jpokorny+rpm-booth@fedoraproject.org> - 1.0-2.eb4256a.git
afe0d5
- update a subset of out-of-tree patches per
afe0d5
  https://github.com/ClusterLabs/booth/pull/22#issuecomment-216936987
afe0d5
- pre-inclusion cleanups in the spec (apply systemd scriptlet operations
afe0d5
  with booth-arbitrator, avoid overloading file implicitly considered %%doc
afe0d5
  as %%license)
afe0d5
  Resolves: rhbz#1314865
afe0d5
  Related: rhbz#1333509
afe0d5
afe0d5
* Thu Apr 28 2016 Jan Pokorný <jpokorny+rpm-booth@fedoraproject.org> - 1.0-1.eb4256a.git
afe0d5
- initial build