Blame SPECS/booth.spec

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