Skip to content

Commit

Permalink
add support for building amazon 2023 packages
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Jun 20, 2024
1 parent a8bd8a8 commit 22cc7e5
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 1 deletion.
25 changes: 25 additions & 0 deletions util/packaging/rpm/amzn2023-gasnet-udp/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM amazonlinux:2023 as build

@@{ARGUMENTS}

@@{INJECT_BEFORE_DEPS}

RUN dnf upgrade -y && \
dnf install -y --allowerasing \
gcc gcc-c++ m4 perl python3 python3-devel bash make gawk git cmake \
which diffutils wget vim sudo \
llvm-devel clang clang-devel \
rpm-build rpm-devel rpmlint coreutils patch rpmdevtools chrpath

@@{USER_CREATION}

@@{GET_CHAPEL}

@@{BUILD_DEFAULT}
@@{BUILD_GASNET_UDP}

@@{INSTALL}

@@{PACKAGE_SETUP}

@@{PACKAGE_BUILD}
49 changes: 49 additions & 0 deletions util/packaging/rpm/amzn2023-gasnet-udp/spec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Name: @@{BASENAME}
Version: @@{CHAPEL_VERSION}
Release: @@{PACKAGE_VERSION}%{?dist}
ExclusiveArch: %{_arch}
Summary: Chapel

License: Apache-2.0
Source0: chapel-%{version}.tar.gz

Requires: bash perl git llvm-devel clang clang-devel python3 python3-devel make

%description
Chapel Programming Language

%global debug_package %{nil}

%prep
%setup -q -n chapel-%{version}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_prefix}
mkdir -p %{buildroot}/%{_prefix}/bin
mkdir -p %{buildroot}/%{_prefix}/lib
mkdir -p %{buildroot}/%{_prefix}/share

# Binaries
cp %{_prefix}/bin/chpl %{buildroot}/%{_prefix}/bin/chpl
cp %{_prefix}/bin/chpldoc %{buildroot}/%{_prefix}/bin/chpldoc
cp %{_prefix}/bin/mason %{buildroot}/%{_prefix}/bin/mason
cp %{_prefix}/bin/chplcheck %{buildroot}/%{_prefix}/bin/chplcheck
cp %{_prefix}/bin/chpl-language-server %{buildroot}/%{_prefix}/bin/chpl-language-server
# Libraries
cp -r %{_prefix}/lib/chapel %{buildroot}/%{_prefix}/lib/chapel
# CHPL_HOME
cp -r %{_prefix}/share/chapel %{buildroot}/%{_prefix}/share/chapel

