# https://ambari.apache.org/docs/3.0.0/ambari-dev/building-from-source # build environment should be Red Hat Name: ambari Version: 3.0.0 Release: 1.9%{?dist} Summary: Apache Ambari, Apache Ambari Infra and Apache Ambari Metrics License: Apache-2.0 URL: https://ambari.apache.org %global debug_package %{nil} # --- Ambari main -------------------------------------------------------------- %global main_baseurl https://archive.apache.org/dist/ambari/ambari-%{version} %global main_archive_name apache-ambari-%{version}-src %global main_archive_file %{main_archive_name}.tar.gz %global main_sig_file %{main_archive_file}.asc Source0: %{main_baseurl}/%{main_archive_file} Source1: %{main_baseurl}/%{main_sig_file} Source2: https://raw.githubusercontent.com/apache/ambari/refs/heads/trunk/KEYS # AMBARI-26517: Avoid printing password during DB connection check Source3: https://github.com/apache/ambari/pull/4025.patch # AMBARI-26552: Upgrade service version to Bigtop 3.4.0 Source4: https://github.com/apache/ambari/pull/4078.patch # AMBARI-26555: Password leaked for configurations at stack root Source5: https://github.com/apache/ambari/pull/4086.patch # AMBARI-26569 Added fix for two-way ssl Source6: https://github.com/apache/ambari/pull/4112.patch # Update Node.js download URL to HTTPS Source7: https://github.com/apache/ambari/pull/4119.patch # --- Ambari Infra snapshot ---------------------------------------------------- # snapshot from master # no 3.0 release has been cut yet %global infra_commit cc48de866cf5e0a2c71b7f190cba91390b3d1339 %global infra_commit_short %(echo %{infra_commit} | cut -c1-7) %global infra_archive_name ambari-infra-%{infra_commit} Source8: https://github.com/apache/ambari-infra/archive/%{infra_commit}.tar.gz # AMBARI-25595: Update pom.xml to use https while downloading from spring-milestones Source9: https://github.com/apache/ambari-infra/pull/26.patch # Use https to download solr tarball Source10: https://github.com/apache/ambari-infra/pull/62.patch # Retire Hortonworks repository Source11: https://github.com/apache/ambari-infra/pull/63.patch # experimental # Bump Zookeeper, Hadoop, Ambari-Metrics versions Source12: https://github.com/me-enterprise/ambari-infra/commit/0b7126bc76d5572f42672a73149bd1fdaf3a6954.patch # --- Ambari Metrics ----------------------------------------------------------- # snapshot from master # not using 3.0 release in order to benefit from dependency bumps %global metrics_commit b1ac7d78d73818ae896bff279ef7d3f27ef76741 %global metrics_commit_short %(echo %{metrics_commit} | cut -c1-7) %global metrics_archive_name ambari-metrics-%{metrics_commit} Source13: https://github.com/apache/ambari-metrics/archive/%{metrics_commit}.tar.gz # AMBARI-26550: Upgrade httpclient to resolve CVE-2020-13956 # AMBARI-26550: Upgrade httpclient to resolve CVE-2020-13956 Source14: https://github.com/apache/ambari-metrics/pull/172.patch # experimental # Bump HBase, Phoenix, Zookeeper, Hadoop, Kafka versions Source15: https://github.com/me-enterprise/ambari-metrics/commit/d05f8bf5a454c62b48ac97ad4ab576b139203ba6.patch # --- Common ------------------------------------------------------------------- BuildRequires: python3 BuildRequires: python3-devel BuildRequires: python-unversioned-command BuildRequires: java-17-openjdk-devel BuildRequires: java-1.8.0-openjdk-devel BuildRequires: maven BuildRequires: nodejs BuildRequires: npm BuildRequires: snappy-devel BuildRequires: rpm-build BuildRequires: gcc BuildRequires: git BuildRequires: gpgverify BuildRequires: make #BuildArch: noarch %description Apache Ambari is a tool for provisioning, managing, and monitoring Apache Hadoop clusters. This package also builds Apache Ambari Infra, a core shared service used by Ambari managed components, and Ambari Metrics System, a system for collecting, aggregating, serving and visualizing daemon and system metrics in Ambari-managed clusters. # --- Sub-package with Maven repository ---------------------------------------- %package m2 Summary: Maven repository for Ambari. %description m2 This subpackage contains the Maven repository (.m2) for Ambari. %prep # --- Ambari main: verify signature and checksums, then unpack ----------------- %{gpgverify} --keyring=%{SOURCE2} --signature=%{SOURCE1} --data=%{SOURCE0} echo "b40d39b21404d8caf5fb015507ac92739c93fa0fce1a2e44fcb1a1f7589da11d59376cf6f99060ad4a93bbc21dac039ca0d615f1ba452275e96c8c2493ceb8e0 %{SOURCE3}" | sha512sum -c - echo "4cad260fb5b1d47a78ed54c6e03231e77b2263793a51b84ce202cd0b2fab21c207f8013e3c3bdc3c8affdc37b4c217f90f0c293bf04d9a443b2f0141e09f200a %{SOURCE4}" | sha512sum -c - echo "bc61c723e37e245ee8d7158c0cb5ab25613cc7cda1f4eaaea34812e4849b6878915a0675efb47a9646ae4aaeec39a17cdf451396d4f29892aaaeaf45f1fdb161 %{SOURCE5}" | sha512sum -c - echo "2c3430eeb3e32dc530b9b2d134000d523fd7128862f66ed30e1955f4f11f1dbd4596088ad0c4beb2f90e06eed55c5152331a03ac5ebd42e98e2b1fda6db9f1f4 %{SOURCE6}" | sha512sum -c - echo "b79cc752b6450ebbd408629fe8e45d76cadbe8b08773769747ad8d301818294b20d315b1dd212b97914a2ec6410705bb6349d18e446acc9d780e8e84afc3ad4a %{SOURCE7}" | sha512sum -c - %setup -q -n %{main_archive_name} # apply the Ambari patches patch -p1 < %{SOURCE3} patch -p1 < %{SOURCE4} patch -p1 < %{SOURCE5} patch -p1 < %{SOURCE6} patch -p1 < %{SOURCE7} # more projects to come # go back to %{_builddir} cd %{_builddir} # --- Ambari Infra: verify checksum, then unpack ------------------------------- echo "3b14815236d37d85e73d7ac5738446747702e6bf45c7dbad87a40c656462671bb9d406272c52cc1d032c35227515c5bf73c4478a0b3d4920cea9e1030abff47e %{SOURCE8}" | sha512sum -c - echo "dd91b3e7880bf80a168ab8b058ef45f6d4ae96369baeb160b7e79643d80de6595549dc79151e86ea35f119f470f241e20a6d75c27e178b5ad84c081f298f9775 %{SOURCE9}" | sha512sum -c - echo "977413c3b27421633a367bd5e488c60b9c678d136d37df330d9a0e60a3ae2b7667f21ffcef4d9579c9b0adc55ce9a5c8a2d01d59c9e06a04703c660f542596ab %{SOURCE10}" | sha512sum -c - echo "032d9b59f006132372a3ee49a74f717b61973f2f14e98f8078c0a18d6fba0ed863c5337e4cc42adb589c222f04b706e50331ccc1997a751dd333ab02fde6bd89 %{SOURCE11}" | sha512sum -c - echo "4f66f8cd0aeae04c29c16e7e7b427b48d3605bb47a8415dba67b81f3ab5eb7ac99dce3fdcc9b56344515bc198dff3c84b9030fb779c79e22c2d8a0c28ce06d08 %{SOURCE12}" | sha512sum -c - rm -rf %{infra_archive_name} # remove leftovers from previous build if any tar -xzf %{SOURCE8} # apply the Ambari Infra patches pushd %{infra_archive_name} patch -p1 < %{SOURCE9} patch -p1 < %{SOURCE10} patch -p1 < %{SOURCE11} patch -p1 < %{SOURCE12} popd # --- Ambari Metrics: verify checksum, then unpack --------------- echo "eefbae1b18a5653587e50c2189e727f97c090da13878cf07703a9f51010e107b6236cf3e0263bb83497bea1e39a7f4eefc38ffbaa99d0ed5d2198ea9866e8021 %{SOURCE13}" | sha512sum -c - echo "8c8ebe8875a16cce27621bb434747eec5feef0cdd5be0a95cd41ed151fca34b327a5404779438bfbfe73ad834db100e0f65367c1067f47c5297b48811af4b339 %{SOURCE14}" | sha512sum -c - echo "5b5a71bbac047ad07c6d7122c07dab6d5b9d7d1dcc322ee9bbfef39f8c3f02749c9c1b3a5818cad3ce8896e4b860b6dd18549318613f64bf83d79df0b48953d9 %{SOURCE15}" | sha512sum -c - rm -rf %{metrics_archive_name} tar -xzf %{SOURCE13} # apply the Ambari Metrics patches pushd %{metrics_archive_name} patch -p1 < %{SOURCE14} patch -p1 < %{SOURCE15} popd %build # shared Maven repository export MAVEN_OPTS="-Dmaven.repo.local=%{_builddir}/.m2" # --- Build Ambari (requires Java 17, Node.js, npm, Maven) --------------------- ( cd %{_builddir}/%{main_archive_name} export JAVA_HOME=/usr/lib/jvm/java-17-openjdk export PATH="$JAVA_HOME/bin:$PATH" # set a dummy buildNumber (or the /usr/sbin/ambari-server wrapper script will fail) # ensure npm is downloaded using TLS # skip parallel execution (some plugins are not thread-safe) # the actual packaging is driven by Maven, using spec files provided by upstream mvn -e -B clean install package rpm:rpm \ -DbuildNumber=0 \ -DnpmDownloadRoot="https://registry.npmjs.org/npm/-/" \ -Drat.skip=true \ -DskipTests \ -Dmaven.test.skip=true \ -Dfindbugs.skip=true \ -Dcheckstyle.skip=true ) # --- Build Ambari Metrics (requires Java 8, Maven) ---------------------------- ( cd %{_builddir}/%{metrics_archive_name} export JAVA_HOME=/usr/lib/jvm/java-1.8.0 export PATH="$JAVA_HOME/bin:$PATH" # skip parallel execution (some plugins are not thread-safe) # the actual packaging is driven by Maven, using spec files provided by upstream mvn -e -B clean install -DskipTests -Dbuild-rpm # this one is a consequence of patching Source11 into Ambari Infra: # install freshly built ambari-metrics-common library in Maven repo # or the following Ambari Infra build will fail cd / metrics_common_jar_version="3.1.0-SNAPSHOT" metrics_common_jar="%{_builddir}/%{metrics_archive_name}/ambari-metrics-common/target/ambari-metrics-common-${metrics_common_jar_version}.jar" mvn -q -B install:install-file \ -Dfile="${metrics_common_jar}" \ -DgroupId=org.apache.ambari \ -DartifactId=ambari-metrics-common \ -Dversion="$metrics_common_jar_version" \ -Dpackaging=jar ) # --- Build Ambari Infra (requires Java 8, Maven, make) ------------------------ ( cd %{_builddir}/%{infra_archive_name} export JAVA_HOME=/usr/lib/jvm/java-1.8.0 export PATH="$JAVA_HOME/bin:$PATH" # Makefile expects a git repo; provide GIT_REV_SHORT on command line make rpm GIT_REV_SHORT=%{infra_commit_short} ) # --- Collect all generated RPMs ----------------------------------------------- # Ambari server/agent RPMs cp %{_builddir}/%{main_archive_name}/ambari-server/target/rpm/ambari-server/RPMS/*.rpm %{_rpmdir}/ cp %{_builddir}/%{main_archive_name}/ambari-agent/target/rpm/ambari-agent/RPMS/*.rpm %{_rpmdir}/ # Ambari Infra RPMs cp %{_builddir}/%{infra_archive_name}/ambari-infra-assembly/target/rpm/*/RPMS/*.rpm %{_rpmdir}/ # Ambari Metrics RPMs find %{_builddir}/%{metrics_archive_name} -type f -name "*.rpm" -exec cp -- {} %{_rpmdir}/ \; # --- Sub-package with Maven repository ---------------------------------------- %install install -d -m 0755 %{buildroot}%{_datadir}/ambari tar -C %{_builddir} -czf %{buildroot}%{_datadir}/ambari/m2.tar.gz .m2 %files m2 %attr(0755,root,root) %dir %{_datadir}/ambari %attr(0644,root,root) %{_datadir}/ambari/m2.tar.gz # --- Common changelog --------------------------------------------------------- %changelog * Tue Jun 23 2026 Christiane Weber - 3.0.0-1.9 - added Patch AMBARI-26569 Added fix for two-way ssl * Mon Jun 01 2026 Detlef Eppers - 3.0.0-1.8 - Match Bigtop 3.3 versions in Ambari Infra and Metrics - Download npm using TLS * Tue May 26 2026 Detlef Eppers - 3.0.0-1.7 - Maven repository subpackage * Tue May 26 2026 Detlef Eppers - 3.0.0-1.6 - Prevent unencrypted http connections during Ambari infra build * Sat May 23 2026 Detlef Eppers - 3.0.0-1.5 - Consolidate ambari metrics into ambari spec file * Sat May 23 2026 Detlef Eppers - 3.0.0-1.4 - Download URL changed to archive.apache.org * Fri May 22 2026 Detlef Eppers - 3.0.0-1.3 - Consolidate Ambari main and Ambari infra into one spec file * Wed May 20 2026 Detlef Eppers - 3.0.0-1.2 - Patches (Source3-6) * Fri Apr 10 2026 Detlef Eppers - 3.0.0-1.1 - Update email address, comments * Thu Apr 02 2026 Detlef Eppers - 3.0.0-1.0 - Initial version