Jan Pokorný b4585a
# RPMs are split as follows:
Jan Pokorný b4585a
# * booth:
Jan Pokorný b4585a
#   - envelope package serving as a syntactic shortcut to install
Jan Pokorný b4585a
#     booth-site (with architecture reliably preserved)
Jan Pokorný b4585a
# * booth-core:
Jan Pokorný b4585a
#   - package serving as a base for booth-{arbitrator,site},
Jan Pokorný b4585a
#     carrying also basic documentation, license, etc.
Jan Pokorný b4585a
# * booth-arbitrator:
Jan Pokorný b4585a
#   - package to be installed at a machine accessible within HA cluster(s),
Jan Pokorný b4585a
#     but not (necessarily) a member of any, hence no dependency
Jan Pokorný b4585a
#     on anything from cluster stack is required
Jan Pokorný b4585a
# * booth-site:
Jan Pokorný b4585a
#   - package to be installed at a cluster member node
Jan Pokorný b4585a
#     (requires working cluster environment to be useful)
Jan Pokorný b4585a
# * booth-test:
Jan Pokorný b4585a
#   - files for testing booth
Jan Pokorný b4585a
#
Jan Pokorný b4585a
# TODO:
Jan Pokorný b4585a
# wireshark-dissector.lua currently of no use (rhbz#1259623), but if/when
Jan Pokorný b4585a
# this no longer persists, add -wireshark package (akin to libvirt-wireshark)
Jan Pokorný b4585a
Jan Pokorný b4585a
%bcond_with html_man
Jan Pokorný b4585a
%bcond_with glue
Jan Pokorný b4585a
Jan Pokorný b4585a
%global specver 2
Jan Pokorný b4585a
%global boothver 1.0
Jan Pokorný b4585a
# set following to the actual commit or, for final release, concatenate
Jan Pokorný b4585a
# "boothver" macro to "v" (will yield a tag per the convention)
Jan Pokorný 0c140f
%global commit 570876d74c47a93bcdededd1c192a13610eb1d18
Jan Pokorný b4585a
%global lparen (
Jan Pokorný b4585a
%global rparen )
Jan Pokorný b4585a
%global shortcommit %(c=%{commit}; case ${c} in
Jan Pokorný b4585a
                      v*%{rparen} echo ${c:1};;
Jan Pokorný b4585a
                      *%{rparen} echo ${c:0:7};; esac)
