Name: test Version: 3.3.0 Release: 1%{?dist} Summary: Build-service wrapper that builds Apache Bigtop Hadoop RPMs via Gradle License: Apache-2.0 URL: https://bigtop.apache.org %global debug_package %{nil} # --- Bigtop source ------------------------------------------------------------ %global bigtop_ref rel/3.3.0 %global bigtop_ref_sanitized rel-3.3.0 %global bigtop_archive_name bigtop-%{bigtop_ref_sanitized} # Relative path (within the Hadoop source tree) of the YARN Application # Catalog webapp module. Excluded from the Maven reactor in %prep — see the # do-component-build patch below for why. %global catalog_webapp_path hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-catalog/hadoop-yarn-applications-catalog-webapp Source0: https://github.com/apache/bigtop/archive/refs/tags/%{bigtop_ref}.tar.gz # BIGTOP-4063: Adapt bigtop-select to Python 3 Source1: https://github.com/apache/bigtop/commit/ebed06df36023889f5c61515688d190f681ac83d.patch # --- Build arch --------------------------------------------------------------- BuildArch: noarch # --- Build requirements ------------------------------------------------------- # Core toolchain BuildRequires: java-1.8.0-openjdk-devel BuildRequires: java-11-openjdk-devel # Build tools BuildRequires: autoconf BuildRequires: automake BuildRequires: cmake BuildRequires: curl BuildRequires: diffutils BuildRequires: findutils BuildRequires: gawk BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: git BuildRequires: gzip BuildRequires: hostname BuildRequires: libtool BuildRequires: make BuildRequires: nasm BuildRequires: patch BuildRequires: rsync BuildRequires: tar BuildRequires: unzip BuildRequires: wget BuildRequires: yasm # Documentation tools BuildRequires: asciidoc BuildRequires: xmlto # Compression / archive libraries BuildRequires: bzip2-devel BuildRequires: libzstd-devel BuildRequires: lzo-devel BuildRequires: snappy-devel BuildRequires: zlib-devel BuildRequires: zstd # Crypto / auth BuildRequires: cyrus-sasl-devel BuildRequires: krb5-devel BuildRequires: openldap-devel BuildRequires: openssl-devel # Network / RPC BuildRequires: libcurl-devel BuildRequires: libtirpc-devel # FUSE BuildRequires: fuse BuildRequires: fuse-devel BuildRequires: fuse-libs BuildRequires: fuse3 BuildRequires: fuse3-devel BuildRequires: fuse3-libs # Miscellaneous devel BuildRequires: boost-devel BuildRequires: bison BuildRequires: cppunit-devel BuildRequires: flex BuildRequires: gmp-devel BuildRequires: libffi-devel BuildRequires: libevent-devel BuildRequires: libuuid-devel BuildRequires: libxml2-devel BuildRequires: libxslt-devel BuildRequires: libyaml-devel BuildRequires: mariadb-connector-c-devel BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: sqlite-devel BuildRequires: xfsprogs-devel # Python BuildRequires: python3 BuildRequires: python3-devel BuildRequires: python3-flake8 BuildRequires: python3-setuptools BuildRequires: python3-wheel # Perl helpers BuildRequires: perl-Digest-SHA BuildRequires: perl-FindBin # RPM / repo tooling BuildRequires: createrepo BuildRequires: net-tools BuildRequires: redhat-rpm-config BuildRequires: rpm-build %description This package is a COPR build wrapper to run Apache Bigtop's Gradle packaging entry point for Hadoop (hadoop-pkg) and export generated RPMs. It emulates the Bigtop Puppet toolchain bootstrap without root or container access, as required by Fedora COPR's rootless build environment. The spec follows the Ambari Bigtop Stack build guide: https://ambari.apache.org/docs/3.0.0/ambari-dev/bigtop-guide # ============================================================================= %prep # ============================================================================= %setup -q -n %{bigtop_archive_name} case "%{bigtop_ref}" in branch-3.3|rel/3.3.*) cat > /tmp/bigtop-select-py3-fix.sh <<'EOF' #!/bin/bash set -e base="bigtop-packages/src/common/bigtop-select" sed -i '1 s|python2|python3|' "${base}/conf-select" sed -i '1 s|python2|python3|' "${base}/distro-select" sed -i 's|#!/usr/bin/env python2|#!/usr/bin/env python3|' "${base}/install_select.sh" sed -i 's| packages.sort()| packages = sorted(packages)|g' "${base}/distro-select" sed -i 's| groups = aliases.keys()| groups = sorted(aliases.keys())|g' "${base}/distro-select" sed -i 's| keys = result.keys()| keys = sorted(result.keys())|g' "${base}/distro-select" sed -i 's| os.mkdir(current, 0755)| os.mkdir(current, 0o755)|g' "${base}/distro-select" perl -0pi -e 's/ packages = leaves\.keys\(\)\n packages = sorted\(packages\)/ packages = sorted(leaves.keys())/g' "${base}/distro-select" perl -0pi -e 's/ groups = sorted\(aliases\.keys\(\)\)\n groups.sort\(\)/ groups = sorted(aliases.keys())/g' "${base}/distro-select" perl -0pi -e 's/ keys = sorted\(result\.keys\(\)\)\n keys.sort\(\)/ keys = sorted(result.keys())/g' "${base}/distro-select" EOF bash /tmp/bigtop-select-py3-fix.sh rm -f /tmp/bigtop-select-py3-fix.sh ;; esac # --------------------------------------------------------------------------- # Patch do-component-build: exclude the YARN Application Catalog webapp from # Maven invocations. # # hadoop-yarn-applications-catalog-webapp fails because its # frontend-maven-plugin pins Node.js 12.22.1, while the transitive npm # dependency color@5.0.3 requires Node>=18. It's an optional self-service UI # for deploying YARN Services, not required for core HDFS/YARN/MapReduce or # Ambari integration. # # The exclusion is baked directly into do-component-build's two "mvn" lines # (install, and site site:stage — javadoc aggregation in the latter also # walks into the catalog webapp module) via -pl !. We deliberately do # NOT use a global EXTRA_GOALS environment variable here: Gradle's exec # inherits the calling environment, and EXTRA_GOALS is a generic passthrough # consumed by many other components' do-component-build scripts (e.g. Hive). # A global export would leak this hadoop-specific exclusion into those # unrelated builds and break them with "Could not find the selected project # in the reactor". Keeping the patch local to hadoop's own do-component-build # avoids that entirely. # --------------------------------------------------------------------------- sed -i \ -e 's|install ${EXTRA_GOALS} "$@"|install -pl !%{catalog_webapp_path} ${EXTRA_GOALS} "$@"|' \ -e 's|site:stage ${MAVEN_OPTS} $@|site:stage ${MAVEN_OPTS} -pl !%{catalog_webapp_path} $@|' \ bigtop-packages/src/common/hadoop/do-component-build # Sanity check: save time and fail fast in %prep if either pattern wasn't found (e.g. # upstream do-component-build changed) rather than silently building an # unpatched copy. Use fixed-string grep to avoid regex/anchor pitfalls # with the '$' characters in these substrings. grep -qF -- 'install -pl !%{catalog_webapp_path} ${EXTRA_GOALS} "$@"' \ bigtop-packages/src/common/hadoop/do-component-build grep -qF -- 'site:stage ${MAVEN_OPTS} -pl !%{catalog_webapp_path} $@' \ bigtop-packages/src/common/hadoop/do-component-build # --------------------------------------------------------------------------- # Patch inner Ranger spec so it patches schema-registry assembly during Ranger %prep # --------------------------------------------------------------------------- cat > /tmp/bigtop-ranger-spec-schema-license.patch <<'PATCH' --- bigtop-packages/src/rpm/ranger/SPECS/ranger.spec +++ bigtop-packages/src/rpm/ranger/SPECS/ranger.spec @@ -424,1 +424,3 @@ #BIGTOP_PATCH_COMMANDS +# Inject LICENSE file into schema-registry distro jar +sed -i '/false/a${project.basedir}/../LICENSE.txt/META-INFLICENSE' distro/src/main/assembly/plugin-schema-registry.xml PATCH tr -d '\r' < /tmp/bigtop-ranger-spec-schema-license.patch > /tmp/bigtop-ranger-spec-schema-license.patch.lf patch -p0 < /tmp/bigtop-ranger-spec-schema-license.patch.lf # ============================================================================= %build # ============================================================================= # --------------------------------------------------------------------------- # Locale # --------------------------------------------------------------------------- export LANG=C export LC_ALL=C # --------------------------------------------------------------------------- # Java selection # --------------------------------------------------------------------------- export JAVA_HOME=/usr/lib/jvm/java-1.8.0 export PATH="$JAVA_HOME/bin:$PATH" export BIGTOP_JDK=8 export BIGTOP_PREFERRED_JAVA_VERSION=8 # --------------------------------------------------------------------------- # Toolchain bootstrap # # Puppet manifests (gradle.pp, groovy.pp, maven.pp, ant.pp, isal.pp) normally # run as root and install under /usr/local. COPR forbids root, so we install # everything under $TOOLCHAIN_HOME inside the build directory instead and # adjust PATH / environment variables accordingly. # --------------------------------------------------------------------------- export TOOLCHAIN_HOME=%{_builddir}/toolchain export MAVEN_HOME="$TOOLCHAIN_HOME/maven" export ANT_HOME="$TOOLCHAIN_HOME/ant" export GROOVY_HOME="$TOOLCHAIN_HOME/groovy" export PROTOBUF_HOME="$TOOLCHAIN_HOME/protobuf" export ISAL_HOME="$TOOLCHAIN_HOME/isal" mkdir -p "$TOOLCHAIN_HOME" # Versions — keep in sync with bigtop_toolchain/manifests/*.pp MAVEN_VERSION=3.9.11 ANT_VERSION=1.9.16 GROOVY_VERSION=4.0.24 PROTOBUF_VERSION=3.7.1 ISAL_VERSION=2.31.0 # -- Maven (maven.pp) ---------------------------------------------------------- echo "--- Bootstrapping Maven ${MAVEN_VERSION} ---" curl -fL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" \ -o "%{_builddir}/apache-maven-${MAVEN_VERSION}-bin.tar.gz" mkdir -p "$MAVEN_HOME" tar -xzf "%{_builddir}/apache-maven-${MAVEN_VERSION}-bin.tar.gz" \ -C "$MAVEN_HOME" --strip-components=1 # -- Ant (ant.pp) -------------------------------------------------------------- echo "--- Bootstrapping Ant ${ANT_VERSION} ---" curl -fL "https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz" \ -o "%{_builddir}/apache-ant-${ANT_VERSION}-bin.tar.gz" mkdir -p "$ANT_HOME" tar -xzf "%{_builddir}/apache-ant-${ANT_VERSION}-bin.tar.gz" \ -C "$ANT_HOME" --strip-components=1 # -- Groovy (groovy.pp) -------------------------------------------------------- echo "--- Bootstrapping Groovy ${GROOVY_VERSION} ---" curl -fL "https://archive.apache.org/dist/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip" \ -o "%{_builddir}/apache-groovy-binary-${GROOVY_VERSION}.zip" mkdir -p "$GROOVY_HOME" unzip -q "%{_builddir}/apache-groovy-binary-${GROOVY_VERSION}.zip" \ -d "%{_builddir}/groovy-tmp" mv "%{_builddir}/groovy-tmp"/groovy-"${GROOVY_VERSION}"/* "$GROOVY_HOME/" rm -rf "%{_builddir}/groovy-tmp" # -- Protobuf (protobuf.pp) ---------------------------------------------------- echo "--- Bootstrapping Protobuf ${PROTOBUF_VERSION} ---" curl -fL "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v${PROTOBUF_VERSION}.tar.gz" \ -o "%{_builddir}/protobuf-${PROTOBUF_VERSION}.tar.gz" mkdir -p "%{_builddir}/protobuf-src" tar -xzf "%{_builddir}/protobuf-${PROTOBUF_VERSION}.tar.gz" \ -C "%{_builddir}/protobuf-src" --strip-components=1 pushd "%{_builddir}/protobuf-src" ./autogen.sh ./configure --prefix="$PROTOBUF_HOME" --disable-shared --with-pic make -j"$(nproc)" make install popd # -- ISA-L (isal.pp) ----------------------------------------------------------- echo "--- Bootstrapping ISA-L ${ISAL_VERSION} ---" curl -fL "https://github.com/intel/isa-l/archive/refs/tags/v${ISAL_VERSION}.tar.gz" \ -o "%{_builddir}/isa-l-${ISAL_VERSION}.tar.gz" mkdir -p "%{_builddir}/isal-src" tar -xzf "%{_builddir}/isa-l-${ISAL_VERSION}.tar.gz" \ -C "%{_builddir}/isal-src" --strip-components=1 pushd "%{_builddir}/isal-src" ./autogen.sh ./configure --prefix="$ISAL_HOME" make -j"$(nproc)" make install popd # --------------------------------------------------------------------------- # Fake sudo — Bigtop's Gradle configuration phase calls sudo in a few places # even for non-root tasks. Redirect it to /usr/bin/true so those calls # silently succeed without actually elevating privileges. # --------------------------------------------------------------------------- mkdir -p %{_builddir}/bin ln -sf /usr/bin/true %{_builddir}/bin/sudo # --------------------------------------------------------------------------- # Expose all bootstrapped tools # --------------------------------------------------------------------------- export PATH="%{_builddir}/bin:$GROOVY_HOME/bin:$MAVEN_HOME/bin:$ANT_HOME/bin:$PROTOBUF_HOME/bin:$PATH" export PKG_CONFIG_PATH="$ISAL_HOME/lib/pkgconfig:${PKG_CONFIG_PATH:-}" # --------------------------------------------------------------------------- # Cache directories # --------------------------------------------------------------------------- export GRADLE_USER_HOME=%{_builddir}/.gradle export MAVEN_OPTS="-Dmaven.repo.local=%{_builddir}/.m2 -Xmx2g -XX:ReservedCodeCacheSize=512m" export IVY_HOME=%{_builddir}/.ivy2 # Suppress the Bigtop build timestamp to keep package names deterministic. export BIGTOP_BUILD_STAMP=1 # --------------------------------------------------------------------------- # Print versions to the COPR log for easier debugging # --------------------------------------------------------------------------- echo "=== Build environment ===" java -version "$MAVEN_HOME/bin/mvn" --version "$ANT_HOME/bin/ant" -version "$GROOVY_HOME/bin/groovy" --version "$PROTOBUF_HOME/bin/protoc" --version # gradle/wrapper/gradle-wrapper.properties ./gradlew --version echo "=========================" # --------------------------------------------------------------------------- # Build # # Parameters follow the Ambari Bigtop Stack documentation: # -PparentDir installation prefix (Ambari convention: /usr/bigtop) # -PpkgSuffix appends the Bigtop version to package names # (e.g. hadoop_3_3_0) to satisfy Ambari service specs; # the flag is intentionally passed without a value — Bigtop # derives the suffix from its own version metadata # -PbuildThreads 2C = 2 × CPU cores # --------------------------------------------------------------------------- ./gradlew --no-daemon --stacktrace \ -Dbuildwithdeps=true \ -PparentDir=/usr/bigtop \ -PpkgSuffix \ -PbuildThreads=2C \ bigtop-select-pkg #hadoop-pkg \ #hbase-pkg \ #zookeeper-pkg \ #hive-pkg # --------------------------------------------------------------------------- # Export RPMs for COPR pickup # Bigtop writes output under output//; search broadly for safety. # --------------------------------------------------------------------------- find . -type f -name "*.rpm" -path "*/output/*" \ -exec cp -v -- {} %{_rpmdir}/ \; # ============================================================================= %changelog # ============================================================================= * Fri Jun 12 2026 Detlef Eppers - 3.3.0-1 - Initial build