diff --git a/.gitignore b/.gitignore index ae14955116..05827628a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,219 +1,229 @@ # Common \#* .\#* GPATH GRTAGS GTAGS TAGS Makefile Makefile.in .deps .dirstamp .libs *.pc *.pyc *.bz2 *.tar.gz *.tgz -*.rpm *.la *.lo *.o *~ *.gcda *.gcno # Autobuild aclocal.m4 autoconf autoheader autom4te.cache/ automake build.counter compile +/confdefs.h config.guess config.log config.status config.sub configure +/conftest* depcomp install-sh include/stamp-* libtool libtool.m4 ltdl.m4 libltdl ltmain.sh missing py-compile /m4/argz.m4 /m4/ltargz.m4 /m4/ltoptions.m4 /m4/ltsugar.m4 /m4/ltversion.m4 /m4/lt~obsolete.m4 test-driver ylwrap # Configure targets /cts/CTS.py /cts/CTSlab.py /cts/CTSvars.py /cts/LSBDummy /cts/OCFIPraTest.py /cts/benchmark/clubench /cts/cluster_test /cts/cts /cts/cts-cli /cts/cts-coverage /cts/cts-exec /cts/cts-fencing /cts/cts-log-watcher /cts/cts-regression /cts/cts-scheduler /cts/cts-support /cts/fence_dummy /cts/lxc_autogen.sh /cts/pacemaker-cts-dummyd /cts/pacemaker-cts-dummyd@.service /daemons/execd/pacemaker_remote /daemons/execd/pacemaker_remote.service /daemons/fenced/fence_legacy /daemons/pacemakerd/pacemaker /daemons/pacemakerd/pacemaker.combined.upstart /daemons/pacemakerd/pacemaker.service /daemons/pacemakerd/pacemaker.upstart /doc/Doxyfile /extra/logrotate/pacemaker /extra/resources/ClusterMon /extra/resources/HealthSMART /extra/resources/SysInfo /extra/resources/ifspeed /extra/resources/o2cb include/config.h include/config.h.in include/crm_config.h publican.cfg /tools/cibsecret /tools/crm_error /tools/crm_failcount /tools/crm_master /tools/crm_mon.service /tools/crm_mon.upstart /tools/crm_report /tools/crm_rule /tools/crm_standby /tools/report.collector /tools/report.common # Build targets *.7 *.7.xml *.7.html *.8 *.8.xml *.8.html /daemons/attrd/pacemaker-attrd /daemons/based/pacemaker-based /daemons/based/cibmon /daemons/controld/pacemaker-controld /daemons/execd/cts-exec-helper /daemons/execd/pacemaker-execd /daemons/execd/pacemaker-remoted /daemons/fenced/cts-fence-helper /daemons/fenced/pacemaker-fenced /daemons/fenced/pacemaker-fenced.xml /daemons/pacemakerd/pacemakerd /daemons/schedulerd/pacemaker-schedulerd /daemons/schedulerd/pacemaker-schedulerd.xml /doc/*/tmp/** /doc/*/publish /doc/*.build /doc/*/en-US/Ap-*.xml /doc/*/en-US/Ch-*.xml /doc/.ABI-build /doc/HTML /doc/abi_dumps /doc/abi-check /doc/acls.html /doc/api/* /doc/compat_reports /doc/crm_fencing.html /doc/publican-catalog* /doc/shared/en-US/*.xml /doc/shared/en-US/images/pcmk-*.png /doc/shared/en-US/images/Policy-Engine-*.png +/lib/common/md5.c /maint/testcc /maint/mocked/based scratch /tools/attrd_updater /tools/cibadmin /tools/crmadmin /tools/crm_attribute /tools/crm_diff /tools/crm_mon /tools/crm_node /tools/crm_resource /tools/crm_shadow /tools/crm_simulate /tools/crm_ticket /tools/crm_verify /tools/iso8601 /tools/stonith_admin xml/crm.dtd xml/pacemaker*.rng xml/versions.rng xml/api/api-result*.rng lib/gnu/libgnu.a lib/gnu/stdalign.h *.coverity +# Packager artifacts +*.rpm +/mock +/pacemaker.spec +/rpm/[A-Z]* + +# make dist/export working directory +pacemaker-[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9] + # Test detritus /cts/.regression.failed.diff /cts/scheduler/*.ref /cts/scheduler/*.up /cts/scheduler/*.up.err /cts/scheduler/bug-rh-1097457.log /cts/scheduler/bug-rh-1097457.trs /cts/scheduler/shadow.* /cts/test-suite.log /xml/test-*/*.up /xml/test-*/*.up.err /xml/assets/*.rng /xml/assets/diffview.js /xml/assets/xmlcatalog # Release maintenance detritus /maint/gnulib # Formerly built files (helps when jumping back and forth in checkout) /.ABI-build /Doxyfile /HTML /abi_dumps /abi-check /compat_reports /attrd /cib /coverage.sh /crmd /cts/HBDummy /doc/Clusters_from_Scratch.txt /doc/Pacemaker_Explained.txt /fencing /lrmd /mcp +/pacemaker-*.spec /pengine #Other -mock -pacemaker*.spec coverity-* logs *.patch *.diff *.sed *.orig *.rej *.swp diff --git a/GNUmakefile b/GNUmakefile index a1c36dfd36..8f1049a620 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,395 +1,417 @@ # # Copyright 2008-2019 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # -default: $(shell test ! -e configure && echo init) $(shell test -e configure && echo core) +default: build +.PHONY: default -include Makefile +# The main purpose of this GNUmakefile is that its targets can be invoked +# without having to call autogen.sh and configure first. That means automake +# variables may or may not be defined. Here, we use the current working +# directory if a relevant variable hasn't been defined. +# +# The idea is to keep generated artifacts in the build tree, in case a VPATH +# build is in use, but in practice it would be difficult to make the targets +# here usable from a different location than the source tree. +abs_srcdir ?= $(shell pwd) +abs_builddir ?= $(shell pwd) + PACKAGE ?= pacemaker -# Force 'make dist' to be consistent with 'make export' -distdir = $(PACKAGE)-$(TAG) -TARFILE = $(PACKAGE)-$(SHORTTAG).tar.gz -DIST_ARCHIVES = $(TARFILE) - -RPM_ROOT = $(shell pwd) -RPM_OPTS = --define "_sourcedir $(RPM_ROOT)" \ - --define "_specdir $(RPM_ROOT)" \ - --define "_srcrpmdir $(RPM_ROOT)" \ - -MOCK_OPTIONS ?= --resultdir=$(RPM_ROOT)/mock --no-cleanup-after - -# Default to building Fedora-compliant spec files -# SLES: /etc/SuSE-release -# openSUSE: /etc/SuSE-release -# RHEL: /etc/redhat-release, /etc/system-release -# Fedora: /etc/fedora-release, /etc/redhat-release, /etc/system-release -# CentOS: /etc/centos-release, /etc/redhat-release, /etc/system-release -F ?= $(shell test ! -e /etc/fedora-release && echo 0; test -e /etc/fedora-release && rpm --eval %{fedora}) -ARCH ?= $(shell test -e /etc/fedora-release && rpm --eval %{_arch}) -MOCK_CFG ?= $(shell test -e /etc/fedora-release && echo fedora-$(F)-$(ARCH)) -DISTRO ?= $(shell test -e /etc/SuSE-release && echo suse; echo fedora) + +# Definitions that specify what various targets will apply to + COMMIT ?= HEAD TAG ?= $(shell T=$$(git describe --all '$(COMMIT)' 2>/dev/null | sed -n 's|tags/\(.*\)|\1|p'); \ test -n "$${T}" && echo "$${T}" \ || git log --pretty=format:%H -n 1 '$(COMMIT)' 2>/dev/null || echo DIST) lparen = ( rparen = ) SHORTTAG ?= $(shell case $(TAG) in Pacemaker-*|DIST$(rparen) echo '$(TAG)' | cut -c11-;; \ *$(rparen) git log --pretty=format:%h -n 1 '$(TAG)';; esac) SHORTTAG_ABBREV = $(shell printf %s '$(SHORTTAG)' | wc -c) -WITH ?= --without doc -#WITH ?= --without=doc --with=gcov LAST_RC ?= $(shell test -e /Volumes || git tag -l | grep Pacemaker | sort -Vr | grep rc | head -n 1) ifneq ($(origin VERSION), undefined) LAST_RELEASE ?= Pacemaker-$(VERSION) else LAST_RELEASE ?= $(shell git tag -l | grep Pacemaker | sort -Vr | grep -v rc | head -n 1) endif NEXT_RELEASE ?= $(shell echo $(LAST_RELEASE) | awk -F. '/[0-9]+\./{$$3+=1;OFS=".";print $$1,$$2,$$3}') + +# This Makefile can create 2 types of distributions: +# +# - "make dist" is automake's native functionality, based on the various +# dist/nodist make variables; it always uses the current sources +# +# - "make export" is a custom target based on git archive and relevant entries +# from .gitattributes; it defaults to current sources but can use any git tag +# +# Both types use the TARFILE name for the result, though they generate +# different contents. +distdir = $(PACKAGE)-$(SHORTTAG) +TARFILE = $(abs_builddir)/$(PACKAGE)-$(SHORTTAG).tar.gz + +.PHONY: init +init: + test -e $(top_srcdir)/configure || ./autogen.sh + test -e $(abs_builddir)/Makefile || $(abs_builddir)/configure + +.PHONY: build +build: init + $(MAKE) $(AM_MAKEFLAGS) core + +export: + if [ ! -f "$(TARFILE)" ]; then \ + if [ $(TAG) = dirty ]; then \ + git commit -m "DO-NOT-PUSH" -a; \ + git archive --prefix=$(distdir)/ -o "$(TARFILE)" HEAD^{tree}; \ + git reset --mixed HEAD^; \ + else \ + git archive --prefix=$(distdir)/ -o "$(TARFILE)" $(TAG)^{tree}; \ + fi; \ + echo "`date`: Rebuilt $(TARFILE)"; \ + else \ + echo "`date`: Using existing tarball: $(TARFILE)"; \ + fi + +export-clean: + -rm -f $(abs_builddir)/$(PACKAGE)-*.tar.gz + +## RPM-related targets + +# Where to put RPM artifacts; possible values: +# +# - toplevel (default): RPM sources, spec, and source rpm in top-level build +# directory (everything else uses the usual defaults) +# +# - subtree: RPM sources (i.e. TARFILE) in top-level build directory, +# everything else in dedicated "rpmbuild" subdirectory of build tree +RPMDEST ?= toplevel + +RPM_SPEC_DIR_toplevel = $(abs_builddir) +RPM_SRCRPM_DIR_toplevel = $(abs_builddir) +RPM_OPTS_toplevel = --define "_sourcedir $(abs_builddir)" \ + --define "_specdir $(RPM_SPEC_DIR_toplevel)" \ + --define "_srcrpmdir $(RPM_SRCRPM_DIR_toplevel)" + +RPM_SPEC_DIR_subtree = $(abs_builddir)/rpm/SPECS +RPM_SRCRPM_DIR_subtree = $(abs_builddir)/rpm/SRPMS +RPM_OPTS_subtree = --define "_sourcedir $(abs_builddir)" \ + --define "_topdir $(abs_builddir)/rpm" + +RPM_SPEC_DIR = $(RPM_SPEC_DIR_$(RPMDEST)) +RPM_SRCRPM_DIR = $(RPM_SRCRPM_DIR_$(RPMDEST)) +RPM_OPTS = $(RPM_OPTS_$(RPMDEST)) + +WITH ?= --without doc BUILD_COUNTER ?= build.counter LAST_COUNT = $(shell test ! -e $(BUILD_COUNTER) && echo 0; test -e $(BUILD_COUNTER) && cat $(BUILD_COUNTER)) COUNT = $(shell expr 1 + $(LAST_COUNT)) - SPECVERSION ?= $(COUNT) +MOCK_DIR = $(abs_builddir)/mock +MOCK_OPTIONS ?= --resultdir=$(MOCK_DIR) --no-cleanup-after + +F ?= $(shell test ! -e /etc/fedora-release && echo 0; test -e /etc/fedora-release && rpm --eval %{fedora}) +ARCH ?= $(shell test ! -e /etc/fedora-release && uname -m; test -e /etc/fedora-release && rpm --eval %{_arch}) +MOCK_CFG ?= $(shell test -e /etc/fedora-release && echo fedora-$(F)-$(ARCH)) + # rpmbuild wrapper that translates "--with[out] FEATURE" into RPM macros # # Unfortunately, at least recent versions of rpm do not support mentioned # switch. To work this around, we can emulate mechanism that rpm uses # internally: unfold the flags into respective macro definitions: # # --with[out] FOO -> --define "_with[out]_FOO --with[out]-FOO" # # $(1) ... WITH string (e.g., --with pre_release --without doc) # $(2) ... options following the initial "rpmbuild" in the command # $(3) ... final arguments determined with $2 (e.g., pacemaker.spec) # # Note that if $(3) is a specfile, extra case is taken so as to reflect # pcmkversion correctly (using in-place modification). # # Also note that both ways to specify long option with an argument # (i.e., what getopt and, importantly, rpm itself support) can be used: # # --with FOO # --with=FOO rpmbuild-with = \ WITH=$$(getopt -o "" -l with:,without: -- $(1)) || exit 1; \ CMD='rpmbuild $(2)'; PREREL=0; \ eval set -- "$${WITH}"; \ while true; do \ case "$$1" in \ --with) CMD="$${CMD} --define \"_with_$$2 --with-$$2\""; \ [ "$$2" != pre_release ] || PREREL=1; shift 2;; \ --without) CMD="$${CMD} --define \"_without_$$2 --without-$$2\""; \ [ "$$2" != pre_release ] || PREREL=0; shift 2;; \ --) shift ; break ;; \ *) echo "cannot parse WITH: $$1"; exit 1;; \ esac; \ done; \ case "$(3)" in \ *.spec) { [ $${PREREL} -eq 0 ] || [ $(LAST_RELEASE) = $(TAG) ]; } \ && sed -i "s/^\(%global pcmkversion \).*/\1$$(echo $(LAST_RELEASE) | sed -e s:Pacemaker-:: -e s:-.*::)/" $(3) \ || sed -i "s/^\(%global pcmkversion \).*/\1$$(echo $(NEXT_RELEASE) | sed -e s:Pacemaker-:: -e s:-.*::)/" $(3);; \ esac; \ CMD="$${CMD} $(3)"; \ eval "$${CMD}" -init: - ./autogen.sh - -# @TODO This should probably be what init does -.PHONY: init-if-needed -init-if-needed: - test -e configure || ./autogen.sh - test -e Makefile || ./configure +$(RPM_SPEC_DIR)/$(PACKAGE).spec: rpm/pacemaker.spec.in + $(AM_V_at)$(MKDIR_P) $(RPM_SPEC_DIR) # might not exist in VPATH build + $(AM_V_GEN)if [ x != x"`git ls-files -m rpm/pacemaker.spec.in 2>/dev/null`" ]; then \ + cat $(abs_srcdir)/rpm/pacemaker.spec.in; \ + elif git cat-file -e $(TAG):rpm/pacemaker.spec.in 2>/dev/null; then \ + git show $(TAG):rpm/pacemaker.spec.in; \ + elif git cat-file -e $(TAG):pacemaker.spec.in 2>/dev/null; then \ + git show $(TAG):pacemaker.spec.in; \ + else \ + cat $(abs_srcdir)/rpm/pacemaker.spec.in; \ + fi | sed \ + -e 's/global\ specversion\ .*/global\ specversion\ $(SPECVERSION)/' \ + -e 's/global\ commit\ .*/global\ commit\ $(SHORTTAG)/' \ + -e 's/global\ commit_abbrev\ .*/global\ commit_abbrev\ $(SHORTTAG_ABBREV)/' \ + -e "s/PACKAGE_DATE/$$(date +'%a %b %d %Y')/" \ + -e "s/PACKAGE_VERSION/$$(git describe --tags $(TAG) | sed -e s:Pacemaker-:: -e s:-.*::)/" \ + > "$@" -export: - rm -f $(PACKAGE)-dirty.tar.* $(PACKAGE)-tip.tar.* $(PACKAGE)-HEAD.tar.* - if [ ! -f $(TARFILE) ]; then \ - rm -f $(PACKAGE).tar.*; \ - if [ $(TAG) = dirty ]; then \ - git commit -m "DO-NOT-PUSH" -a; \ - git archive --prefix=$(distdir)/ -o "$(TARFILE)" HEAD^{tree}; \ - git reset --mixed HEAD^; \ - else \ - git archive --prefix=$(distdir)/ -o "$(TARFILE)" $(TAG)^{tree}; \ - fi; \ - echo `date`: Rebuilt $(TARFILE); \ - else \ - echo `date`: Using existing tarball: $(TARFILE); \ - fi +.PHONY: $(PACKAGE).spec +$(PACKAGE).spec: $(RPM_SPEC_DIR)/$(PACKAGE).spec -$(PACKAGE)-opensuse.spec: $(PACKAGE)-suse.spec - cp $^ $@ - @echo Rebuilt $@ - -$(PACKAGE)-suse.spec: $(PACKAGE).spec.in GNUmakefile - rm -f $@ - if [ x != x"`git ls-files -m | grep pacemaker.spec.in`" ]; then \ - cp $(PACKAGE).spec.in $@; \ - echo "Rebuilt $@ (local modifications)"; \ - elif [ x = x"`git show $(TAG):pacemaker.spec.in 2>/dev/null`" ]; then \ - cp $(PACKAGE).spec.in $@; \ - echo "Rebuilt $@"; \ - else \ - git show $(TAG):$(PACKAGE).spec.in >> $@; \ - echo "Rebuilt $@ from $(TAG)"; \ - fi - sed -i \ - -e 's:%{_docdir}/%{name}:%{_docdir}/%{name}-%{version}:g' \ - -e 's:%{name}-libs:lib%{name}3:g' \ - -e 's: libtool-ltdl-devel\(%{?_isa}\)\?::g' \ - -e 's:bzip2-devel:libbz2-devel:g' \ - -e 's:docbook-style-xsl:docbook-xsl-stylesheets:g' \ - -e 's: byacc::g' \ - -e 's:gnutls-devel:libgnutls-devel:g' \ - -e 's:corosynclib:libcorosync:g' \ - -e 's:cluster-glue-libs:libglue:g' \ - -e 's:shadow-utils:shadow:g' \ - -e 's: publican::g' \ - -e 's: 189: 90:g' \ - -e 's:%{_libexecdir}/lcrso:%{_libdir}/lcrso:g' \ - -e 's:procps-ng:procps:g' \ - $@ - @echo "Applied SUSE-specific modifications" - - -# Works for all fedora based distros -$(PACKAGE)-%.spec: $(PACKAGE).spec.in - rm -f $@ - if [ x != x"`git ls-files -m | grep pacemaker.spec.in`" ]; then \ - cp $(PACKAGE).spec.in $(PACKAGE)-$*.spec; \ - echo "Rebuilt $@ (local modifications)"; \ - elif [ x = x"`git show $(TAG):pacemaker.spec.in 2>/dev/null`" ]; then \ - cp $(PACKAGE).spec.in $(PACKAGE)-$*.spec; \ - echo "Rebuilt $@"; \ - else \ - git show $(TAG):$(PACKAGE).spec.in >> $(PACKAGE)-$*.spec; \ - echo "Rebuilt $@ from $(TAG)"; \ - fi +.PHONY: spec-clean +spec-clean: + -rm -f $(RPM_SPEC_DIR)/$(PACKAGE).spec -srpm-%: export $(PACKAGE)-%.spec - rm -f *.src.rpm - cp $(PACKAGE)-$*.spec $(PACKAGE).spec - echo "* $(shell date +"%a %b %d %Y") Andrew Beekhof $(shell git describe --tags $(TAG) | sed -e s:Pacemaker-:: -e s:-.*::)-1" >> $(PACKAGE).spec - echo " - See included ChangeLog file or https://raw.github.com/ClusterLabs/pacemaker/master/ChangeLog for full details" >> $(PACKAGE).spec +.PHONY: srpm +srpm: export srpm-clean $(RPM_SPEC_DIR)/$(PACKAGE).spec if [ -e $(BUILD_COUNTER) ]; then \ echo $(COUNT) > $(BUILD_COUNTER); \ fi - sed -e 's/global\ specversion\ .*/global\ specversion\ $(SPECVERSION)/' \ - -e 's/global\ commit\ .*/global\ commit\ $(TAG)/' \ - -e 's/global\ commit_abbrev\ .*/global\ commit_abbrev\ $(SHORTTAG_ABBREV)/' \ - -i $(PACKAGE).spec - $(call rpmbuild-with,$(WITH),-bs --define "dist .$*" $(RPM_OPTS),$(PACKAGE).spec) + $(call rpmbuild-with,$(WITH),-bs $(RPM_OPTS),$(RPM_SPEC_DIR)/$(PACKAGE).spec) + +.PHONY: srpm-clean +srpm-clean: + -rm -f $(RPM_SRCRPM_DIR)/*.src.rpm +.PHONY: chroot chroot: mock-$(MOCK_CFG) mock-install-$(MOCK_CFG) mock-sh-$(MOCK_CFG) @echo "Done" +.PHONY: mock-next mock-next: - make F=$(shell expr 1 + $(F)) mock + $(MAKE) $(AM_MAKEFLAGS) F=$(shell expr 1 + $(F)) mock +.PHONY: mock-rawhide mock-rawhide: - make F=rawhide mock + $(MAKE) $(AM_MAKEFLAGS) F=rawhide mock mock-install-%: @echo "Installing packages" - mock --root=$* $(MOCK_OPTIONS) --install $(RPM_ROOT)/mock/*.rpm vi sudo valgrind lcov gdb fence-agents psmisc + mock --root=$* $(MOCK_OPTIONS) --install $(MOCK_DIR)/*.rpm \ + vi sudo valgrind lcov gdb fence-agents psmisc +.PHONY: mock-install mock-install: mock-install-$(MOCK_CFG) @echo "Done" +.PHONY: mock-sh mock-sh: mock-sh-$(MOCK_CFG) @echo "Done" mock-sh-%: @echo "Connecting" mock --root=$* $(MOCK_OPTIONS) --shell @echo "Done" -# eg. make WITH="--with pre_release" rpm -mock-%: - make srpm-$(firstword $(shell echo $(@:mock-%=%) | tr '-' ' ')) - -rm -rf $(RPM_ROOT)/mock - @echo "mock --root=$* --rebuild $(WITH) $(MOCK_OPTIONS) $(RPM_ROOT)/*.src.rpm" - mock --root=$* --no-cleanup-after --rebuild $(WITH) $(MOCK_OPTIONS) $(RPM_ROOT)/*.src.rpm - -srpm: srpm-$(DISTRO) - @echo "Done" +mock-%: srpm mock-clean + mock $(MOCK_OPTIONS) --root=$* --no-cleanup-after --rebuild \ + $(WITH) $(RPM_SRCRPM_DIR)/*.src.rpm +.PHONY: mock mock: mock-$(MOCK_CFG) @echo "Done" -rpm-dep: $(PACKAGE)-$(DISTRO).spec - if [ x != x`which yum-builddep 2>/dev/null` ]; then \ - echo "Installing with yum-builddep"; \ - sudo yum-builddep $(PACKAGE)-$(DISTRO).spec; \ - elif [ x != x`which yum 2>/dev/null` ]; then \ - echo -e "Installing: $(shell grep BuildRequires pacemaker.spec.in | sed -e s/BuildRequires:// -e s:\>.*0:: | tr '\n' ' ')\n\n"; \ - sudo yum install $(shell grep BuildRequires pacemaker.spec.in | sed -e s/BuildRequires:// -e s:\>.*0:: | tr '\n' ' '); \ - elif [ x != x`which zypper` ]; then \ - echo -e "Installing: $(shell grep BuildRequires pacemaker.spec.in | sed -e s/BuildRequires:// -e s:\>.*0:: | tr '\n' ' ')\n\n"; \ - sudo zypper install $(shell grep BuildRequires pacemaker.spec.in | sed -e s/BuildRequires:// -e s:\>.*0:: | tr '\n' ' ');\ - else \ - echo "I don't know how to install $(shell grep BuildRequires pacemaker.spec.in | sed -e s/BuildRequires:// -e s:\>.*0:: | tr '\n' ' ')";\ - fi +.PHONY: dirty +dirty: + $(MAKE) $(AM_MAKEFLAGS) TAG=dirty mock + +.PHONY: mock-clean +mock-clean: + -rm -rf $(MOCK_DIR) +.PHONY: rpm-dep +rpm-dep: $(RPM_SPEC_DIR)/$(PACKAGE).spec + sudo yum-builddep $(PACKAGE).spec + +# e.g. make WITH="--with pre_release" rpm +.PHONY: rpm rpm: srpm @echo To create custom builds, edit the flags and options in $(PACKAGE).spec first - $(call rpmbuild-with,$(WITH),$(RPM_OPTS),--rebuild $(RPM_ROOT)/*.src.rpm) + $(call rpmbuild-with,$(WITH),$(RPM_OPTS),--rebuild $(RPM_SRCRPM_DIR)/*.src.rpm) + +.PHONY: rpmlint +rpmlint: $(RPM_SPEC_DIR)/$(PACKAGE).spec + rpmlint -f rpm/rpmlintrc "$<" +.PHONY: release release: - make TAG=$(LAST_RELEASE) rpm + $(MAKE) $(AM_MAKEFLAGS) TAG=$(LAST_RELEASE) rpm +.PHONY: rc rc: - make TAG=$(LAST_RC) rpm - -dirty: - make TAG=dirty mock + $(MAKE) $(AM_MAKEFLAGS) TAG=$(LAST_RC) rpm ## Static analysis via coverity # Aggressiveness (low, medium, or high) COVLEVEL ?= low # Generated outputs -COVERITY_DIR = $(builddir)/coverity-$(TAG) -COVTAR = $(builddir)/$(PACKAGE)-coverity-$(TAG).tgz -COVEMACS = $(builddir)/$(TAG).coverity +COVERITY_DIR = $(abs_builddir)/coverity-$(TAG) +COVTAR = $(abs_builddir)/$(PACKAGE)-coverity-$(TAG).tgz +COVEMACS = $(abs_builddir)/$(TAG).coverity COVHTML = $(COVERITY_DIR)/output/errors # Coverity outputs are phony so they get rebuilt every invocation .PHONY: $(COVERITY_DIR) -$(COVERITY_DIR): init-if-needed core-clean coverity-clean +$(COVERITY_DIR): init core-clean coverity-clean $(AM_V_GEN)cov-build --dir "$@" $(MAKE) $(AM_MAKEFLAGS) core # Public coverity instance .PHONY: $(COVTAR) $(COVTAR): $(COVERITY_DIR) $(AM_V_GEN)tar czf "$@" --transform="s@.*$(TAG)@cov-int@" "$<" .PHONY: coverity coverity: $(COVTAR) @echo "Now go to https://scan.coverity.com/users/sign_in and upload:" @echo " $(COVTAR)" @echo "then make core-clean coverity-clean" # Licensed coverity instance # # The prerequisites are a little hacky; rather than actually required, some # of them are designed so that things execute in the proper order (which is # not the same as GNU make's order-only prerequisites). .PHONY: coverity-analyze coverity-analyze: $(COVERITY_DIR) @echo "" @echo "Analyzing (waiting for coverity license if necessary) ..." cov-analyze --dir "$<" --wait-for-license --security \ --aggressiveness-level "$(COVLEVEL)" .PHONY: $(COVEMACS) $(COVEMACS): coverity-analyze $(AM_V_GEN)cov-format-errors --dir "$(COVERITY_DIR)" --emacs-style > "$@" .PHONY: $(COVHTML) $(COVHTML): $(COVEMACS) $(AM_V_GEN)cov-format-errors --dir "$(COVERITY_DIR)" --html-output "$@" .PHONY: coverity-corp coverity-corp: $(COVHTML) $(MAKE) $(AM_MAKEFLAGS) core-clean @echo "Done. See:" @echo " file://$(abs_builddir)/$(COVHTML)/index.html" @echo "When no longer needed, make coverity-clean" # Remove all outputs regardless of tag .PHONY: coverity-clean coverity-clean: - -rm -rf "$(builddir)"/coverity-* \ - "$(builddir)"/$(PACKAGE)-coverity-*.tgz \ - "$(builddir)"/*.coverity + -rm -rf "$(abs_builddir)"/coverity-* \ + "$(abs_builddir)"/$(PACKAGE)-coverity-*.tgz \ + "$(abs_builddir)"/*.coverity ## Change log generation summary: - @printf "\n* `date +"%a %b %d %Y"` `git config user.name` <`git config user.email`> $(NEXT_RELEASE)-1" + @printf "\n* `date +"%a %b %d %Y"` `git config user.name` <`git config user.email`> $(NEXT_RELEASE)" @printf "\n- Changesets: `git log --pretty=oneline $(LAST_RELEASE)..HEAD | wc -l`" @printf "\n- Diff: " @git diff $(LAST_RELEASE)..HEAD --shortstat include lib daemons tools xml rc-changes: - @make NEXT_RELEASE=$(shell echo $(LAST_RC) | sed s:-rc.*::) LAST_RELEASE=$(LAST_RC) changes + @$(MAKE) $(AM_MAKEFLAGS) NEXT_RELEASE=$(shell echo $(LAST_RC) | sed s:-rc.*::) LAST_RELEASE=$(LAST_RC) changes changes: summary @printf "\n- Features added since $(LAST_RELEASE)\n" @git log --pretty=format:' +%s' --abbrev-commit $(LAST_RELEASE)..HEAD | grep -e Feature: | sed -e 's@Feature:@@' | sort -uf @printf "\n- Changes since $(LAST_RELEASE)\n" @git log --pretty=format:' +%s' --no-merges --abbrev-commit $(LAST_RELEASE)..HEAD \ | grep -e High: -e Fix: -e Bug | sed \ -e 's@\(Fix\|High\|Bug\):@@' \ -e 's@\(cib\|pacemaker-based\|based\):@CIB:@' \ -e 's@\(crmd\|pacemaker-controld\|controld\):@controller:@' \ -e 's@\(lrmd\|pacemaker-execd\|execd\):@executor:@' \ -e 's@\(Fencing\|stonithd\|stonith\|pacemaker-fenced\|fenced\):@fencing:@' \ -e 's@\(PE\|pengine\|pacemaker-schedulerd\|schedulerd\):@scheduler:@' \ | sort -uf authors: git log $(LAST_RELEASE)..$(COMMIT) --format='%an' | sort -u changelog: - @make changes > ChangeLog + @$(MAKE) $(AM_MAKEFLAGS) changes > ChangeLog @printf "\n">> ChangeLog git show $(LAST_RELEASE):ChangeLog >> ChangeLog DO_NOT_INDENT = lib/gnu daemons/controld/controld_fsa.h indent: find . -name "*.[ch]" -exec ./p-indent \{\} \; git co HEAD $(DO_NOT_INDENT) rel-tags: tags find . -name TAGS -exec sed -i 's:\(.*\)/\(.*\)/TAGS:\2/TAGS:g' \{\} \; CLANG_analyzer = $(shell which scan-build) CLANG_checkers = # Use CPPCHECK_ARGS to pass extra cppcheck options, e.g.: # --enable={warning,style,performance,portability,information,all} # --inconclusive --std=posix CPPCHECK_ARGS ?= cppcheck: cppcheck $(CPPCHECK_ARGS) -I include --max-configs=25 -q replace lib daemons tools clang: test -e $(CLANG_analyzer) - scan-build $(CLANG_checkers:%=-enable-checker %) make clean all + scan-build $(CLANG_checkers:%=-enable-checker %) $(MAKE) $(AM_MAKEFLAGS) clean all # V3 = scandir unsetenv alphasort xalloc # V2 = setenv strerror strchrnul strndup # https://www.gnu.org/software/gnulib/manual/html_node/Initial-import.html#Initial-import # previously, this was crypto/md5, but got spoiled with streams/kernel crypto GNU_MODS = crypto/md5-buffer # stdint appears to be surrogate only for C99-lacking environments GNU_MODS_AVOID = stdint # only for plain crypto/md5: we make do without kernel-assisted crypto # GNU_MODS_AVOID += crypto/af_alg gnulib-update: -test -e maint/gnulib \ || git clone https://git.savannah.gnu.org/git/gnulib.git maint/gnulib cd maint/gnulib && git pull maint/gnulib/gnulib-tool \ --source-base=lib/gnu --lgpl=2 --no-vc-files --no-conditional-dependencies \ $(GNU_MODS_AVOID:%=--avoid %) --import $(GNU_MODS) + +# The toplevel "clean" targets are generated from Makefile.am, not this file. +# We can't use autotools' CLEANFILES, clean-local, etc. here. Instead, we +# define this target, which Makefile.am can call from clean-local. +ancillary-clean: export-clean spec-clean srpm-clean mock-clean coverity-clean + -rm -f $(TARFILE) diff --git a/INSTALL.md b/INSTALL.md index 99d2cd368e..3bd68fdd5b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,69 +1,72 @@ # How to Install Pacemaker ## Build Dependencies | Version | Fedora-based | Suse-based | Debian-based | |:---------------:|:------------------:|:------------------:|:--------------:| | 1.11 or later | automake | automake | automake | | 2.64 or later | autoconf | autoconf | autoconf | | | libtool | libtool | libtool | | | libtool-ltdl-devel | | libltdl-dev | | | libuuid-devel | libuuid-devel | uuid-dev | | | pkgconfig | pkgconfig | pkg-config | | 2.16.0 or later | glib2-devel | glib2-devel | libglib2.0-dev | | | libxml2-devel | libxml2-devel | libxml2-dev | | | libxslt-devel | libxslt-devel | libxslt-dev | | | bzip2-devel | libbz2-devel | libbz2-dev | | | libqb-devel | libqb-devel | libqb-dev | -Also: Python 2.7 or Python 3.2 or later +Also: GNU make, and Python 2.7 or Python 3.2 or later ### Cluster Stack Dependencies *Only corosync is currently supported* | Version | Fedora-based | Suse-based | Debian-based | |:---------------:|:------------------:|:------------------:|:--------------:| | 2.0.0 or later | corosynclib | libcorosync | corosync | | 2.0.0 or later | corosynclib-devel | libcorosync-devel | | | | | | libcfg-dev | | | | | libcpg-dev | | | | | libcmap-dev | | | | | libquorum-dev | ### Optional Build Dependencies | Feature Enabled | Version | Fedora-based | Suse-based | Debian-based | |:-----------------------------------------------:|:--------------:|:-----------------------:|:-----------------------:|:-----------------------:| | Pacemaker Remote and encrypted remote CIB admin | 2.1.7 or later | gnutls-devel | libgnutls-devel | libgnutls-dev | | encrypted remote CIB admin | | pam-devel | pam-devel | libpam0g-dev | | interactive crm_mon | | ncurses-devel | ncurses-devel | ncurses-dev | | systemd support | | systemd-devel | systemd-devel | libsystemd-dev | | systemd/upstart resource support | | dbus-devel | dbus-devel | libdbus-1-dev | | Linux-HA style fencing agents | | cluster-glue-libs-devel | libglue-devel | cluster-glue-dev | | documentation | | asciidoc or asciidoctor | asciidoc or asciidoctor | asciidoc or asciidoctor | | documentation | | help2man | help2man | help2man | | documentation | | publican | | publican | | documentation | | inkscape | inkscape | inkscape | | documentation | | docbook-style-xsl | docbook-xsl-stylesheets | docbook-xsl | ## Optional testing dependencies * valgrind (if running CTS valgrind tests) * systemd-python (if using CTS on cluster nodes running systemd) * rsync (if running CTS container tests) * libvirt-daemon-driver-lxc (if running CTS container tests) * libvirt-daemon-lxc (if running CTS container tests) * libvirt-login-shell (if running CTS container tests) -## Source Control (GIT) +## Simple install - git clone git://github.com/ClusterLabs/pacemaker.git + $ make && sudo make install -[See Github](https://github.com/ClusterLabs/pacemaker) +If GNU make is not your default make, use "gmake" instead. -## Installing from source +## Detailed install + +First, browse the build options that are available: $ ./autogen.sh - $ ./configure - $ make - $ sudo make install + $ ./configure --help + +Re-run ./configure with any options you want, then proceed with the simple +method. diff --git a/Makefile.am b/Makefile.am index de695c0825..c7e095e502 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,96 +1,110 @@ # # Copyright 2003-2019 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # EXTRA_DIST = CONTRIBUTING.md \ GNUmakefile \ INSTALL.md \ README.markdown \ autogen.sh \ - pacemaker.spec.in \ - rpmlintrc \ m4/gnulib-cache.m4 \ - m4/gnulib-tool.m4 - -MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure DRF/config-h.in \ - DRF/stamp-h.in libtool.m4 ltdl.m4 + m4/gnulib-tool.m4 \ + rpm/rpmlintrc \ + rpm/pacemaker.spec.in + +DISTCLEANFILES = config.status + +MAINTAINERCLEANFILES = Makefile.in \ + aclocal.m4 \ + config.guess \ + config.sub \ + configure \ + depcomp \ + install-sh \ + ltmain.sh \ + missing \ + py-compile \ + test-driver # Disable building Publican documentation when doing "make distcheck", because # some of our book sources are in the source directory, while others are # dynamically generated in the build directory, and publican can't handle that. # # @TODO To support VPATH builds for Publican, we'd probably have to create # a separate subtree of the build directory to use as Publican's source # directory, and copy the static sources into it. AM_DISTCHECK_CONFIGURE_FLAGS = --with-brand="" # Only these will get installed with a plain "make install" CORE_INSTALL = replace include lib daemons tools xml # Only these will get built with a plain "make" or "make clean" CORE = $(CORE_INSTALL) cts SUBDIRS = $(CORE) doc extra maint AM_CPPFLAGS = -I$(top_srcdir)/include doc_DATA = README.markdown COPYING licensedir = $(docdir)/licenses/ dist_license_DATA = $(wildcard licenses/*) # Scratch file for ad-hoc testing noinst_PROGRAMS = scratch nodist_scratch_SOURCES = scratch.c scratch_LDADD = $(top_builddir)/lib/common/libcrmcommon.la -lm scratch.c: echo 'int main(void){}' >$@ core: @echo "Building only core components and tests: $(CORE)" @for subdir in $(CORE); do \ echo "Building $$subdir"; \ - $(MAKE) -C $$subdir all || exit 1; \ + $(MAKE) $(AM_MAKEFLAGS) -C $$subdir all || exit 1; \ done core-install: @echo "Installing only core components: $(CORE_INSTALL)" @for subdir in $(CORE_INSTALL); do \ echo "Installing $$subdir"; \ - $(MAKE) -C $$subdir install || exit 1; \ + $(MAKE) $(AM_MAKEFLAGS) -C $$subdir install || exit 1; \ done core-clean: @echo "Cleaning only core components and tests: $(CORE)" @for subdir in $(CORE); do \ echo "Cleaning $$subdir"; \ - $(MAKE) -C $$subdir clean || exit 1; \ + $(MAKE) $(AM_MAKEFLAGS) -C $$subdir clean || exit 1; \ done install-exec-local: $(INSTALL) -d $(DESTDIR)/$(LCRSODIR) $(INSTALL) -d -m 750 $(DESTDIR)/$(PACEMAKER_CONFIG_DIR) $(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_CONFIG_DIR) $(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_CORE_DIR) $(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_BLACKBOX_DIR) $(INSTALL) -d -m 770 $(DESTDIR)/$(CRM_LOG_DIR) $(INSTALL) -d -m 770 $(DESTDIR)/$(CRM_BUNDLE_DIR) -chgrp $(CRM_DAEMON_GROUP) $(DESTDIR)/$(PACEMAKER_CONFIG_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_CONFIG_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_CORE_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_BLACKBOX_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_LOG_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_BUNDLE_DIR) # Use chown because the user/group may not exist clean-generic: - rm -f $(TARFILE) *.tar.bz2 *.sed + -rm -f *.tar.bz2 *.sed + +clean-local: + $(MAKE) $(AM_MAKEFLAGS) ancillary-clean -dist-clean-local: - rm -f autoconf automake autoheader +distclean-local: + -rm -rf libltdl autom4te.cache diff --git a/README.markdown b/README.markdown index e93679ef46..2ae7ae6326 100644 --- a/README.markdown +++ b/README.markdown @@ -1,67 +1,76 @@ # Pacemaker ## What is Pacemaker? Pacemaker is an advanced, scalable high-availability cluster resource manager. It supports "N-node" clusters with significant capabilities for managing resources and dependencies. It will run scripts at initialization, when machines go up or down, when related resources fail and can be configured to periodically check resource health. ## Who is Pacemaker? Pacemaker is distributed by [ClusterLabs](http://www.clusterlabs.org). Pacemaker was initially created by main architect and lead developer Andrew Beekhof , with the aid of project catalyst and advocate Lars Marowsky-Brée . Many, many developers have contributed significantly to the project since. The git log is the definitive record of their greatly appreciated contributions. The wider community of Pacemaker users is another essential aspect of the project's existence, especially the many users who participate in the mailing lists, blog about HA clustering, and otherwise actively make the project more useful. +## Where do I get Pacemaker? + +Pacemaker source code is distributed via +[Github](https://github.com/ClusterLabs/pacemaker). + +From there, you can clone or download the repository to get the latest +development code, or download one of the official +[releases](https://github.com/ClusterLabs/pacemaker/releases). + ## How do I install Pacemaker? See [INSTALL.md](https://github.com/ClusterLabs/pacemaker/blob/master/INSTALL.md). ## What higher-level interfaces to Pacemaker are available? There are multiple user interfaces for Pacemaker, including command-line tools, graphical user interfaces and web frontends. The crm shell used to be included in the Pacemaker source tree, but is now a separate project. This is not an exhaustive list: * crmsh: https://github.com/ClusterLabs/crmsh * pcs: https://github.com/ClusterLabs/pcs * LCMC: http://lcmc.sourceforge.net/ * hawk: https://github.com/ClusterLabs/hawk * Striker: https://github.com/ClusterLabs/striker ### Can I convert some other cluster configuration to Pacemaker? [clufter](https://github.com/jnpkrn/clufter) is a general-purpose tool for converting one cluster representation format to another. Among other possibilities, it can convert from a cluster based on rgmanager with CMAN to a one based on pacemaker with corosync. See its documentation for details. ## How can I help? See [CONTRIBUTING.md](https://github.com/ClusterLabs/pacemaker/blob/master/CONTRIBUTING.md). ## Where can I find more information about Pacemaker? * [ClusterLabs website](http://www.clusterlabs.org/) * [Documentation](http://www.clusterlabs.org/doc/) * [Issues/Bugs](http://bugs.clusterlabs.org/) * Mailing lists for [users](http://oss.clusterlabs.org/mailman/listinfo/users) and [developers](http://oss.clusterlabs.org/mailman/listinfo/developers) * #clusterlabs IRC channel on [freenode](http://freenode.net/) diff --git a/cts/Makefile.am b/cts/Makefile.am index 4b4fc3243f..79251379f0 100644 --- a/cts/Makefile.am +++ b/cts/Makefile.am @@ -1,100 +1,100 @@ # # Copyright 2001-2019 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # MAINTAINERCLEANFILES = Makefile.in noinst_SCRIPTS = cluster_test \ OCFIPraTest.py # Commands intended to be run only via other commands halibdir = $(CRM_DAEMON_DIR) dist_halib_SCRIPTS = cts-log-watcher \ cts-support # Test commands and globally applicable test files should be in $(testdir), # and command-specific test data should be in a command-specific subdirectory. testdir = $(datadir)/$(PACKAGE)/tests test_SCRIPTS = cts-cli \ cts-coverage \ cts-exec \ cts-fencing \ cts-regression \ cts-scheduler dist_test_DATA = README.md \ valgrind-pcmk.suppressions ctslibdir = $(pythondir)/cts ctslib_PYTHON = __init__.py \ CIB.py \ cib_xml.py \ CM_common.py \ CM_corosync.py \ CTSaudits.py \ CTSscenarios.py \ CTStests.py \ environment.py \ logging.py \ patterns.py \ remote.py \ watcher.py nodist_ctslib_PYTHON = CTS.py \ CTSvars.py ctsdir = $(testdir)/cts cts_DATA = pacemaker-cts-dummyd@.service if BUILD_UPSTART dist_cts_DATA = pacemaker-cts-dummyd.conf endif -dist_cts_SCRIPTS = cts cts_SCRIPTS = CTSlab.py \ + cts \ fence_dummy \ LSBDummy \ lxc_autogen.sh \ pacemaker-cts-dummyd clidir = $(testdir)/cli dist_cli_DATA = cli/crm_diff_new.xml \ cli/crm_diff_old.xml \ cli/regression.acls.exp \ cli/regression.dates.exp \ cli/regression.rules.exp \ cli/regression.tools.exp \ cli/regression.upgrade.exp \ cli/regression.validity.exp PE_TESTS = $(wildcard scheduler/*.scores) pedir = $(testdir)/scheduler dist_pe_DATA = $(PE_TESTS) \ $(PE_TESTS:%.scores=%.xml) \ $(PE_TESTS:%.scores=%.exp) \ $(PE_TESTS:%.scores=%.dot) \ $(PE_TESTS:%.scores=%.summary) \ $(wildcard scheduler/*.stderr) # For "make check", run a single scheduler test TESTS = scheduler/bug-rh-1097457.xml TEST_EXTENSIONS = .xml XML_LOG_COMPILER = ./cts-scheduler AM_XML_LOG_FLAGS = -V --run scheduler-list: @for T in "$(srcdir)"/scheduler/*.xml; do \ echo $$(basename $$T .xml); \ done clean-local: rm -f scheduler/*.pe.* SUBDIRS = benchmark cts-support-install: cts-support ./cts-support install cts-support-uninstall: cts-support ./cts-support uninstall diff --git a/doc/Makefile.am b/doc/Makefile.am index 9cdeb45240..257f5cdf56 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,438 +1,439 @@ # # Copyright 2003-2019 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # include $(top_srcdir)/Makefile.common # Deprecated plaintext documents (also dynamically converted to HTML) ascii = acls.txt \ crm_fencing.txt generated_docs = if BUILD_ASCIIDOC generated_docs += $(ascii:%.txt=%.html) endif # Current Publican/docbook-based documentation docbook = Clusters_from_Scratch \ Pacemaker_Administration \ Pacemaker_Development \ Pacemaker_Explained \ Pacemaker_Remote docbook_build = $(docbook:%=%.build) doc_DATA = $(ascii) $(generated_docs) noinst_SCRIPTS = abi-check EXTRA_DIST = $(ascii) $(SHARED_TXT) $(PNGS_ORIGINAL) $(DOTS) $(SVGS) EXTRA_DIST += $(CFS_TXT) $(CFS_XML_ONLY) EXTRA_DIST += $(PA_TXT) $(PA_XML_ONLY) EXTRA_DIST += $(PD_TXT) $(PD_XML_ONLY) EXTRA_DIST += $(PE_TXT) $(PE_XML_ONLY) EXTRA_DIST += $(PR_TXT) $(PR_XML_ONLY) EXTRA_DIST += pcs-crmsh-quick-ref.md # toplevel rsync destination for www targets (without trailing slash) RSYNC_DEST ?= root@www.clusterlabs.org:/var/www/html # recursive, preserve symlinks/permissions/times, verbose, compress, # don't cross filesystems, sparse, show progress RSYNC_OPTS = -rlptvzxS --progress LAST_RELEASE ?= Pacemaker-$(VERSION) TAG ?= $(shell git log --pretty=format:%H -n 1 HEAD) # What formats to build by default: pdf,html,html-single,html-desktop,epub DOCBOOK_FORMATS := html-desktop # What languages to build and upload to website by default # (currently only en-US because translations are out of date) DOCBOOK_LANGS := en-US # @TODO We could simplify this (and .gitignore) by establishing a convention # that original image source begins with an uppercase letter and generated # files with lowercase. # Scheduler transition graphs # @TODO Add original XML, and generate DOTs via crm_simulate DOTS = $(wildcard shared/en-US/images/*.dot) # Vector sources for images # @TODO Generate transition SVGs from DOTs via dot SVGS = $(wildcard shared/en-US/images/pcmk-*.svg) \ $(DOTS:%.dot=%.svg) # Final images (some originally in PNG, others generated from SVG) PNGS_ORIGINAL = Pacemaker_Remote/en-US/images/pcmk-ha-cluster-stack.png \ Pacemaker_Remote/en-US/images/pcmk-ha-remote-stack.png \ shared/en-US/images/Console.png \ shared/en-US/images/Editing-eth0.png \ shared/en-US/images/Installer.png \ shared/en-US/images/Network.png \ shared/en-US/images/Partitioning.png \ shared/en-US/images/Welcome.png \ shared/en-US/images/resource-set.png \ shared/en-US/images/three-sets.png \ shared/en-US/images/two-sets.png PNGS_GENERATED = $(SVGS:%.svg=%-small.png) \ $(SVGS:%.svg=%.png) \ $(SVGS:%.svg=%-large.png) PNGS = $(PNGS_ORIGINAL) $(PNGS_GENERATED) graphics: $(PNGS) %.png: %.svg $(AM_V_GEN)$(INKSCAPE) --file=$< --export-dpi=90 -C --export-png=$@ $(PCMK_quiet) %-small.png: %.svg $(AM_V_GEN)$(INKSCAPE) --file=$< --export-dpi=45 -C --export-png=$@ $(PCMK_quiet) %-large.png: %.svg $(AM_V_GEN)$(INKSCAPE) --file=$< --export-dpi=180 -C --export-png=$@ $(PCMK_quiet) if IS_ASCIIDOC ASCIIDOC_HTML_ARGS = --unsafe --backend=xhtml11 ASCIIDOC_DBOOK_ARGS = -b docbook -d book else ASCIIDOC_HTML_ARGS = --backend=html5 ASCIIDOC_DBOOK_ARGS = -b docbook45 -d book endif %.html: %.txt $(AM_V_GEN)$(ASCIIDOC_CONV) $(ASCIIDOC_HTML_ARGS) --out-file=$@ $< $(PCMK_quiet) # # Generate DocBook XML from asciidoc text. # # Build each chapter as a book (since the numbering isn't right for # articles and only books can have appendices) and then strip out the # bits we don't want or need. # # XXX Sequence of tr/sed commands should be replaced with a single XSLT # %.xml: %.txt $(AM_V_at)$(MKDIR_P) $(shell dirname $@) # might not exist in VPATH build $(AM_V_at)$(ASCIIDOC_CONV) $(ASCIIDOC_DBOOK_ARGS) -o - $< | tr -d '\036\r' >$@-t # Convert, fix line endings $(AM_V_at)sed -i 's/\ lang="en"//' $@-t # Never specify a language in the chapters $(AM_V_at)sed -i 's/simpara/para/g' $@-t # publican doesn't correctly render footnotes with simpara $(AM_V_at)sed -i 's/.*.*//g' $@-t # Remove dangling tag $(AM_V_at)sed -i 's/.*preface>//g' $@-t # Remove preface elements $(AM_V_at)sed -i 's:::g' $@-t # Remove empty title $(AM_V_at)sed -i 's/chapter/section/g' $@-t # Chapters become sections, so that books can become chapters $(AM_V_at)sed -i 's/<.*bookinfo.*>//g' $@-t # Strip out bookinfo, we don't need it $(AM_V_at)! grep -q "//;tb;bf;:b;N;s/.*.*<\/title>.*//;tb;/<appendix/{:i;n;/<\/appendix/{p;d};bi};bb;:f;p;d' \ $@-t # We just want the appendix tag (asciidoctor adds non-empty book-level title) $(AM_V_at)sed -i 's/book>/chapter>/g' $@-t # Rename to chapter (won't trigger if previous sed did) $(AM_V_GEN)mv $@-t $@ # publican-clusterlabs/xsl/{html,html-single,pdf}.xsl refer to URIs # requiring Internet access, hence we shadow that with a XML catalog-based # redirect to local files brought with Publican installation; # this is what newer Publican normally does with the system-wide catalog # upon its installation, but let's provide a compatibility for older # or badly installed instances (via adding the created file into # XML_CATALOG_FILES for libxml2 backing Publican as a fallback); # note that nextCatalog arrangement needed so as to overcome # https://rt.cpan.org/Public/Bug/Display.html?id=113781 publican-catalog-fallback: @exec >$@-t \ && echo '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">' \ && echo '<rewriteURI uriStartString="https://fedorahosted.org/released/publican/xsl/docbook4/" rewritePrefix="file:///usr/share/publican/xsl/"/>' \ && echo '</catalog>' $(AM_V_GEN)mv $@-t $@ publican-catalog: publican-catalog-fallback @exec >$@-t \ && echo '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">' \ && echo '<nextCatalog catalog="file:///etc/xml/catalog"/>' \ && echo '<nextCatalog catalog="file://$(CURDIR)/$<"/>' \ && echo '</catalog>' $(AM_V_GEN)mv $@-t $@ COMMON_XML = Author_Group.xml Book_Info.xml Revision_History.xml SHARED_TXT=$(wildcard shared/en-US/*.txt) SHARED_XML=$(SHARED_TXT:%.txt=%.xml) if PUBLICAN_INTREE_BRAND PUBLICAN_INTREE_DEPS = publican-catalog PUBLICAN_INTREE_ENV = XML_CATALOG_FILES="$(CURDIR)/publican-catalog" PUBLICAN_INTREE_OPT = --brand_dir="$(top_srcdir)/publican-clusterlabs" else PUBLICAN_INTREE_DEPS = PUBLICAN_INTREE_ENV = PUBLICAN_INTREE_OPT = endif # Clusters From Scratch CFS_SHARED_TXT = $(addprefix shared/en-US/,pacemaker-intro.txt) CFS_SHARED_XML = $(CFS_SHARED_TXT:%.txt=%.xml) CFS_TXT = $(wildcard Clusters_from_Scratch/en-US/*.txt) CFS_XML_GEN = $(CFS_TXT:%.txt=%.xml) CFS_XML_ONLY = $(addprefix $(srcdir)/Clusters_from_Scratch/en-US/,$(COMMON_XML) \ Clusters_from_Scratch.ent \ Clusters_from_Scratch.xml \ Preface.xml) CFS_DEPS = $(PNGS) $(CFS_SHARED_XML) $(CFS_XML_ONLY) $(CFS_XML_GEN) # We have to hardcode the book name # With '%' the test for 'newness' fails Clusters_from_Scratch.build: $(CFS_DEPS) $(PUBLICAN_INTREE_DEPS) @echo Building $(@:%.build=%) because of $? rm -rf $(@:%.build=%)/publish/* $(@:%.build=%)/tmp $(AM_V_PUB)cd $(@:%.build=%) && RPM_BUILD_DIR="" $(PUBLICAN_INTREE_ENV) \ $(PUBLICAN) build --src_dir="$(srcdir)" --publish \ --langs="$(DOCBOOK_LANGS)" --formats="$(DOCBOOK_FORMATS)" \ $(PUBLICAN_INTREE_OPT) $(PCMK_quiet) rm -rf $(@:%.build=%)/tmp touch $@ # Pacemaker Administration PA_TXT = $(wildcard Pacemaker_Administration/en-US/*.txt) PA_XML_GEN = $(PA_TXT:%.txt=%.xml) PA_XML_ONLY = $(addprefix $(srcdir)/Pacemaker_Administration/en-US/,$(COMMON_XML) \ Pacemaker_Administration.ent \ Pacemaker_Administration.xml \ Preface.xml) PA_DEPS = $(PA_XML_ONLY) $(PA_XML_GEN) # We have to hardcode the book name # With '%' the test for 'newness' fails Pacemaker_Administration.build: $(PA_DEPS) $(PUBLICAN_INTREE_DEPS) @echo Building $(@:%.build=%) because of $? rm -rf $(@:%.build=%)/publish/* $(AM_V_PUB)cd $(@:%.build=%) && RPM_BUILD_DIR="" $(PUBLICAN_INTREE_ENV) \ $(PUBLICAN) build --src_dir="$(srcdir)" --publish \ --langs="$(DOCBOOK_LANGS)" --formats="$(DOCBOOK_FORMATS)" \ $(PUBLICAN_INTREE_OPT) $(PCMK_quiet) rm -rf $(@:%.build=%)/tmp touch $@ # Pacemaker Development PD_TXT = $(wildcard Pacemaker_Development/en-US/*.txt) PD_XML_GEN = $(PD_TXT:%.txt=%.xml) PD_XML_ONLY = $(addprefix $(srcdir)/Pacemaker_Development/en-US/,$(COMMON_XML) \ Pacemaker_Development.ent \ Pacemaker_Development.xml) PD_DEPS = $(PD_XML_ONLY) $(PD_XML_GEN) # We have to hardcode the book name # With '%' the test for 'newness' fails Pacemaker_Development.build: $(PD_DEPS) $(PUBLICAN_INTREE_DEPS) @echo Building $(@:%.build=%) because of $? rm -rf $(@:%.build=%)/publish/* $(@:%.build=%)/tmp $(AM_V_PUB)cd $(@:%.build=%) && RPM_BUILD_DIR="" $(PUBLICAN_INTREE_ENV) \ $(PUBLICAN) build --src_dir="$(srcdir)" --publish \ --langs="$(DOCBOOK_LANGS)" --formats="$(DOCBOOK_FORMATS)" \ $(PUBLICAN_INTREE_OPT) $(PCMK_quiet) rm -rf $(@:%.build=%)/tmp touch $@ # Pacemaker Explained PE_SHARED_TXT = $(addprefix shared/en-US/,pacemaker-intro.txt) PE_SHARED_XML = $(PE_SHARED_TXT:%.txt=%.xml) PE_TXT = $(wildcard Pacemaker_Explained/en-US/*.txt) PE_XML_GEN = $(PE_TXT:%.txt=%.xml) PE_XML_ONLY = $(addprefix $(srcdir)/Pacemaker_Explained/en-US/,$(COMMON_XML) \ Pacemaker_Explained.ent \ Pacemaker_Explained.xml \ Preface.xml) PE_DEPS = $(PNGS) $(PE_SHARED_XML) $(PE_XML_ONLY) $(PE_XML_GEN) # We have to hardcode the book name # With '%' the test for 'newness' fails Pacemaker_Explained.build: $(PE_DEPS) $(PUBLICAN_INTREE_DEPS) @echo Building $(@:%.build=%) because of $? rm -rf $(@:%.build=%)/publish/* $(@:%.build=%)/tmp $(AM_V_PUB)cd $(@:%.build=%) && RPM_BUILD_DIR="" $(PUBLICAN_INTREE_ENV) \ $(PUBLICAN) build --src_dir="$(srcdir)" --publish \ --langs="$(DOCBOOK_LANGS)" --formats="$(DOCBOOK_FORMATS)" \ $(PUBLICAN_INTREE_OPT) $(PCMK_quiet) rm -rf $(@:%.build=%)/tmp touch $@ # Pacemaker Remote PR_TXT = $(wildcard Pacemaker_Remote/en-US/*.txt) PR_XML_GEN = $(PR_TXT:%.txt=%.xml) PR_XML_ONLY = $(addprefix $(srcdir)/Pacemaker_Remote/en-US/,$(COMMON_XML) \ Pacemaker_Remote.ent \ Pacemaker_Remote.xml) PR_DEPS = $(PR_XML_ONLY) $(PR_XML_GEN) # We have to hardcode the book name # With '%' the test for 'newness' fails Pacemaker_Remote.build: $(PNGS) $(PR_DEPS) $(PUBLICAN_INTREE_DEPS) @echo Building $(@:%.build=%) because of $? rm -rf $(@:%.build=%)/publish/* $(@:%.build=%)/tmp $(AM_V_PUB)cd $(@:%.build=%) && RPM_BUILD_DIR="" $(PUBLICAN_INTREE_ENV) \ $(PUBLICAN) build --src_dir="$(srcdir)" --publish \ --langs="$(DOCBOOK_LANGS)" --formats="$(DOCBOOK_FORMATS)" \ $(PUBLICAN_INTREE_OPT) $(PCMK_quiet) rm -rf $(@:%.build=%)/tmp touch $@ # Update the translation template pot: @for book in $(docbook); do \ echo "Updating translation templates in: $$book"; \ ( cd $$book && RPM_BUILD_DIR="" \ $(PUBLICAN) --src_dir="$(srcdir)" update_pot ); \ done # Update the actual translations po: pot @for book in $(docbook); do \ echo "Updating translations in: $$book"; \ ( cd $$book && RPM_BUILD_DIR="" \ $(PUBLICAN) --src_dir="$(srcdir)" update_po \ --langs=all ); \ done if BUILD_DOCBOOK all-local: $(docbook_build) */publican.cfg install-data-local: all-local for book in $(docbook); do \ filelist=`find $$book/publish/* -print`; \ for f in $$filelist; do \ p=`echo $$f | sed s:publish/:: | sed s:Pacemaker/::`; \ if [ -d $$f ]; then \ $(INSTALL) -d -m 775 $(DESTDIR)$(docdir)/$$p; \ else \ $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir)/$$p; \ fi \ done; \ done endif BRAND_DEPS = $(wildcard publican-clusterlabs/en-US/*.png) \ $(wildcard publican-clusterlabs/en-US/*.xml) brand-build: $(BRAND_DEPS) cd publican-clusterlabs && publican build --formats=xml --langs=all --publish brand: brand-build @echo "Installing branded content..." cd publican-clusterlabs && sudo publican install_brand --path=$(datadir)/publican/Common_Content brand-rpm-clean: -find publican-clusterlabs -name "*.noarch.rpm" -exec rm -f \{\} \; brand-rpm-build: brand-rpm-clean brand-build cd publican-clusterlabs && \ $(PUBLICAN) --src_dir="$(srcdir)" package --binary brand-rpm-install: brand-rpm-build find publican-clusterlabs -name "*.noarch.rpm" -exec sudo rpm -Uvh --force \{\} \; pdf: - $(MAKE) DOCBOOK_FORMATS="pdf" all-local + $(MAKE) $(AM_MAKEFLAGS) DOCBOOK_FORMATS="pdf" all-local # Annotated source code as HTML global: - $(MAKE) -C .. clean-generic + $(MAKE) $(AM_MAKEFLAGS) -C .. clean-generic cd .. && gtags -q && htags -sanhIT doc global-upload: global rsync $(RSYNC_OPTS) HTML/ "$(RSYNC_DEST)/$(PACKAGE)/global/$(TAG)/" global-clean: -rm -rf HTML # Man pages as HTML %.8.html: %.8 groff -mandoc `man -w ./$<` -T html > $@ %.7.html: %.7 groff -mandoc `man -w ./$<` -T html > $@ manhtml: - $(MAKE) -C .. all - find .. -name "[a-z]*.[78]" -exec $(MAKE) \{\}.html \; + $(MAKE) $(AM_MAKEFLAGS) -C .. all + find .. -name "[a-z]*.[78]" -exec $(MAKE) $(AM_MAKEFLAGS) \{\}.html \; manhtml-upload: manhtml find .. -name "[a-z]*.[78].html" -exec \ rsync $(RSYNC_OPTS) \{\} "$(RSYNC_DEST)/$(PACKAGE)/man/" \; manhtml-clean: -find .. -name "[a-z]*.[78].html" -exec rm \{\} \; # API documentation as HTML doxygen: Doxyfile doxygen Doxyfile doxygen-upload: doxygen rsync $(RSYNC_OPTS) api/html/ "$(RSYNC_DEST)/$(PACKAGE)/doxygen/$(TAG)/" doxygen-clean: -rm -rf api # ABI compatibility report as HTML abi: abi-check ./abi-check $(PACKAGE) $(LAST_RELEASE) $(TAG) abi-www: export RSYNC_DEST=$(RSYNC_DEST); ./abi-check -u $(PACKAGE) $(LAST_RELEASE) $(TAG) abi-clean: -rm -rf abi_dumps compat_reports # All HTML documentation (except ABI compatibility, which is run separately) www: clean-local $(doc_DATA) manhtml-upload global-upload doxygen-upload if BUILD_DOCBOOK for book in $(docbook); do \ sed -i.sed 's@^brand:.*@brand: clusterlabs@' $$book/publican.cfg; \ done endif - $(MAKE) DOCBOOK_FORMATS="pdf,html,html-single,epub" DOCBOOK_LANGS="$(DOCBOOK_LANGS)" all-local + $(MAKE) $(AM_MAKEFLAGS) DOCBOOK_FORMATS="pdf,html,html-single,epub" \ + DOCBOOK_LANGS="$(DOCBOOK_LANGS)" all-local @echo Uploading current $(PACKAGE_SERIES) documentation set to clusterlabs.org if BUILD_DOCBOOK @for book in $(docbook); do \ echo Uploading $$book...; \ echo "Generated on `date` from version: $(shell git log --pretty="format:%h %d" -n 1)" >> $$book/publish/build-$(PACKAGE_SERIES).txt; \ rsync $(RSYNC_OPTS) $$book/publish/* "$(RSYNC_DEST)/$(PACKAGE)/doc/"; \ done endif rsync $(RSYNC_OPTS) $(doc_DATA) "$(RSYNC_DEST)/$(PACKAGE)/doc/" ALL_GEN = $(generated_docs) \ $(docbook_build) \ $(PNGS_GENERATED) \ $(SHARED_XML) \ $(CFS_XML_GEN) \ $(PA_XML_GEN) \ $(PD_XML_GEN) \ $(PE_XML_GEN) \ $(PR_XML_GEN) \ publican-catalog-fallback \ publican-catalog clean-local: brand-rpm-clean global-clean manhtml-clean doxygen-clean abi-clean -rm -f $(ALL_GEN) -for book in $(docbook); do \ rm -rf $$book/tmp $$book/publish; \ done diff --git a/extra/resources/Makefile.am b/extra/resources/Makefile.am index fcfa61b64a..50c55bd66e 100644 --- a/extra/resources/Makefile.am +++ b/extra/resources/Makefile.am @@ -1,43 +1,40 @@ # # Copyright 2008-2019 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # include $(top_srcdir)/Makefile.common -EXTRA_DIST = $(ocf_SCRIPTS) - - ocfdir = @OCF_RA_DIR@/pacemaker dist_ocf_SCRIPTS = attribute \ controld \ Dummy \ HealthCPU \ HealthIOWait \ ping \ pingd \ remote \ Stateful \ SystemHealth ocf_SCRIPTS = ClusterMon \ HealthSMART \ ifspeed \ o2cb \ SysInfo if BUILD_XML_HELP man7_MANS = $(ocf_SCRIPTS:%=ocf_pacemaker_%.7) $(dist_ocf_SCRIPTS:%=ocf_pacemaker_%.7) DBOOK_OPTS = --stringparam command.prefix ocf_pacemaker_ --stringparam variable.prefix OCF_RESKEY_ --param man.vol 7 ocf_pacemaker_%.xml: % $(AM_V_GEN)OCF_FUNCTIONS=/dev/null OCF_ROOT=$(OCF_ROOT_DIR) $(abs_builddir)/$< meta-data > $@ endif clean-generic: rm -f $(man7_MANS) $(ocf_SCRIPTS:%=%.xml) $(dist_ocf_SCRIPTS:%=%.xml) *~ diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am index 150d9cda60..e3f240f29e 100644 --- a/lib/common/Makefile.am +++ b/lib/common/Makefile.am @@ -1,71 +1,80 @@ # # Copyright 2004-2019 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # include $(top_srcdir)/Makefile.common AM_CPPFLAGS += -I$(top_builddir)/lib/gnu -I$(top_srcdir)/lib/gnu -DPCMK_SCHEMAS_EMERGENCY_XSLT=0 +MOSTLYCLEANFILES = md5.c + ## libraries lib_LTLIBRARIES = libcrmcommon.la # Disable -Wcast-qual if used, because we do some hacky casting, # and because libxml2 has some signatures that should be const but aren't # for backward compatibility reasons. # s390 needs -fPIC # s390-suse-linux/bin/ld: .libs/ipc.o: relocation R_390_PC32DBL against `__stack_chk_fail@@GLIBC_2.4' can not be used when making a shared object; recompile with -fPIC CFLAGS = $(CFLAGS_COPY:-Wcast-qual=) -fPIC noinst_HEADERS = crmcommon_private.h libcrmcommon_la_LDFLAGS = -version-info 36:0:2 libcrmcommon_la_CFLAGS = $(CFLAGS_HARDENED_LIB) libcrmcommon_la_LDFLAGS += $(LDFLAGS_HARDENED_LIB) libcrmcommon_la_LIBADD = @LIBADD_DL@ # Use += rather than backlashed continuation lines for parsing by bumplibs.sh libcrmcommon_la_SOURCES = libcrmcommon_la_SOURCES += acl.c libcrmcommon_la_SOURCES += agents.c libcrmcommon_la_SOURCES += alerts.c libcrmcommon_la_SOURCES += attrd_client.c if BUILD_CIBSECRETS libcrmcommon_la_SOURCES += cib_secrets.c endif libcrmcommon_la_SOURCES += cmdline.c libcrmcommon_la_SOURCES += compat.c libcrmcommon_la_SOURCES += digest.c libcrmcommon_la_SOURCES += io.c libcrmcommon_la_SOURCES += ipc.c libcrmcommon_la_SOURCES += iso8601.c libcrmcommon_la_SOURCES += logging.c libcrmcommon_la_SOURCES += mainloop.c libcrmcommon_la_SOURCES += nvpair.c libcrmcommon_la_SOURCES += operations.c libcrmcommon_la_SOURCES += output.c libcrmcommon_la_SOURCES += output_html.c libcrmcommon_la_SOURCES += output_none.c libcrmcommon_la_SOURCES += output_text.c libcrmcommon_la_SOURCES += output_xml.c libcrmcommon_la_SOURCES += pid.c libcrmcommon_la_SOURCES += procfs.c libcrmcommon_la_SOURCES += remote.c libcrmcommon_la_SOURCES += results.c libcrmcommon_la_SOURCES += schemas.c libcrmcommon_la_SOURCES += strings.c libcrmcommon_la_SOURCES += utils.c libcrmcommon_la_SOURCES += watchdog.c libcrmcommon_la_SOURCES += xml.c libcrmcommon_la_SOURCES += xpath.c -libcrmcommon_la_SOURCES += ../gnu/md5.c + +# It's possible to build the library adding ../gnu/md5.c directly to SOURCES, +# but distclean chokes on that because it tries to include the source's .Plo +# file, which may have already been cleaned. +nodist_libcrmcommon_la_SOURCES = md5.c + +md5.c: ../gnu/md5.c + cp "$<" "$@" clean-generic: rm -f *.log *.debug *.xml *~ diff --git a/rpm/README b/rpm/README new file mode 100644 index 0000000000..666bb78ee4 --- /dev/null +++ b/rpm/README @@ -0,0 +1,2 @@ +This directory contains files useful for building rpm packages for pacemaker. +Anyone not building RPMs can safely ignore it. diff --git a/pacemaker.spec.in b/rpm/pacemaker.spec.in similarity index 90% rename from pacemaker.spec.in rename to rpm/pacemaker.spec.in index 0f1638b471..0b5a44ec58 100644 --- a/pacemaker.spec.in +++ b/rpm/pacemaker.spec.in @@ -1,843 +1,878 @@ # Globals and defines to control package behavior (configure these as desired) ## User and group to use for nonprivileged services %global uname hacluster %global gname haclient ## Where to install Pacemaker documentation +%if 0%{?suse_version} > 0 +%global pcmk_docdir %{_docdir}/%{name}-%{version} +%else %global pcmk_docdir %{_docdir}/%{name} +%endif ## GitHub entity that distributes source (for ease of using a fork) %global github_owner ClusterLabs ## Upstream pacemaker version, and its package version (specversion ## can be incremented to build packages reliably considered "newer" ## than previously built packages with the same pcmkversion) %global pcmkversion 2.0.2 %global specversion 1 ## Upstream commit (or git tag, such as "Pacemaker-" plus the ## {pcmkversion} macro for an official release) to use for this package %global commit HEAD ## Since git v2.11, the extent of abbreviation is autoscaled by default ## (used to be constant of 7), so we need to convey it for non-tags, too. %global commit_abbrev 7 ## Python major version to use (2, 3, or 0 for auto-detect) %global python_major 0 # Define globals for convenient use later ## Workaround to use parentheses in other globals %global lparen ( %global rparen ) ## Short version of git commit %define shortcommit %(c=%{commit}; case ${c} in Pacemaker-*%{rparen} echo ${c:10};; *%{rparen} echo ${c:0:%{commit_abbrev}};; esac) ## Whether this is a tagged release %define tag_release %([ %{commit} != Pacemaker-%{shortcommit} ]; echo $?) ## Whether this is a release candidate (in case of a tagged release) %define pre_release %([ "%{tag_release}" -eq 0 ] || { case "%{shortcommit}" in *-rc[[:digit:]]*%{rparen} false;; esac; }; echo $?) ## Heuristic used to infer bleeding-edge deployments that are ## less likely to have working versions of the documentation tools %define bleeding %(test ! -e /etc/yum.repos.d/fedora-rawhide.repo; echo $?) ## Whether this platform defaults to using systemd as an init system ## (needs to be evaluated prior to BuildRequires being enumerated and ## installed as it's intended to conditionally select some of these, and ## for that there are only few indicators with varying reliability: ## - presence of systemd-defined macros (when building in a full-fledged ## environment, which is not the case with ordinary mock-based builds) ## - systemd-aware rpm as manifested with the presence of particular ## macro (rpm itself will trivially always be present when building) ## - existence of /usr/lib/os-release file, which is something heavily ## propagated by systemd project ## - when not good enough, there's always a possibility to check ## particular distro-specific macros (incl. version comparison) %define systemd_native (%{?_unitdir:1}%{!?_unitdir:0}%{nil \ } || %{?__transaction_systemd_inhibit:1}%{!?__transaction_systemd_inhibit:0}%{nil \ } || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?)) %if 0%{?fedora} > 20 || 0%{?rhel} > 7 ## Base GnuTLS cipher priorities (presumably only the initial, required keyword) ## overridable with "rpmbuild --define 'pcmk_gnutls_priorities PRIORITY-SPEC'" %define gnutls_priorities %{?pcmk_gnutls_priorities}%{!?pcmk_gnutls_priorities:@SYSTEM} %endif +## Different distros name certain packages differently +%if 0%{?suse_version} > 0 +%global pkgname_libtool_devel +%global pkgname_libtool_devel_arch +%global pkgname_bzip2_devel libbz2-devel +%global pkgname_docbook_xsl docbook-xsl-stylesheets +%global pkgname_gnutls_devel libgnutls-devel +%global pkgname_shadow_utils shadow +%global pkgname_procps procps +%global pkgname_publican +%global pkgname_corosync_lib libcorosync +%global pkgname_glue_libs libglue +%global pkgname_pcmk_libs lib%{name}3 +%global hacluster_id 90 +%else +%global pkgname_libtool_devel libtool-ltdl-devel +%global pkgname_libtool_devel_arch libtool-ltdl-devel%{?_isa} +%global pkgname_bzip2_devel bzip2-devel +%global pkgname_docbook_xsl docbook-style-xsl +%global pkgname_gnutls_devel gnutls-devel +%global pkgname_shadow_utils shadow-utils +%global pkgname_procps procps-ng +%global pkgname_publican publican +%global pkgname_corosync_lib corosynclib +%global pkgname_glue_libs cluster-glue-libs +%global pkgname_pcmk_libs %{name}-libs +%global hacluster_id 189 +%endif + # Python-related definitions ## Use Python 3 on certain platforms if major version not specified %if %{?python_major} == 0 %if 0%{?fedora} > 26 || 0%{?rhel} > 7 %global python_major 3 %endif %endif ## Turn off auto-compilation of Python files outside Python specific paths, ## so there's no risk that unexpected "__python" macro gets picked to do the ## RPM-native byte-compiling there (only "{_datadir}/pacemaker/tests" affected) ## -- distro-dependent tricks or automake's fallback to be applied there %if %{defined _python_bytecompile_extra} %global _python_bytecompile_extra 0 %else ### the statement effectively means no RPM-native byte-compiling will occur at ### all, so distro-dependent tricks for Python-specific packages to be applied %global __os_install_post %(echo '%{__os_install_post}' | { sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g'; }) %endif ## Values that differ by Python major version %if 0%{?python_major} > 2 %global python_name python3 %global python_path %{?__python3}%{!?__python3:/usr/bin/python%{?python3_pkgversion}%{!?python3_pkgversion:3}} %define python_site %{?python3_sitelib}%{!?python3_sitelib:%( %{python_path} -c 'from distutils.sysconfig import get_python_lib as gpl; print(gpl(1))' 2>/dev/null)} %else %if 0%{?python_major} > 1 %global python_name python2 %global python_path %{?__python2}%{!?__python2:/usr/bin/python%{?python2_pkgversion}%{!?python2_pkgversion:2}} %define python_site %{?python2_sitelib}%{!?python2_sitelib:%( %{python_path} -c 'from distutils.sysconfig import get_python_lib as gpl; print(gpl(1))' 2>/dev/null)} %else %global python_name python %global python_path %{?__python}%{!?__python:/usr/bin/python%{?python_pkgversion}} %define python_site %{?python_sitelib}%{!?python_sitelib:%( python -c 'from distutils.sysconfig import get_python_lib as gpl; print(gpl(1))' 2>/dev/null)} %endif %endif # Definitions for backward compatibility with older RPM versions ## Ensure the license macro behaves consistently (older RPM will otherwise ## overwrite it once it encounters "License:"). Courtesy Jason Tibbitts: ## https://pkgs.fedoraproject.org/cgit/rpms/epel-rpm-macros.git/tree/macros.zzz-epel?h=el6&id=e1adcb77 %if !%{defined _licensedir} %define description %{lua: rpm.define("license %doc") print("%description") } %endif # Define conditionals so that "rpmbuild --with <feature>" and # "rpmbuild --without <feature>" can enable and disable specific features ## Add option to enable support for stonith/external fencing agents %bcond_with stonithd ## Add option to create binaries suitable for use with profiling tools %bcond_with profiling ## Add option to create binaries with coverage analysis %bcond_with coverage ## Add option to skip generating documentation ## (the build tools aren't available everywhere) %bcond_without doc ## Add option to prefix package version with "0." ## (so later "official" packages will be considered updates) %bcond_with pre_release ## Add option to ship Upstart job files %bcond_with upstart_job ## Add option to turn off hardening of libraries and daemon executables %bcond_without hardening ## Add option to disable links for legacy daemon names %bcond_without legacy_links # Keep sane profiling data if requested %if %{with profiling} ## Disable -debuginfo package and stripping binaries/libraries %define debug_package %{nil} %endif # Define the release version # (do not look at externally enforced pre-release flag for tagged releases # as only -rc tags, captured with the second condition, implies that then) %if (!%{tag_release} && %{with pre_release}) || 0%{pre_release} %if 0%{pre_release} %define pcmk_release 0.%{specversion}.%(s=%{shortcommit}; echo ${s: -3}) %else %define pcmk_release 0.%{specversion}.%{shortcommit}.git %endif %else %if 0%{tag_release} %define pcmk_release %{specversion} %else %define pcmk_release %{specversion}.%{shortcommit}.git %endif %endif Name: pacemaker Summary: Scalable High-Availability cluster resource manager Version: %{pcmkversion} Release: %{pcmk_release}%{?dist} %if %{defined _unitdir} License: GPLv2+ and LGPLv2+ %else # initscript is Revised BSD License: GPLv2+ and LGPLv2+ and BSD %endif Url: http://www.clusterlabs.org Group: System Environment/Daemons # Hint: use "spectool -s 0 pacemaker.spec" (rpmdevtools) to check the final URL: # https://github.com/ClusterLabs/pacemaker/archive/e91769e5a39f5cb2f7b097d3c612368f0530535e/pacemaker-e91769e.tar.gz Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Requires: resource-agents -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} Requires: %{name}-cluster-libs%{?_isa} = %{version}-%{release} Requires: %{name}-cli = %{version}-%{release} %if !%{defined _unitdir} -Requires: procps-ng +Requires: %{pkgname_procps} Requires: psmisc %endif %{?systemd_requires} Requires: %{python_path} BuildRequires: %{python_name}-devel # Pacemaker requires a minimum libqb functionality Requires: libqb >= 0.13.0 BuildRequires: libqb-devel >= 0.13.0 # Basics required for the build (even if usually satisfied through other BRs) BuildRequires: coreutils findutils grep sed # Required for core functionality -BuildRequires: automake autoconf gcc libtool pkgconfig libtool-ltdl-devel +BuildRequires: automake autoconf gcc libtool pkgconfig %{pkgname_libtool_devel} BuildRequires: pkgconfig(glib-2.0) >= 2.16 BuildRequires: libxml2-devel libxslt-devel libuuid-devel -BuildRequires: bzip2-devel +BuildRequires: %{pkgname_bzip2_devel} # Enables optional functionality -BuildRequires: ncurses-devel docbook-style-xsl -BuildRequires: help2man gnutls-devel pam-devel pkgconfig(dbus-1) +BuildRequires: ncurses-devel %{pkgname_docbook_xsl} +BuildRequires: help2man %{pkgname_gnutls_devel} pam-devel pkgconfig(dbus-1) %if %{systemd_native} BuildRequires: pkgconfig(systemd) %endif Requires: corosync >= 2.0.0 -BuildRequires: corosynclib-devel >= 2.0.0 +BuildRequires: %{pkgname_corosync_lib}-devel >= 2.0.0 %if %{with stonithd} -BuildRequires: cluster-glue-libs-devel +BuildRequires: %{pkgname_glue_libs}-devel %endif ## (note no avoiding effect when building through non-customized mock) %if !%{bleeding} %if %{with doc} -BuildRequires: inkscape asciidoc publican +BuildRequires: inkscape asciidoc %{pkgname_publican} %endif %endif Provides: pcmk-cluster-manager = %{version}-%{release} Provides: pcmk-cluster-manager%{?_isa} = %{version}-%{release} # Bundled bits ## Pacemaker uses the crypto/md5-buffer module from gnulib %if 0%{?fedora} || 0%{?rhel} Provides: bundled(gnulib) %endif %description Pacemaker is an advanced, scalable High-Availability cluster resource manager. It supports more than 16 node clusters with significant capabilities for managing resources and dependencies. It will run scripts at initialization, when machines go up or down, when related resources fail and can be configured to periodically check resource health. Available rpmbuild rebuild options: --with(out) : coverage doc stonithd hardening pre_release profiling upstart_job %package cli License: GPLv2+ and LGPLv2+ Summary: Command line tools for controlling Pacemaker clusters Group: System Environment/Daemons -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} %if 0%{?fedora} > 22 || 0%{?rhel} > 7 Recommends: pcmk-cluster-manager = %{version}-%{release} # For crm_report Recommends: tar Recommends: bzip2 %endif Requires: perl-TimeDate -Requires: procps-ng +Requires: %{pkgname_procps} Requires: psmisc Requires(post):coreutils %description cli Pacemaker is an advanced, scalable High-Availability cluster resource manager. The %{name}-cli package contains command line tools that can be used to query and control the cluster from machines that may, or may not, be part of the cluster. -%package libs +%package -n %{pkgname_pcmk_libs} License: GPLv2+ and LGPLv2+ Summary: Core Pacemaker libraries Group: System Environment/Daemons -Requires(pre): shadow-utils +Requires(pre): %{pkgname_shadow_utils} Requires: %{name}-schemas = %{version}-%{release} # sbd 1.4.0+ supports the libpe_status API for pe_working_set_t Conflicts: sbd < 1.4.0 %description libs Pacemaker is an advanced, scalable High-Availability cluster resource manager. -The %{name}-libs package contains shared libraries needed for cluster +The %{pkgname_pcmk_libs} package contains shared libraries needed for cluster nodes and those just running the CLI tools. %package cluster-libs License: GPLv2+ and LGPLv2+ Summary: Cluster Libraries used by Pacemaker Group: System Environment/Daemons -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} %description cluster-libs Pacemaker is an advanced, scalable High-Availability cluster resource manager. The %{name}-cluster-libs package contains cluster-aware shared libraries needed for nodes that will form part of the cluster nodes. %package remote %if %{defined _unitdir} License: GPLv2+ and LGPLv2+ %else # initscript is Revised BSD License: GPLv2+ and LGPLv2+ and BSD %endif Summary: Pacemaker remote daemon for non-cluster nodes Group: System Environment/Daemons -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} Requires: %{name}-cli = %{version}-%{release} Requires: resource-agents %if !%{defined _unitdir} -Requires: procps-ng +Requires: %{pkgname_procps} %endif # -remote can be fully independent of systemd %{?systemd_ordering}%{!?systemd_ordering:%{?systemd_requires}} Provides: pcmk-cluster-manager = %{version}-%{release} Provides: pcmk-cluster-manager%{?_isa} = %{version}-%{release} %description remote Pacemaker is an advanced, scalable High-Availability cluster resource manager. The %{name}-remote package contains the Pacemaker Remote daemon which is capable of extending pacemaker functionality to remote nodes not running the full corosync/cluster stack. -%package libs-devel +%package -n %{pkgname_pcmk_libs}-devel License: GPLv2+ and LGPLv2+ Summary: Pacemaker development package Group: Development/Libraries -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} Requires: %{name}-cluster-libs%{?_isa} = %{version}-%{release} -Requires: libuuid-devel%{?_isa} libtool-ltdl-devel%{?_isa} +Requires: libuuid-devel%{?_isa} %{pkgname_libtool_devel_arch} Requires: libxml2-devel%{?_isa} libxslt-devel%{?_isa} -Requires: bzip2-devel%{?_isa} glib2-devel%{?_isa} +Requires: %{pkgname_bzip2_devel}%{?_isa} glib2-devel%{?_isa} Requires: libqb-devel%{?_isa} -Requires: corosynclib-devel%{?_isa} >= 2.0.0 +Requires: %{pkgname_corosync_lib}-devel%{?_isa} >= 2.0.0 %description libs-devel Pacemaker is an advanced, scalable High-Availability cluster resource manager. -The %{name}-libs-devel package contains headers and shared libraries +The %{pkgname_pcmk_libs}-devel package contains headers and shared libraries for developing tools for Pacemaker. %package cts License: GPLv2+ and LGPLv2+ Summary: Test framework for cluster-related technologies like Pacemaker Group: System Environment/Daemons Requires: %{python_path} -Requires: %{name}-libs = %{version}-%{release} -Requires: procps-ng +Requires: %{pkgname_pcmk_libs} = %{version}-%{release} +Requires: %{pkgname_procps} Requires: psmisc BuildArch: noarch # systemd python bindings are separate package in some distros %if %{defined systemd_requires} %if 0%{?fedora} > 22 || 0%{?rhel} > 7 Requires: %{python_name}-systemd %else %if 0%{?fedora} > 20 || 0%{?rhel} > 6 Requires: systemd-python %endif %endif %endif %description cts Test framework for cluster-related technologies like Pacemaker %package doc License: CC-BY-SA-4.0 Summary: Documentation for Pacemaker Group: Documentation BuildArch: noarch %description doc Documentation for Pacemaker. Pacemaker is an advanced, scalable High-Availability cluster resource manager. %package schemas License: GPLv2+ Summary: Schemas and upgrade stylesheets for Pacemaker BuildArch: noarch %description schemas Schemas and upgrade stylesheets for Pacemaker Pacemaker is an advanced, scalable High-Availability cluster resource manager. %prep %setup -q -n %{name}-%{commit} %build # Early versions of autotools (e.g. RHEL <= 5) do not support --docdir export docdir=%{pcmk_docdir} export systemdunitdir=%{?_unitdir}%{!?_unitdir:no} %if %{with hardening} # prefer distro-provided hardening flags in case they are defined # through _hardening_{c,ld}flags macros, configure script will # use its own defaults otherwise; if such hardenings are completely # undesired, rpmbuild using "--without hardening" # (or "--define '_without_hardening 1'") export CFLAGS_HARDENED_EXE="%{?_hardening_cflags}" export CFLAGS_HARDENED_LIB="%{?_hardening_cflags}" export LDFLAGS_HARDENED_EXE="%{?_hardening_ldflags}" export LDFLAGS_HARDENED_LIB="%{?_hardening_ldflags}" %endif ./autogen.sh %{configure} \ PYTHON=%{python_path} \ %{!?with_hardening: --disable-hardening} \ %{!?with_legacy_links: --disable-legacy-links} \ %{?with_profiling: --with-profiling} \ %{?with_coverage: --with-coverage} \ %{!?with_doc: --with-brand=} \ %{?gnutls_priorities: --with-gnutls-priorities="%{gnutls_priorities}"} \ --with-initdir=%{_initrddir} \ --localstatedir=%{_var} \ --with-version=%{version}-%{release} %if 0%{?suse_version} >= 1200 # Fedora handles rpath removal automagically sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %endif make %{_smp_mflags} V=1 %check { cts/cts-scheduler --run load-stopped-loop \ && cts/cts-cli \ && touch .CHECKED } 2>&1 | sed 's/[fF]ail/faiil/g' # prevent false positives in rpmlint [ -f .CHECKED ] && rm -f -- .CHECKED exit $? # TODO remove when rpm<4.14 compatibility irrelevant %install # skip automake-native Python byte-compilation, since RPM-native one (possibly # distro-confined to Python-specific directories, which is currently the only # relevant place, anyway) assures proper intrinsic alignment with wider system # (such as with py_byte_compile macro, which is concurrent Fedora/EL specific) make install \ DESTDIR=%{buildroot} V=1 docdir=%{pcmk_docdir} \ %{?_python_bytecompile_extra:%{?py_byte_compile:am__py_compile=true}} mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig install -m 644 daemons/pacemakerd/pacemaker.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/pacemaker install -m 644 tools/crm_mon.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/crm_mon %if %{with upstart_job} mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/init install -m 644 pacemakerd/pacemaker.upstart ${RPM_BUILD_ROOT}%{_sysconfdir}/init/pacemaker.conf install -m 644 pacemakerd/pacemaker.combined.upstart ${RPM_BUILD_ROOT}%{_sysconfdir}/init/pacemaker.combined.conf install -m 644 tools/crm_mon.upstart ${RPM_BUILD_ROOT}%{_sysconfdir}/init/crm_mon.conf %endif %if %{defined _unitdir} mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/rpm-state/%{name} %endif # Don't package static libs find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f # For now, don't package the servicelog-related binaries built only for # ppc64le when certain dependencies are installed. If they get more exercise by # advanced users, we can reconsider. rm -f %{buildroot}/%{_sbindir}/notifyServicelogEvent rm -f %{buildroot}/%{_sbindir}/ipmiservicelogd # Don't ship init scripts for systemd based platforms %if %{defined _unitdir} rm -f %{buildroot}/%{_initrddir}/pacemaker rm -f %{buildroot}/%{_initrddir}/pacemaker_remote %endif # Byte-compile Python sources where suitable and the distro procedures known %if %{defined py_byte_compile} %{py_byte_compile %{python_path} %{buildroot}%{_datadir}/pacemaker/tests} %if !%{defined _python_bytecompile_extra} %{py_byte_compile %{python_path} %{buildroot}%{python_site}/cts} %endif %endif %if %{with coverage} GCOV_BASE=%{buildroot}/%{_var}/lib/pacemaker/gcov mkdir -p $GCOV_BASE find . -name '*.gcno' -type f | while read F ; do D=`dirname $F` mkdir -p ${GCOV_BASE}/$D cp $F ${GCOV_BASE}/$D done %endif %post %if %{defined _unitdir} %systemd_post pacemaker.service %else /sbin/chkconfig --add pacemaker || : %endif %preun %if %{defined _unitdir} %systemd_preun pacemaker.service %else /sbin/service pacemaker stop >/dev/null 2>&1 || : if [ "$1" -eq 0 ]; then # Package removal, not upgrade /sbin/chkconfig --del pacemaker || : fi %endif %postun %if %{defined _unitdir} %systemd_postun_with_restart pacemaker.service %endif %pre remote %if %{defined _unitdir} # Stop the service before anything is touched, and remember to restart # it as one of the last actions (compared to using systemd_postun_with_restart, # this avoids suicide when sbd is in use) systemctl --quiet is-active pacemaker_remote if [ $? -eq 0 ] ; then mkdir -p %{_localstatedir}/lib/rpm-state/%{name} touch %{_localstatedir}/lib/rpm-state/%{name}/restart_pacemaker_remote systemctl stop pacemaker_remote >/dev/null 2>&1 else rm -f %{_localstatedir}/lib/rpm-state/%{name}/restart_pacemaker_remote fi %endif %post remote %if %{defined _unitdir} %systemd_post pacemaker_remote.service %else /sbin/chkconfig --add pacemaker_remote || : %endif %preun remote %if %{defined _unitdir} %systemd_preun pacemaker_remote.service %else /sbin/service pacemaker_remote stop >/dev/null 2>&1 || : if [ "$1" -eq 0 ]; then # Package removal, not upgrade /sbin/chkconfig --del pacemaker_remote || : fi %endif %postun remote %if %{defined _unitdir} # This next line is a no-op, because we stopped the service earlier, but # we leave it here because it allows us to revert to the standard behavior # in the future if desired %systemd_postun_with_restart pacemaker_remote.service # Explicitly take care of removing the flag-file(s) upon final removal if [ "$1" -eq 0 ] ; then rm -f %{_localstatedir}/lib/rpm-state/%{name}/restart_pacemaker_remote fi %endif %posttrans remote %if %{defined _unitdir} if [ -e %{_localstatedir}/lib/rpm-state/%{name}/restart_pacemaker_remote ] ; then systemctl start pacemaker_remote >/dev/null 2>&1 rm -f %{_localstatedir}/lib/rpm-state/%{name}/restart_pacemaker_remote fi %endif %post cli %if %{defined _unitdir} %systemd_post crm_mon.service %endif if [ "$1" -eq 2 ]; then # Package upgrade, not initial install: # Move any pre-2.0 logs to new location to ensure they get rotated { mv -fbS.rpmsave %{_var}/log/pacemaker.log* %{_var}/log/pacemaker \ || mv -f %{_var}/log/pacemaker.log* %{_var}/log/pacemaker } >/dev/null 2>/dev/null || : fi %preun cli %if %{defined _unitdir} %systemd_preun crm_mon.service %endif %postun cli %if %{defined _unitdir} %systemd_postun_with_restart crm_mon.service %endif %pre libs -getent group %{gname} >/dev/null || groupadd -r %{gname} -g 189 -getent passwd %{uname} >/dev/null || useradd -r -g %{gname} -u 189 -s /sbin/nologin -c "cluster user" %{uname} +getent group %{gname} >/dev/null || groupadd -r %{gname} -g %{hacluster_id} +getent passwd %{uname} >/dev/null || useradd -r -g %{gname} -u %{hacluster_id} -s /sbin/nologin -c "cluster user" %{uname} exit 0 %if %{defined ldconfig_scriptlets} %ldconfig_scriptlets libs %ldconfig_scriptlets cluster-libs %else %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %post cluster-libs -p /sbin/ldconfig %postun cluster-libs -p /sbin/ldconfig %endif %files ########################################################### %config(noreplace) %{_sysconfdir}/sysconfig/pacemaker %{_sbindir}/pacemakerd %if %{defined _unitdir} %{_unitdir}/pacemaker.service %else %{_initrddir}/pacemaker %endif %exclude %{_libexecdir}/pacemaker/cts-log-watcher %exclude %{_libexecdir}/pacemaker/cts-support %exclude %{_sbindir}/pacemaker-remoted %if %{with legacy_links} %exclude %{_sbindir}/pacemaker_remoted %endif %{_libexecdir}/pacemaker/* %{_sbindir}/crm_attribute %{_sbindir}/crm_master %{_sbindir}/fence_legacy %doc %{_mandir}/man7/pacemaker-controld.* %doc %{_mandir}/man7/pacemaker-schedulerd.* %doc %{_mandir}/man7/pacemaker-fenced.* %doc %{_mandir}/man7/ocf_pacemaker_controld.* %doc %{_mandir}/man7/ocf_pacemaker_o2cb.* %doc %{_mandir}/man7/ocf_pacemaker_remote.* %doc %{_mandir}/man8/crm_attribute.* %doc %{_mandir}/man8/crm_master.* %doc %{_mandir}/man8/fence_legacy.* %doc %{_mandir}/man8/pacemakerd.* %doc %{_datadir}/pacemaker/alerts %license licenses/GPLv2 %doc COPYING %doc ChangeLog %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cib %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/pengine /usr/lib/ocf/resource.d/pacemaker/controld /usr/lib/ocf/resource.d/pacemaker/o2cb /usr/lib/ocf/resource.d/pacemaker/remote %if %{with upstart_job} %config(noreplace) %{_sysconfdir}/init/pacemaker.conf %config(noreplace) %{_sysconfdir}/init/pacemaker.combined.conf %endif %files cli %dir %attr (750, root, %{gname}) %{_sysconfdir}/pacemaker %config(noreplace) %{_sysconfdir}/logrotate.d/pacemaker %config(noreplace) %{_sysconfdir}/sysconfig/crm_mon %if %{defined _unitdir} %{_unitdir}/crm_mon.service %endif %if %{with upstart_job} %config(noreplace) %{_sysconfdir}/init/crm_mon.conf %endif %{_sbindir}/attrd_updater %{_sbindir}/cibadmin %{_sbindir}/crm_diff %{_sbindir}/crm_error %{_sbindir}/crm_failcount %{_sbindir}/crm_mon %{_sbindir}/crm_node %{_sbindir}/crm_resource %{_sbindir}/crm_rule %{_sbindir}/crm_standby %{_sbindir}/crm_verify %{_sbindir}/crmadmin %{_sbindir}/iso8601 %{_sbindir}/crm_shadow %{_sbindir}/crm_simulate %{_sbindir}/crm_report %{_sbindir}/crm_ticket %{_sbindir}/stonith_admin # "dirname" is owned by -schemas, which is a prerequisite %{_datadir}/pacemaker/report.collector %{_datadir}/pacemaker/report.common # XXX "dirname" is not owned by any prerequisite %{_datadir}/snmp/mibs/PCMK-MIB.txt %exclude /usr/lib/ocf/resource.d/pacemaker/controld %exclude /usr/lib/ocf/resource.d/pacemaker/o2cb %exclude /usr/lib/ocf/resource.d/pacemaker/remote %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d /usr/lib/ocf/resource.d/pacemaker %doc %{_mandir}/man7/* %exclude %{_mandir}/man7/pacemaker-controld.* %exclude %{_mandir}/man7/pacemaker-schedulerd.* %exclude %{_mandir}/man7/pacemaker-fenced.* %exclude %{_mandir}/man7/ocf_pacemaker_controld.* %exclude %{_mandir}/man7/ocf_pacemaker_o2cb.* %exclude %{_mandir}/man7/ocf_pacemaker_remote.* %doc %{_mandir}/man8/* %exclude %{_mandir}/man8/crm_attribute.* %exclude %{_mandir}/man8/crm_master.* %exclude %{_mandir}/man8/fence_legacy.* %exclude %{_mandir}/man8/pacemakerd.* %exclude %{_mandir}/man8/pacemaker-remoted.* %license licenses/GPLv2 %doc COPYING %doc ChangeLog %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/blackbox %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cores %dir %attr (770, %{uname}, %{gname}) %{_var}/log/pacemaker %dir %attr (770, %{uname}, %{gname}) %{_var}/log/pacemaker/bundles %files libs %{_libdir}/libcib.so.* %{_libdir}/liblrmd.so.* %{_libdir}/libcrmservice.so.* %{_libdir}/libcrmcommon.so.* %{_libdir}/libpe_status.so.* %{_libdir}/libpe_rules.so.* %{_libdir}/libpacemaker.so.* %{_libdir}/libstonithd.so.* %license licenses/LGPLv2.1 %doc COPYING %doc ChangeLog %files cluster-libs %{_libdir}/libcrmcluster.so.* %license licenses/LGPLv2.1 %doc COPYING %doc ChangeLog %files remote %config(noreplace) %{_sysconfdir}/sysconfig/pacemaker %if %{defined _unitdir} # state directory is shared between the subpackets # let rpm take care of removing it once it isn't # referenced anymore and empty %ghost %dir %{_localstatedir}/lib/rpm-state/%{name} %{_unitdir}/pacemaker_remote.service %else %{_initrddir}/pacemaker_remote %endif %{_sbindir}/pacemaker-remoted %if %{with legacy_links} %{_sbindir}/pacemaker_remoted %endif %{_mandir}/man8/pacemaker-remoted.* %license licenses/GPLv2 %doc COPYING %doc ChangeLog %files doc %doc %{pcmk_docdir} %license licenses/CC-BY-SA-4.0 %files cts %{python_site}/cts %{_datadir}/pacemaker/tests %{_libexecdir}/pacemaker/cts-log-watcher %{_libexecdir}/pacemaker/cts-support %license licenses/GPLv2 %doc COPYING %doc ChangeLog %files libs-devel %{_includedir}/pacemaker %{_libdir}/*.so %if %{with coverage} %{_var}/lib/pacemaker/gcov %endif %{_libdir}/pkgconfig/*.pc %license licenses/LGPLv2.1 %doc COPYING %doc ChangeLog %files schemas %license licenses/GPLv2 %dir %{_datadir}/pacemaker %{_datadir}/pacemaker/*.rng %{_datadir}/pacemaker/*.xsl %{_datadir}/pacemaker/api %{_datadir}/pkgconfig/pacemaker-schemas.pc %changelog +* PACKAGE_DATE ClusterLabs <admin@clusterlabs.org> PACKAGE_VERSION-1 + - See included ChangeLog file for details diff --git a/rpmlintrc b/rpm/rpmlintrc similarity index 100% rename from rpmlintrc rename to rpm/rpmlintrc