Jan Pokorný b4585a
%global pre_release %(s=%{shortcommit}; [ ${s: -3:2} != rc ]; echo $?)
Jan Pokorný b4585a
%global post_release %([ %{commit} = v%{shortcommit} ]; echo $?)
Jan Pokorný b4585a
%global github_owner ClusterLabs
Jan Pokorný b4585a
Jan Pokorný b4585a
%if 0%{pre_release}
Jan Pokorný b4585a
%global boothrel    0.%{specver}.%(s=%{shortcommit}; echo ${s: -3})
Jan Pokorný b4585a
%else
Jan Pokorný b4585a
%if 0%{post_release}
Jan Pokorný b4585a
%global boothrel    %{specver}.%{shortcommit}.git
Jan Pokorný b4585a
%else
Jan Pokorný b4585a
%global boothrel    %{specver}
Jan Pokorný b4585a
%endif
Jan Pokorný b4585a
%endif
Jan Pokorný b4585a
Jan Pokorný b4585a
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}}
Jan Pokorný b4585a
# https://fedoraproject.org/wiki/EPEL:Packaging?rd=Packaging:EPEL#The_.25license_tag
Jan Pokorný b4585a
%{!?_licensedir:%global license %doc}
Jan Pokorný b4585a
Jan Pokorný b4585a
%global test_path   %{_datadir}/booth/tests
Jan Pokorný b4585a
Jan Pokorný b4585a
Name:           booth
Jan Pokorný b4585a
Version:        %{boothver}
Fedora Release Engineering b56849
Release:        %{boothrel}%{dist}.1
Jan Pokorný b4585a
Summary:        Ticket Manager for Multi-site Clusters
Jan Pokorný b4585a
Group:          System Environment/Daemons
Jan Pokorný b4585a
License:        GPLv2+
Jan Pokorný b4585a
Url:            https://github.com/%{github_owner}/%{name}
Jan Pokorný b4585a
Source0:        https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Jan Pokorný b4585a
Patch0:         0001-Feature-offer-alternatives-to-libraries-from-cluster.patch
Jan Pokorný b4585a
Patch1:         0002-Feature-alternative-logging-provider-libqb.patch
Jan Pokorný b4585a
Patch2:         0003-Feature-alternative-range2random-provider-glib.patch
Jan Pokorný b4585a
Patch3:         0004-Feature-alternative-nametag-provider-libsystemd.patch
Jan Pokorný b4585a
Patch4:         0005-Feature-allow-skipping-coredump-nursing-phase.patch
Jan Pokorný b4585a
Patch5:         0006-Feature-alternative-logger-in-service-runnable-scrip.patch
Jan Pokorný b4585a
Jan Pokorný b4585a
# direct build process dependencies
Jan Pokorný b4585a
BuildRequires:  autoconf
Jan Pokorný b4585a
BuildRequires:  automake
Jan Pokorný b4585a
BuildRequires:  coreutils
Jan Pokorný b4585a
BuildRequires:  make
Jan Pokorný b4585a
## ./autogen.sh
Jan Pokorný b4585a
BuildRequires:  /bin/sh
Jan Pokorný b4585a
# general build dependencies
Jan Pokorný b4585a
BuildRequires:  asciidoc
Jan Pokorný b4585a
BuildRequires:  gcc
Jan Pokorný b4585a
BuildRequires:  pkgconfig
Jan Pokorný b4585a
# linking dependencies
Jan Pokorný b4585a
BuildRequires:  libgcrypt-devel
Jan Pokorný b4585a
BuildRequires:  libxml2-devel
Jan Pokorný b4585a
## just for <pacemaker/crm/services.h> include
Jan Pokorný b4585a
BuildRequires:  pacemaker-libs-devel
Jan Pokorný b4585a
BuildRequires:  pkgconfig(glib-2.0)
Jan Pokorný b4585a
BuildRequires:  zlib-devel
Jan Pokorný b4585a
## logging provider
Jan Pokorný b4585a
BuildRequires:  pkgconfig(libqb)
Jan Pokorný b4585a
## random2range provider
Jan Pokorný b4585a
BuildRequires:  pkgconfig(glib-2.0)
Jan Pokorný b4585a
## nametag provider
Jan Pokorný b4585a
BuildRequires:  pkgconfig(libsystemd)
Jan Pokorný b4585a
# check scriptlet (for hostname and killall respectively)
Jan Pokorný b4585a
BuildRequires:  hostname psmisc
Jan Pokorný b4585a
BuildRequires:  python2-devel
Jan Pokorný b4585a
# spec file specifics
Jan Pokorný b4585a
## for _unitdir, systemd_requires and specific scriptlet macros
Jan Pokorný b4585a
BuildRequires:  systemd
Jan Pokorný b4585a
## for autosetup
Jan Pokorný b4585a
BuildRequires:  git
Jan Pokorný b4585a
Jan Pokorný b4585a
# this is for a composite-requiring-its-components arranged
Jan Pokorný b4585a
# as an empty package (empty files section) requiring subpackages
Jan Pokorný b4585a
# (_isa so as to preserve the architecture)
Jan Pokorný b4585a
Requires:       %{name}-core%{?_isa}
Jan Pokorný b4585a
Requires:       %{name}-site
Jan Pokorný b4585a
%files
Jan Pokorný b4585a
# intentionally empty
Jan Pokorný b4585a
Jan Pokorný b4585a
%description
Jan Pokorný b4585a
Booth manages tickets which authorize cluster sites located
Jan Pokorný b4585a
in geographically dispersed locations to run resources.
Jan Pokorný b4585a
It facilitates support of geographically distributed
Jan Pokorný b4585a
clustering in Pacemaker.
Jan Pokorný b4585a
Jan Pokorný b4585a
# SUBPACKAGES #
Jan Pokorný b4585a
Jan Pokorný b4585a
%package        core
Jan Pokorný b4585a
Summary:        Booth core files (executables, etc.)
Jan Pokorný b4585a
Group:          System Environment/Daemons
Jan Pokorný b4585a
# for booth-keygen (chown, dd)
Jan Pokorný b4585a
Requires:       coreutils
Jan Pokorný b4585a
# deal with pre-split arrangement
Jan Pokorný b4585a
Conflicts:      %{name} < 1.0-1
Jan Pokorný b4585a
Jan Pokorný b4585a
%description    core
Jan Pokorný b4585a
Core files (executables, etc.) for Booth, ticket manager for
Jan Pokorný b4585a
multi-site clusters.
Jan Pokorný b4585a
Jan Pokorný b4585a
%package        arbitrator
Jan Pokorný b4585a
Summary:        Booth support for running as an arbitrator
Jan Pokorný b4585a
Group:          System Environment/Daemons
Jan Pokorný b4585a
BuildArch:      noarch
Jan Pokorný b4585a
Requires:       %{name}-core = %{version}-%{release}
Jan Pokorný b4585a
%{?systemd_requires}
Jan Pokorný b4585a
# deal with pre-split arrangement
Jan Pokorný b4585a
Conflicts:      %{name} < 1.0-1
Jan Pokorný b4585a
Jan Pokorný b4585a
%description    arbitrator
Jan Pokorný b4585a
Support for running Booth, ticket manager for multi-site clusters,
Jan Pokorný b4585a
as an arbitrator.
Jan Pokorný b4585a
Jan Pokorný b4585a
%post arbitrator
Jan Pokorný b4585a
%systemd_post booth@.service booth-arbitrator.service
Jan Pokorný b4585a
Jan Pokorný b4585a
%preun arbitrator
Jan Pokorný b4585a
%systemd_preun booth@.service booth-arbitrator.service
Jan Pokorný b4585a
Jan Pokorný b4585a
%postun arbitrator
Jan Pokorný b4585a
%systemd_postun_with_restart booth@.service booth-arbitrator.service
Jan Pokorný b4585a
Jan Pokorný b4585a
%package        site
Jan Pokorný b4585a
Summary:        Booth support for running as a full-fledged site
Jan Pokorný b4585a
Group:          System Environment/Daemons
Jan Pokorný b4585a
BuildArch:      noarch
Jan Pokorný b4585a
Requires:       %{name}-core = %{version}-%{release}
Jan Pokorný b4585a
# for crm_{resource,simulate,ticket} utilities
Jan Pokorný b4585a
Requires:       pacemaker >= 1.1.8
Jan Pokorný b4585a
# for ocf-shellfuncs and other parts of OCF shell-based environment
Jan Pokorný b4585a
Requires:       resource-agents
Jan Pokorný b4585a
# deal with pre-split arrangement
Jan Pokorný b4585a
Conflicts:      %{name} < 1.0-1
Jan Pokorný b4585a
Jan Pokorný b4585a
%description    site
Jan Pokorný b4585a
Support for running Booth, ticket manager for multi-site clusters,
Jan Pokorný b4585a
as a full-fledged site.
Jan Pokorný b4585a
Jan Pokorný b4585a
%package        test
Jan Pokorný b4585a
Summary:        Test scripts for Booth
Jan Pokorný b4585a
Group:          System Environment/Daemons
Jan Pokorný b4585a
BuildArch:      noarch
Jan Pokorný b4585a
# runtests.py suite (for hostname and killall respectively)
Jan Pokorný b4585a
Requires:       hostname psmisc
Jan Pokorný b4585a
Requires:       python(abi) < 3
Jan Pokorný b4585a
# any of the following internal dependencies will pull -core package
Jan Pokorný b4585a
## for booth@booth.service
Jan Pokorný b4585a
Requires:       %{name}-arbitrator = %{version}-%{release}
Jan Pokorný b4585a
## for booth-site and service-runnable scripts
Jan Pokorný b4585a
## (and /usr/lib/ocf/resource.d/booth)
Jan Pokorný b4585a
Requires:       %{name}-site = %{version}-%{release}
Jan Pokorný b4585a
Jan Pokorný b4585a
%description    test
Jan Pokorný b4585a
Automated tests for running Booth, ticket manager for multi-site clusters.
Jan Pokorný b4585a
Jan Pokorný b4585a
# BUILD #
Jan Pokorný b4585a
Jan Pokorný b4585a
%prep
Jan Pokorný b4585a
%autosetup -n %{name}-%{commit} -S git
Jan Pokorný b4585a
Jan Pokorný b4585a
%build
Jan Pokorný b4585a
./autogen.sh
Jan Pokorný b4585a
%{configure} \
Jan Pokorný b4585a
        --with-initddir=%{_initrddir} \
