Blame SPECS/booth.spec

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