%files
%{_prefix}/bin/chpl
%{_prefix}/bin/chpldoc
%{_prefix}/bin/mason
%{_prefix}/bin/chplcheck
%{_prefix}/bin/chpl-language-server
%{_prefix}/lib/chapel/*
%{_prefix}/share/chapel/*

%changelog
25 changes: 25 additions & 0 deletions util/packaging/rpm/amzn2023-ofi-slurm/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM amazonlinux:2023 as build

@@{ARGUMENTS}

@@{INJECT_BEFORE_DEPS}

RUN dnf upgrade -y && \
dnf install -y --allowerasing \
gcc gcc-c++ m4 perl python3 python3-devel bash make gawk git cmake \
which diffutils wget vim sudo \
llvm-devel clang clang-devel \
rpm-build rpm-devel rpmlint coreutils patch rpmdevtools chrpath

@@{USER_CREATION}

@@{GET_CHAPEL}

@@{BUILD_DEFAULT}
@@{BUILD_OFI_SLURM}

@@{INSTALL}

@@{PACKAGE_SETUP}

@@{PACKAGE_BUILD}
49 changes: 49 additions & 0 deletions util/packaging/rpm/amzn2023-ofi-slurm/spec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Name: @@{BASENAME}
Version: @@{CHAPEL_VERSION}
Release: @@{PACKAGE_VERSION}%{?dist}
ExclusiveArch: %{_arch}
Summary: Chapel

License: Apache-2.0
Source0: chapel-%{version}.tar.gz

Requires: bash perl git llvm-devel clang clang-devel python3 python3-devel make pmix-devel slurm-devel

%description
Chapel Programming Language

%global debug_package %{nil}

%prep
%setup -q -n chapel-%{version}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_prefix}
mkdir -p %{buildroot}/%{_prefix}/bin
mkdir -p %{buildroot}/%{_prefix}/lib
mkdir -p %{buildroot}/%{_prefix}/share

# Binaries
cp %{_prefix}/bin/chpl %{buildroot}/%{_prefix}/bin/chpl
cp %{_prefix}/bin/chpldoc %{buildroot}/%{_prefix}/bin/chpldoc
cp %{_prefix}/bin/mason %{buildroot}/%{_prefix}/bin/mason
cp %{_prefix}/bin/chplcheck %{buildroot}/%{_prefix}/bin/chplcheck
cp %{_prefix}/bin/chpl-language-server %{buildroot}/%{_prefix}/bin/chpl-language-server
# Libraries
cp -r %{_prefix}/lib/chapel %{buildroot}/%{_prefix}/lib/chapel
# CHPL_HOME
cp -r %{_prefix}/share/chapel %{buildroot}/%{_prefix}/share/chapel

%files
%{_prefix}/bin/chpl
%{_prefix}/bin/chpldoc
%{_prefix}/bin/mason
%{_prefix}/bin/chplcheck
%{_prefix}/bin/chpl-language-server
%{_prefix}/lib/chapel/*
%{_prefix}/share/chapel/*

%changelog
24 changes: 24 additions & 0 deletions util/packaging/rpm/amzn2023/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM amazonlinux:2023 as build

@@{ARGUMENTS}

@@{INJECT_BEFORE_DEPS}

RUN dnf upgrade -y && \
dnf install -y --allowerasing \
gcc gcc-c++ m4 perl python3 python3-devel bash make gawk git cmake \
which diffutils wget vim sudo \
llvm-devel clang clang-devel \
rpm-build rpm-devel rpmlint coreutils patch rpmdevtools chrpath

@@{USER_CREATION}

@@{GET_CHAPEL}

@@{BUILD_DEFAULT}

@@{INSTALL}

@@{PACKAGE_SETUP}

@@{PACKAGE_BUILD}
49 changes: 49 additions & 0 deletions util/packaging/rpm/amzn2023/spec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Name: @@{BASENAME}
Version: @@{CHAPEL_VERSION}
Release: @@{PACKAGE_VERSION}%{?dist}
ExclusiveArch: %{_arch}
Summary: Chapel

License: Apache-2.0
Source0: chapel-%{version}.tar.gz

Requires: bash perl git llvm-devel clang clang-devel python3 python3-devel make

%description
Chapel Programming Language

%global debug_package %{nil}

%prep
%setup -q -n chapel-%{version}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_prefix}
mkdir -p %{buildroot}/%{_prefix}/bin
mkdir -p %{buildroot}/%{_prefix}/lib
mkdir -p %{buildroot}/%{_prefix}/share

# Binaries
cp %{_prefix}/bin/chpl %{buildroot}/%{_prefix}/bin/chpl
cp %{_prefix}/bin/chpldoc %{buildroot}/%{_prefix}/bin/chpldoc
cp %{_prefix}/bin/mason %{buildroot}/%{_prefix}/bin/mason
cp %{_prefix}/bin/chplcheck %{buildroot}/%{_prefix}/bin/chplcheck
cp %{_prefix}/bin/chpl-language-server %{buildroot}/%{_prefix}/bin/chpl-language-server
# Libraries
cp -r %{_prefix}/lib/chapel %{buildroot}/%{_prefix}/lib/chapel
# CHPL_HOME
cp -r %{_prefix}/share/chapel %{buildroot}/%{_prefix}/share/chapel

%files
%{_prefix}/bin/chpl
%{_prefix}/bin/chpldoc
%{_prefix}/bin/mason
%{_prefix}/bin/chplcheck
%{_prefix}/bin/chpl-language-server
%{_prefix}/lib/chapel/*
%{_prefix}/share/chapel/*

%changelog
2 changes: 1 addition & 1 deletion util/packaging/rpm/common/fill_docker_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class MyTemplate(Template):
COPY --chown=user ./rpm/common/rpmlintrc /home/user/.rpmlintrc
RUN rpmdev-setuptree && \\
cp chapel-$CHAPEL_VERSION.tar.gz $(rpm --eval '%{_sourcedir}') && \\
ignore_unused=$([[ "$(rpm --eval '%{?dist}')" == ".el9" ]] && echo "" || echo "--ignore-unused-rpmlintrc") && \\
ignore_unused=$([[ "$(rpm --eval '%{fc#}')" == "1" ]] && echo "--ignore-unused-rpmlintrc") || echo "" && \\
rpmlint $ignore_unused --file .rpmlintrc $BASENAME.spec && \\
unset ignore_unused && \\
spectool -g -R $BASENAME.spec
Expand Down

0 comments on commit 22cc7e5

Please sign in to comment.