Jan Pokorný b4585a
        --docdir=%{_pkgdocdir} \
Jan Pokorný b4585a
        --enable-user-flags \
Jan Pokorný b4585a
        %{!?with_html_man:--without-html_man} \
Jan Pokorný b4585a
        %{!?with_glue:--without-glue}
Jan Pokorný b4585a
%{make_build}
Jan Pokorný b4585a
Jan Pokorný b4585a
%install
Jan Pokorný b4585a
%{make_install}
Jan Pokorný b4585a
mkdir -p %{buildroot}/%{_unitdir}
Jan Pokorný b4585a
cp -a -t %{buildroot}/%{_unitdir} \
Jan Pokorný b4585a
        -- conf/booth@.service conf/booth-arbitrator.service
Jan Pokorný b4585a
install -D -m 644 -t %{buildroot}/%{_mandir}/man8 \
Jan Pokorný b4585a
        -- docs/boothd.8
Jan Pokorný b4585a
ln -s boothd.8 %{buildroot}/%{_mandir}/man8/booth.8
Jan Pokorný b4585a
cp -a -t %{buildroot}/%{_pkgdocdir} \
Jan Pokorný b4585a
        -- ChangeLog README-testing conf/booth.conf.example
Jan Pokorný b4585a
# drop what we don't package anyway (COPYING added via tarball-relative path)
Jan Pokorný b4585a
rm -rf %{buildroot}/%{_initrddir}/booth-arbitrator
Jan Pokorný b4585a
rm -rf %{buildroot}/%{_pkgdocdir}/README.upgrade-from-v0.1
Jan Pokorný b4585a
rm -rf %{buildroot}/%{_pkgdocdir}/COPYING
Jan Pokorný b4585a
# tests
Jan Pokorný b4585a
mkdir -p %{buildroot}/%{test_path}
Jan Pokorný b4585a
cp -a -t %{buildroot}/%{test_path} \
Jan Pokorný b4585a
        -- conf test unit-tests script/unit-test.py
