From 606a549ef308a7fe75cafc02ff34521ddb1f19e6 Mon Sep 17 00:00:00 2001 From: "Bruce.Ma" Date: Fri, 25 Feb 2022 11:14:49 +0800 Subject: [PATCH] Add OpenHPC/ohpc-release package. --- src/OpenHPC/ohpc-release/SOURCES/OHPC_macros | 212 ++++++++++++++++++ .../SOURCES/RPM-GPG-KEY-OpenHPC-2 | 36 +++ src/OpenHPC/ohpc-release/SPECS/release.spec | 100 +++++++++ 3 files changed, 348 insertions(+) create mode 100644 src/OpenHPC/ohpc-release/SOURCES/OHPC_macros create mode 100644 src/OpenHPC/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-2 create mode 100644 src/OpenHPC/ohpc-release/SPECS/release.spec diff --git a/src/OpenHPC/ohpc-release/SOURCES/OHPC_macros b/src/OpenHPC/ohpc-release/SOURCES/OHPC_macros new file mode 100644 index 00000000..bcb86516 --- /dev/null +++ b/src/OpenHPC/ohpc-release/SOURCES/OHPC_macros @@ -0,0 +1,212 @@ +# OpenHPC build script/utilities +# +#----------------------------------------------------------------------- +# Licensed under the Apache License, Version 2.0 (the "License"); you +# may not use this file except in compliance with the License. You may +# obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +#----------------------------------------------------------------------- + +# Top-level OpenHPC installation paths +%global PROJ_NAME ohpc +%global OHPC_HOME /opt/%{PROJ_NAME} +%global OHPC_ADMIN %{OHPC_HOME}/admin +%global OHPC_PUB %{OHPC_HOME}/pub +%global OHPC_APPS %{OHPC_PUB}/apps +%global OHPC_COMPILERS %{OHPC_PUB}/compiler +%global OHPC_LIBS %{OHPC_PUB}/libs +%global OHPC_MODULES %{OHPC_PUB}/modulefiles +%global OHPC_MODULEDEPS %{OHPC_PUB}/moduledeps +%global OHPC_MPI_STACKS %{OHPC_PUB}/mpi +%global OHPC_UTILS %{OHPC_PUB}/utils +%global debug_package %{nil} +%global dist .ohpc.2.0.0 + +%{!?PROJ_DELIM: %global PROJ_DELIM -ohpc} + +DocDir: %{OHPC_PUB}/doc/contrib + +# Define PNAME which can be used in modulefile generation for env vars (derived +# from pname defined in each component .spec file) +%define PNAME %(echo %{pname} | tr [a-z] [A-Z] | tr - _) + +# Instead of having Source[1-9]: OHPC_macros in every SPEC file, +# this sets Source42 for all SPEC files which include OHPC_macros. +Source42: OHPC_macros + +# Pre-process global OS version macros for operation outside OBS +# Supports build on clone distros without requiring distro-specific +# macros defined in each specfile. +%if 0%{!?rhel_version:1} +%{?centos_version:%global rhel_version %{centos_version}} +%{?scientificlinux_version:%global rhel_version %{scientific_version}} +%if 0%{?rhel} == 7 + # OBS defines rhel_version to 700 for RHEL7 + %global rhel_version 700 +%endif # rhel=7 +%if 0%{?rhel} == 8 + # OBS defines rhel_version to 800 for RHEL8 + %global rhel_version 800 +%endif # rhel=8 +%endif # rhel_version + +# OpenHPC packages also require ohpc-buildroot to access macros used to define +# compiler and MPI families +%if 0%{!?ohpc_bootstrap:1} +Requires: ohpc-filesystem +BuildRequires: ohpc-buildroot +%endif + +# OpenHPC convention: the default build configuration for compiler/MPI +# dependent packages assumes the gnu compiler and openmpi family; however, +# these choices can be overridden by specifing the compiler_family/mpi_family +# variables via rpmbuild or other mechanisms. + +%{!?compiler_family: %global compiler_family gnu9} +%{!?mpi_family: %global mpi_family openmpi4} +%{!?python_family: %global python_family python3} + +# Compiler dependencies +%if 0%{?ohpc_compiler_dependent} == 1 + +%if "%{compiler_family}" == "gnu9" +BuildRequires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0 +Requires: gnu9-compilers%{PROJ_DELIM} >= 9.2.0 +%endif # gnu9 +%if "%{compiler_family}" == "gnu8" +BuildRequires: gnu8-compilers%{PROJ_DELIM} >= 8.3.0 +Requires: gnu8-compilers%{PROJ_DELIM} >= 8.3.0 +%endif # gnu8 + +%if "%{compiler_family}" == "intel" +%if 0%{?OHPC_BUILD} +BuildRequires: intel_licenses +BuildRequires: psxe%{PROJ_DELIM} +%endif # OHPC_BUILD +BuildRequires: gcc-c++ intel-compilers-devel%{PROJ_DELIM} +Requires: gcc-c++ intel-compilers-devel%{PROJ_DELIM} +%endif # intel + +%if "%{compiler_family}" == "arm1" +%if 0%{?OHPC_BUILD} +BuildRequires: arm_licenses +BuildRequires: arm%{PROJ_DELIM} +%endif # OHPC_BUILD +BuildRequires: arm1-compilers-devel%{PROJ_DELIM} +Requires: arm1-compilers-devel%{PROJ_DELIM} +%endif # arm + +%if "%{compiler_family}" == "llvm" +BuildRequires: llvm-compilers%{PROJ_DELIM} >= 9.0.0 +Requires: llvm-compilers%{PROJ_DELIM} >= 9.0.0 +%endif # llvm + +# Disable annobin on RHEL based systems +%if 0%{?rhel} == 8 +%undefine _annotated_build +%endif + +%endif # compiler_depdendent + +# Disable generation of .build-id links +%global _build_id_links none + +# Disable RPM symlink analysis on files in %%{OHPC_HOME}. +%global __libsymlink_exclude_path %{OHPC_HOME}/.*$ + +# MPI dependencies +%if 0%{?ohpc_mpi_dependent} == 1 +%if "%{mpi_family}" == "impi" +%if 0%{?OHPC_BUILD} +BuildRequires: impi%{PROJ_DELIM} +%endif # OHPC_BUILD +BuildRequires: intel-mpi-devel%{PROJ_DELIM} +Requires: intel-mpi-devel%{PROJ_DELIM} +%global __requires_exclude ^libmpi\\.so.*$|^libmpifort\\.so.*$|^libmpicxx\\.so.*$ +%endif # impi +%if "%{mpi_family}" == "mpich" +BuildRequires: mpich-%{compiler_family}%{PROJ_DELIM} +Requires: mpich-%{compiler_family}%{PROJ_DELIM} +%endif # mpich +%if "%{mpi_family}" == "mvapich2" +BuildRequires: mvapich2-%{compiler_family}%{PROJ_DELIM} +Requires: mvapich2-%{compiler_family}%{PROJ_DELIM} +%endif # mvapich2 +%if "%{mpi_family}" == "openmpi3" +BuildRequires: openmpi3-%{compiler_family}%{PROJ_DELIM} +Requires: openmpi3-%{compiler_family}%{PROJ_DELIM} +%endif # openmpi3 +%if "%{mpi_family}" == "openmpi4" +BuildRequires: openmpi4-%{compiler_family}%{PROJ_DELIM} +Requires: openmpi4-%{compiler_family}%{PROJ_DELIM} +%endif # openmpi4 +%endif # ohpc_mpi_dependent + +# Python dependencies and macros +%if 0%{?ohpc_python_dependent} == 1 +%global __python %__python3 +%global python_module_prefix py3- +%global python_site_dir %{python3_sitearch} +%global python_prefix python3 +%global python_lib_dir python%{python3_version} +BuildRequires: %{python_prefix}-devel +BuildRequires: %{python_prefix}-setuptools +BuildRequires: python-rpm-macros +Requires: %{python_prefix} +%endif + +# Single-line macro for running compiler/MPI setup scripts +# Script bodies are evaluated and stored in this macro definition +%global ohpc_setup_compiler %{expand:\ + %if 0%{?OHPC_CFLAGS:1} \ + export OHPC_CFLAGS=%{OHPC_CFLAGS} \ + %endif \ + %if 0%{?OHPC_CXXFLAGS:1} \ + export OHPC_CXXFLAGS=%{OHPC_CXXFLAGS} \ + %endif \ + %if 0%{?OHPC_FCFLAGS:1} \ + export OHPC_FCFLAGS=%{OHPC_FCFLAGS} \ + %endif \ + %if 0%{?OHPC_F77FLAGS:1} \ + export OHPC_F77FLAGS=%{OHPC_F77FLAGS} \ + %endif \ + . %{OHPC_ADMIN}/ohpc/OHPC_setup_compiler %{compiler_family} \ + %if 0%{?ohpc_mpi_dependent} == 1 \ + . %{OHPC_ADMIN}/ohpc/OHPC_setup_mpi %{mpi_family} \ + %endif \ +} + +# Lua version +%if 0%{!?luaver:1} +# Set luaver to lua_version if it exists +%if 0%{?lua_version:1} +%global luaver %{lua_version} +%else +# Set default Lua version to 5.1, the version used by CentOS 7 +%global luaver 5.1 +# Lua 5.2 is used by older SUSE +%if 0%{?suse_version} >= 1200 && 0%{?suse_version} < 1350 +%global luaver 5.2 +%endif # sle12 +# Lua 5.3 is used by OpenSUSE/SLES 15 and RHEL/CentOS 8 +%if 0%{?sle_version} >= 150000 || 0%{?rhel_version} >=800 +%global luaver 5.3 +%endif # sle15/rh8 +%endif # lua_version not set +%endif # luaver + +# check if user desires to override package and modulefile naming with +# custom delimiter (e.g optimized micro-architecture build) + +%global OHPC_CUSTOM_PKG_DELIM %{nil} + +%{?OHPC_CUSTOM_DELIM: %global OHPC_CUSTOM_PKG_DELIM -%{OHPC_CUSTOM_DELIM}} +%{?OHPC_CUSTOM_DELIM: %global PROJ_DELIM -%{OHPC_CUSTOM_DELIM}%{PROJ_DELIM}} + diff --git a/src/OpenHPC/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-2 b/src/OpenHPC/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-2 new file mode 100644 index 00000000..d64afd2f --- /dev/null +++ b/src/OpenHPC/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-2 @@ -0,0 +1,36 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQENBF331lgBCAC4xqcV9msdntSbMNRSM9EgcoT52+JBix3b9woRZSPtoFzIxKYy +05etPUl421AqXP6gUGuEC+X1WYNh34oE+MIZh1Gk5oecaC93e0bYZiZIR5vLzc6b +aZHQYTCedln5/2jmgWgpk6j0MB4Y7+XjHIkkLHdYQqBOFnF4mhvBXJcDZud3JWL/ +fg6XkvI4i5iW0VNNdD55ekDaJwIUFPDgs4PJMPn0QDFtu99VVJfhdZr+plCqcfUh +aS6Pdu6EP6Uf6YK2xPGXSswLjMQ3Avj8QsMb5zL9/G2oBc/QMSvZuWQuhQxUbzex +4R9STQOSKoaQxbk6l28uK/Vwd4gvvqkBTX3vABEBAAG0OnByaXZhdGUgT0JTIChr +ZXkgd2l0aG91dCBwYXNzcGhyYXNlKSA8ZGVmYXVsdGtleUBsb2NhbG9icz6JAU4E +EwEIADgWIQRTknRNPFQ+1XhHZeaKMGAZ2lZcbAUCXffWWAIbLwULCQgHAgYVCgkI +CwIEFgIDAQIeAQIXgAAKCRCKMGAZ2lZcbLViB/0Rzs0tFj62UqTkmK+nwN0a/lCb +OayEmta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331lgCGwwACgkQijBgGdpW +XGyAMAf8CV6albHtn3y5TzmNKZ+Cp46TJRvfJbIqy+Q4VFUOJRWXsE+F2oVIfRic +X35j8I/kvvhO6EAu6Ic7Cv5B1y9X4oMpno6ZkUkDlUczNoLpP4ijWTm9cUD01Xyp +VATpA6FfxmNe0+oh3ySXzmS6DOAqSBMks2E55YbG9spYvBSGVWQ4HQ0RRxc+kwEN +td/O9MlrVfmBSVp1ccP2vOlovTBLqJS7H8pDiY9nDqCKqH1YZ7WYDvDbKl8U8v8y +0qQDgPBv+3E9WsmOsqbu1jAB7HUdZuMNnMTrlpQmiqilJ2KATOWspxY7UMKGWNWO +12Gh2vqXQrofz8qYb+vYEKLVlPP0/w== +=2mn6 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/src/OpenHPC/ohpc-release/SPECS/release.spec b/src/OpenHPC/ohpc-release/SPECS/release.spec new file mode 100644 index 00000000..82f4b3d3 --- /dev/null +++ b/src/OpenHPC/ohpc-release/SPECS/release.spec @@ -0,0 +1,100 @@ +#----------------------------------------------------------------------------bh- +# This RPM .spec file is part of the OpenHPC project. +# +# It may have been modified from the default version supplied by the underlying +# release package (if available) in order to apply patches, perform customized +# build/install configurations, and supply additional files to support +# desired integration conventions. +# +#----------------------------------------------------------------------------eh- + +%global ohpc_bootstrap 1 +%include %{_sourcedir}/OHPC_macros + +%if 0%{?rhel} +%define disttag .el8 +%endif + +%if 0%{?suse_version} +%define disttag .leap15 +%endif + +Summary: OpenHPC release files +Name: ohpc-release +Version: 2 +Release: 1%{?disttag} +License: Apache-2.0 +Group: %{PROJ_NAME}/admin +URL: https://github.com/openhpc/ohpc +Source1: RPM-GPG-KEY-OpenHPC-2 + +Provides: ohpc-release = %{version} + + +%if 0%{?rhel} +Requires: epel-release +Requires: redhat-release >= 8.1 +%endif +%if 0%{?suse_version} +Requires: (suse-release >= 15.1 or sles-release >= 15.1) +%endif + +%description + +Collection of OpenHPC release files including package repository definition. + +%prep + +%build + +%install + +%{__mkdir} ${RPM_BUILD_ROOT}/etc + +# /etc/ohpc-release + +cat >> ${RPM_BUILD_ROOT}/etc/ohpc-release <> ${RPM_BUILD_ROOT}/%{__repodir}/OpenHPC.repo <