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
b9df40
%bcond_with run_build_tests
b9df40
b9df40
# set following to the result of  `git describe --abbrev=128 $commit`
b9df40
# This will be used to fill booth_ver, booth_numcomm and booth_sha1.
b9df40
# It is important to keep abbrev to get full length sha1! When updating source use
b9df40
# `spectool -g booth.spec` to download source.
b9df40
%global git_describe_str v1.0-199-gac1d34ce172678a8f5ba415e976cf2366d45e15e
b9df40
b9df40
# Set this to 1 when rebasing (changing git_describe_str) and increase otherwise
b9df40
%global release 1
b9df40
b9df40
# Run shell script to parse git_describe str into version, numcomm and sha1 hash
b9df40
%global booth_ver %(s=%{git_describe_str}; vver=${s%%%%-*}; echo ${vver:1})
b9df40
%global booth_numcomm %(s=%{git_describe_str}; t=${s#*-}; echo ${t%%%%-*})
b9df40
%global booth_sha1 %(s=%{git_describe_str}; t=${s##*-}; echo ${t:1})
b9df40
%global booth_short_sha1 %(s=%{booth_sha1}; echo ${s:0:7})
b9df40
%global booth_archive_name %{name}-%{booth_ver}-%{booth_numcomm}-%{booth_short_sha1}
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
b8c11e
%global github_owner ClusterLabs
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
b9df40
Version:        %{booth_ver}
b9df40
Release:        %{booth_numcomm}.%{release}.%{booth_short_sha1}.git%{?dist}
b8c11e
Summary:        Ticket Manager for Multi-site Clusters
b8c11e
License:        GPLv2+
b8c11e
Url:            https://github.com/%{github_owner}/%{name}
b9df40
Source0:        https://github.com/%{github_owner}/%{name}/archive/%{booth_short_sha1}/%{booth_archive_name}.tar.gz
f46857
Patch0:         0001-build-Do-not-link-with-pcmk-libraries.patch
b9df40
Patch1:         0002-pacemaker-Handle-updated-exit-code-of-crm_ticket.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
b9df40
%if 0%{?with_run_build_tests}
f46857
# check scriptlet (for perl and netstat)
f46857
BuildRequires:  perl-interpreter net-tools
b9df40
%endif
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
b9df40
%autosetup -n %{name}-%{booth_sha1} -S git_am
b8c11e
b8c11e
%build
b8c11e
./autogen.sh
b8c11e
%{configure} \
b8c11e
        --with-initddir=%{_initrddir} \
b8c11e
        --docdir=%{_pkgdocdir} \
b8c11e
        --enable-user-flags \
b9df40
        %{?with_html_man:--with-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
b9df40
%if 0%{?with_run_build_tests}
b8c11e
VERBOSE=1 make check
b9df40
%endif
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
b9df40
# Generated html docs
b9df40
%if 0%{?with_html_man}
b9df40
%{_pkgdocdir}/booth-keygen.8.html
b9df40
%{_pkgdocdir}/boothd.8.html
b9df40
%endif
b9df40
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
b9df40
# Generated html docs
b9df40
%if 0%{?with_html_man}
b9df40
%{_pkgdocdir}/geostore.8.html
b9df40
%endif
b9df40
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
b9df40
* Thu Oct 15 2020 Jan Friesse <jfriesse@redhat.com> - 1.0-199.1.ac1d34c.git
b9df40
- Resolves: rhbz#1873948
b9df40
- Resolves: rhbz#1768172
b9df40
b9df40
- Fix versioning scheme to handle updates better
b9df40
- Handle updated exit code of crm_ticket
b9df40
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