Jan Pokorný b4585a
chmod +x %{buildroot}/%{test_path}/test/booth_path
Jan Pokorný b4585a
chmod +x %{buildroot}/%{test_path}/test/live_test.sh
Jan Pokorný b4585a
mkdir -p %{buildroot}/%{test_path}/src
Jan Pokorný b4585a
ln -s -t %{buildroot}/%{test_path}/src \
Jan Pokorný b4585a
        -- %{_sbindir}/boothd
Jan Pokorný b4585a
Jan Pokorný b4585a
%check
Jan Pokorný b4585a
# alternatively: test/runtests.py
Jan Pokorný b4585a
VERBOSE=1 make check
Jan Pokorný b4585a
Jan Pokorný b4585a
%files          core
Jan Pokorný b4585a
%license COPYING
Jan Pokorný b4585a
%doc %{_pkgdocdir}/AUTHORS
Jan Pokorný b4585a
%doc %{_pkgdocdir}/ChangeLog
Jan Pokorný b4585a
%doc %{_pkgdocdir}/README
Jan Pokorný b4585a
%doc %{_pkgdocdir}/booth.conf.example
Jan Pokorný b4585a
# core command(s) + man pages
Jan Pokorný b4585a
%{_sbindir}/booth*
Jan Pokorný b4585a
%{_mandir}/man8/booth*.8*
Jan Pokorný b4585a
# configuration
Jan Pokorný b4585a
%dir %{_sysconfdir}/booth
Jan Pokorný b4585a
%exclude %{_sysconfdir}/booth/booth.conf.example
Jan Pokorný b4585a
Jan Pokorný b4585a
%files          arbitrator
Jan Pokorný b4585a
%{_unitdir}/booth@.service
Jan Pokorný b4585a
%{_unitdir}/booth-arbitrator.service
Jan Pokorný b4585a
Jan Pokorný b4585a
%files          site
Jan Pokorný b4585a
# OCF (agent + a helper)
Jan Pokorný b4585a
## /usr/lib/ocf/resource.d/pacemaker provided by pacemaker
Jan Pokorný b4585a
/usr/lib/ocf/resource.d/pacemaker/booth-site
Jan Pokorný b4585a
%dir /usr/lib/ocf/lib/booth
Jan Pokorný b4585a
     /usr/lib/ocf/lib/booth/geo_attr.sh
