summaryrefslogtreecommitdiffstats
path: root/rpm
diff options
context:
space:
mode:
Diffstat (limited to 'rpm')
-rw-r--r--rpm/Makefile.am62
-rw-r--r--rpm/pacemaker.spec.in19
2 files changed, 41 insertions, 40 deletions
diff --git a/rpm/Makefile.am b/rpm/Makefile.am
index c7975e4..2388ad6 100644
--- a/rpm/Makefile.am
+++ b/rpm/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2003-2022 the Pacemaker project contributors
+# Copyright 2003-2023 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
@@ -12,7 +12,7 @@
# used in this file.
top_srcdir ?= ..
abs_srcdir ?= $(shell pwd)
-abs_builddir ?= $(abs_srcdir)
+abs_builddir ?= $(abs_srcdir)
MAKE ?= make
PACKAGE ?= pacemaker
AM_V_at ?= @
@@ -21,9 +21,13 @@ MKDIR_P ?= mkdir -p
include $(top_srcdir)/mk/common.mk
include $(top_srcdir)/mk/release.mk
-EXTRA_DIST = pacemaker.spec.in \
+EXTRA_DIST = pacemaker.spec.in \
rpmlintrc
+# Extra options to pass to rpmbuild (this can be used to override the location
+# options this file normally passes, or to override macros used by the spec)
+RPM_EXTRA ?=
+
# Where to put RPM artifacts; possible values:
#
# - subtree (default): RPM sources (i.e. TARFILE) in top-level build directory,
@@ -68,7 +72,7 @@ RPMTYPE = $(shell case "$(RPMDEST)" in \
esac)
RPM_SPEC_DIR = $(RPM_SPEC_DIR_$(RPMTYPE))
RPM_SRCRPM_DIR = $(RPM_SRCRPM_DIR_$(RPMTYPE))
-RPM_OPTS = $(RPM_OPTS_$(RPMTYPE))
+RPM_OPTS = $(RPM_OPTS_$(RPMTYPE)) $(RPM_EXTRA)
RPM_CLEAN = $(RPM_CLEAN_$(RPMTYPE))
WITH ?= --without doc
@@ -90,7 +94,7 @@ SPEC_COMMIT ?= $(shell \
Pacemaker-*|DIST$(rparen) \
echo '$(TAG)' ;; \
*$(rparen) \
- git log --pretty=format:%h -n 1 '$(TAG)';; \
+ "$(GIT)" log --pretty=format:%h -n 1 '$(TAG)';; \
esac)$(DIRTY_EXT)
SPEC_ABBREV = $(shell printf %s '$(SPEC_COMMIT)' | wc -c)
SPEC_RELEASE = $(shell case "$(WITH)" in \
@@ -115,6 +119,7 @@ TARFILE = $(abs_builddir)/../$(top_distdir).tar.gz
# Create a source distribution based on a git archive. (If we aren't in a git
# checkout, do a make dist instead.)
+.PHONY: export
export:
cd $(abs_srcdir)/..; \
if [ -z "$(CHECKOUT)" ] && [ -f "$(TARFILE)" ]; then \
@@ -123,35 +128,40 @@ export:
$(MAKE) $(AM_MAKEFLAGS) dist; \
echo "`date`: Rebuilt tarball: $(TARFILE)"; \
elif [ -n "$(DIRTY_EXT)" ]; then \
- git commit -m "DO-NOT-PUSH" -a; \
- git archive --prefix=$(top_distdir)/ -o "$(TARFILE)" HEAD^{tree}; \
- git reset --mixed HEAD^; \
+ "$(GIT)" commit -m "DO-NOT-PUSH" -a; \
+ "$(GIT)" archive --prefix=$(top_distdir)/ -o "$(TARFILE)" \
+ HEAD^{tree}; \
+ "$(GIT)" reset --mixed HEAD^; \
echo "`date`: Rebuilt $(TARFILE)"; \
elif [ -f "$(TARFILE)" ]; then \
echo "`date`: Using existing tarball: $(TARFILE)"; \
else \
- git archive --prefix=$(top_distdir)/ -o "$(TARFILE)" $(TAG)^{tree}; \
+ "$(GIT)" archive --prefix=$(top_distdir)/ -o "$(TARFILE)" \
+ $(TAG)^{tree}; \
echo "`date`: Rebuilt $(TARFILE)"; \
fi
# Depend on spec-clean so the spec gets rebuilt every time
$(RPM_SPEC_DIR)/$(PACKAGE).spec: spec-clean pacemaker.spec.in
$(AM_V_at)$(MKDIR_P) "$(RPM_SPEC_DIR)"
- $(AM_V_GEN)if [ x"`git ls-files -m pacemaker.spec.in 2>/dev/null`" != x ]; then \
- cat "$(abs_srcdir)/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)/pacemaker.spec.in"; \
- fi | sed \
- -e 's/^\(%global pcmkversion \).*/\1$(SPEC_RELEASE_NO)/' \
- -e 's/^\(%global specversion \).*/\1$(SPECVERSION)/' \
- -e 's/^\(%global commit \).*/\1$(SPEC_COMMIT)/' \
- -e 's/^\(%global commit_abbrev \).*/\1$(SPEC_ABBREV)/' \
- -e "s/PACKAGE_DATE/$$(date +'%a %b %d %Y')/" \
- -e 's/PACKAGE_VERSION/$(SPEC_RELEASE_NO)-$(SPECVERSION)/' \
+ $(AM_V_GEN)if [ x"`"$(GIT)" ls-files \
+ -m pacemaker.spec.in 2>/dev/null`" != x ]; then \
+ cat "$(abs_srcdir)/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)/pacemaker.spec.in"; \
+ fi | sed \
+ -e 's/^\(%global pcmkversion \).*/\1$(SPEC_RELEASE_NO)/' \
+ -e 's/^\(%global specversion \).*/\1$(SPECVERSION)/' \
+ -e 's/^\(%global commit \).*/\1$(SPEC_COMMIT)/' \
+ -e 's/^\(%global commit_abbrev \).*/\1$(SPEC_ABBREV)/' \
+ -e "s/PACKAGE_DATE/$$(date +'%a %b %d %Y')/" \
+ -e 's/PACKAGE_VERSION/$(SPEC_RELEASE_NO)-$(SPECVERSION)/' \
> "$@"
.PHONY: spec $(PACKAGE).spec
@@ -200,7 +210,7 @@ rc:
echo 'This target must be run from a git checkout'; \
exit 1; \
fi
- $(MAKE) $(AM_MAKEFLAGS) TAG="$$(git tag -l 2>/dev/null \
+ $(MAKE) $(AM_MAKEFLAGS) TAG="$$("$(GIT)" tag -l 2>/dev/null \
| sed -n -e 's/^\(Pacemaker-[0-9.]*-rc[0-9]*\)$$/\1/p' \
| sort -Vr | head -n 1)" rpm
@@ -251,6 +261,7 @@ mock-clean:
-rm -rf "$(MOCK_DIR)"
# Make debugging makefile issues easier
+.PHONY: vars
vars:
@echo "CHECKOUT=$(CHECKOUT)"
@echo "VERSION=$(VERSION)"
@@ -278,5 +289,6 @@ vars:
@echo "SPEC_RELEASE_NO=$(SPEC_RELEASE_NO)"
@echo "TARFILE=$(TARFILE)"
+.PHONY: clean-local
clean-local: mock-clean rpm-clean
-rm -f "$(TARFILE)"
diff --git a/rpm/pacemaker.spec.in b/rpm/pacemaker.spec.in
index 7fb27e4..c279f88 100644
--- a/rpm/pacemaker.spec.in
+++ b/rpm/pacemaker.spec.in
@@ -321,7 +321,7 @@ BuildRequires: sed
# Required for core functionality
BuildRequires: pkgconfig(glib-2.0) >= 2.42
-BuildRequires: libxml2-devel
+BuildRequires: libxml2-devel >= 2.6.0
BuildRequires: libxslt-devel
BuildRequires: libuuid-devel
BuildRequires: %{pkgname_bzip2_devel}
@@ -336,7 +336,7 @@ BuildRequires: pam-devel
BuildRequires: %{pkgname_gettext} >= 0.18
# Required for "make check"
-BuildRequires: libcmocka-devel
+BuildRequires: libcmocka-devel >= 1.1.0
%if %{systemd_native}
BuildRequires: pkgconfig(systemd)
@@ -486,7 +486,7 @@ Requires: libqb-devel%{?_isa}
Requires: %{?pkgname_libtool_devel_arch}
%endif
Requires: libuuid-devel%{?_isa}
-Requires: libxml2-devel%{?_isa}
+Requires: libxml2-devel%{?_isa} >= 2.6.0
Requires: libxslt-devel%{?_isa}
%description -n %{pkgname_pcmk_libs}-devel
@@ -633,14 +633,6 @@ mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/rpm-state/%{name}
# Don't package libtool archives
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
-# 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
-
%post
%if %{defined _unitdir}
%systemd_post pacemaker.service
@@ -772,7 +764,6 @@ exit 0
%exclude %{_sbindir}/pacemaker_remoted
%{_libexecdir}/pacemaker/*
-%{_sbindir}/crm_master
%if %{with stonithd}
%{_sbindir}/fence_legacy
%endif
@@ -784,7 +775,6 @@ exit 0
%doc %{_mandir}/man7/ocf_pacemaker_controld.*
%doc %{_mandir}/man7/ocf_pacemaker_o2cb.*
%doc %{_mandir}/man7/ocf_pacemaker_remote.*
-%doc %{_mandir}/man8/crm_master.*
%if %{with stonithd}
%doc %{_mandir}/man8/fence_legacy.*
%endif
@@ -830,6 +820,7 @@ exit 0
%{_sbindir}/crm_diff
%{_sbindir}/crm_error
%{_sbindir}/crm_failcount
+%{_sbindir}/crm_master
%{_sbindir}/crm_mon
%{_sbindir}/crm_node
%{_sbindir}/crm_resource
@@ -865,7 +856,6 @@ exit 0
%exclude %{_mandir}/man7/ocf_pacemaker_o2cb.*
%exclude %{_mandir}/man7/ocf_pacemaker_remote.*
%doc %{_mandir}/man8/crm*.8.gz
-%exclude %{_mandir}/man8/crm_master.*
%doc %{_mandir}/man8/attrd_updater.*
%doc %{_mandir}/man8/cibadmin.*
%if %{with cibsecrets}
@@ -935,7 +925,6 @@ exit 0
%license licenses/CC-BY-SA-4.0
%files cts
-%{python_site}/cts
%{python3_sitelib}/pacemaker/_cts/
%{_datadir}/pacemaker/tests