Jan Pokorný b4585a
# geostore (command + OCF agent)
Jan Pokorný b4585a
%{_sbindir}/geostore
Jan Pokorný b4585a
%{_mandir}/man8/geostore.8*
Jan Pokorný b4585a
## /usr/lib/ocf/resource.d provided by resource-agents
Jan Pokorný b4585a
%dir /usr/lib/ocf/resource.d/booth
Jan Pokorný b4585a
     /usr/lib/ocf/resource.d/booth/geostore
Jan Pokorný b4585a
# helper (possibly used in the configuration hook)
Jan Pokorný b4585a
%dir %{_datadir}/booth
Jan Pokorný b4585a
     %{_datadir}/booth/service-runnable
Jan Pokorný b4585a
Jan Pokorný b4585a
%files          test
Jan Pokorný b4585a
%doc %{_pkgdocdir}/README-testing
Jan Pokorný b4585a
# /usr/share/booth provided by -site
Jan Pokorný b4585a
%{test_path}
Jan Pokorný b4585a
# /usr/lib/ocf/resource.d/booth provided by -site
Jan Pokorný b4585a
/usr/lib/ocf/resource.d/booth/sharedrsc
Jan Pokorný b4585a
Jan Pokorný b4585a
%changelog
Fedora Release Engineering b56849
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2.570876d.git.1
Fedora Release Engineering b56849
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
Fedora Release Engineering b56849
Jan Pokorný 0c140f
* Wed May 25 2016 Jan Pokorný <jpokorny+rpm-booth@fedoraproject.org> - 1.0-3.570876d.git
Jan Pokorný 0c140f
- update per the changesets recently accepted by the upstream
Jan Pokorný 0c140f
  (memory/resource leaks fixes, patches previously attached separately
Jan Pokorný 0c140f
  that make unit test pass, internal cleanups, etc.)
Jan Pokorný 0c140f
Jan Pokorný b4585a
* Thu May 05 2016 Jan Pokorný <jpokorny+rpm-booth@fedoraproject.org> - 1.0-2.eb4256a.git
Jan Pokorný b4585a
- update a subset of out-of-tree patches per
Jan Pokorný b4585a
  https://github.com/ClusterLabs/booth/pull/22#issuecomment-216936987
Jan Pokorný b4585a
- pre-inclusion cleanups in the spec (apply systemd scriptlet operations
Jan Pokorný b4585a
  with booth-arbitrator, avoid overloading file implicitly considered %%doc
Jan Pokorný b4585a
  as %%license)
Jan Pokorný b4585a
  Resolves: rhbz#1314865
Jan Pokorný b4585a
  Related: rhbz#1333509
Jan Pokorný b4585a
Jan Pokorný b4585a
* Thu Apr 28 2016 Jan Pokorný <jpokorny+rpm-booth@fedoraproject.org> - 1.0-1.eb4256a.git
Jan Pokorný b4585a
- initial build