Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable build for s390x architecture #2121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions debs/Debian/s390x/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM s390x/debian:10

ENV DEBIAN_FRONTEND noninteractive

# Installing necessary packages
RUN apt-get update && apt-get install -y apt-utils

RUN apt-get install -y --force-yes \
curl gcc make sudo wget expect gnupg perl-base perl \
build-essential procps gawk libsigsegv2 python3 cmake devscripts

RUN apt-get install checkpolicy fontconfig-config fonts-dejavu-core gdal-data libaec0 libarmadillo9 libarpack2 libaudit-dev libauparse0 libblas3 libcap-ng-dev libcharls2 libdap25 libdapclient6v5 libdapserver7v5 libepsilon1 \
libfontconfig1 libfreetype6 libfreexl1 libfyba0 libgdal20 libgeos-3.7.1 libgeos-c1v5 libgeotiff2 libgfortran5 libgif7 libhdf4-0-alt libhdf5-103 libimagequant0 libjbig0 libjpeg62-turbo libjson-c3 libkmlbase1 \
libkmlconvenience1 libkmldom1 libkmlengine1 libkmlregionator1 libkmlxsd1 liblapack3 liblcms2-2 libminizip1 libnetcdf13 libnspr4 libnss3 libodbc1 libogdi3.2 libopenjp2-7 libpng16-16 libpoppler82 libpopt0 \
libpq5 libproj13 libqhull7 libspatialite7 libsuperlu5 libsz2 libtiff5 liburiparser1 libwebp6 libwebpdemux2 libwebpmux3 libxerces-c3.2 odbcinst odbcinst1debian2 policycoreutils policycoreutils-dev \
policycoreutils-python-utils poppler-data proj-bin proj-data python3-audit python3-decorator python3-gdal python3-ipy python3-networkx python3-numpy python3-olefile python3-pil python3-scipy python3-selinux \
python3-semanage python3-sepolgen python3-sepolicy python3-setools python3-yaml selinux-basics selinux-policy-default selinux-policy-dev selinux-utils semodule-utils setools -y

# Add the script to build the Debian package
ADD build.sh /usr/local/bin/build_package
RUN chmod +x /usr/local/bin/build_package

# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/build_package"]

2 changes: 1 addition & 1 deletion debs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y"

# Build package
if [[ "${architecture_target}" == "amd64" ]] || [[ "${architecture_target}" == "ppc64le" ]] || \
[[ "${architecture_target}" == "arm64" ]]; then
[[ "${architecture_target}" == "arm64" ]] || [[ "${architecture_target}" == "s390x" ]]; then
debuild --rootcmd=sudo -b -uc -us
elif [[ "${architecture_target}" == "armhf" ]]; then
linux32 debuild --rootcmd=sudo -b -uc -us
Expand Down
9 changes: 7 additions & 2 deletions debs/generate_debian_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ DEB_I386_BUILDER="deb_builder_i386"
DEB_PPC64LE_BUILDER="deb_builder_ppc64le"
DEB_ARM64_BUILDER="deb_builder_arm64"
DEB_ARMHF_BUILDER="deb_builder_armhf"
DEB_S390X_BUILDER="deb_builder_s390x"
DEB_AMD64_BUILDER_DOCKERFILE="${CURRENT_PATH}/Debian/amd64"
DEB_I386_BUILDER_DOCKERFILE="${CURRENT_PATH}/Debian/i386"
DEB_PPC64LE_BUILDER_DOCKERFILE="${CURRENT_PATH}/Debian/ppc64le"
DEB_ARM64_BUILDER_DOCKERFILE="${CURRENT_PATH}/Debian/arm64"
DEB_ARMHF_BUILDER_DOCKERFILE="${CURRENT_PATH}/Debian/armhf"
DEB_S390X_BUILDER_DOCKERFILE="${CURRENT_PATH}/Debian/s390x"
CHECKSUMDIR=""
CHECKSUM="no"
PACKAGES_BRANCH="master"
Expand Down Expand Up @@ -125,8 +127,11 @@ build() {
elif [[ "${ARCHITECTURE}" = "armhf" ]]; then
BUILD_NAME="${DEB_ARMHF_BUILDER}"
FILE_PATH="${DEB_ARMHF_BUILDER_DOCKERFILE}"
elif [[ "${ARCHITECTURE}" = "s390x" ]]; then
BUILD_NAME="${DEB_S390X_BUILDER}"
FILE_PATH="${DEB_S390X_BUILDER_DOCKERFILE}"
else
echo "Invalid architecture. Choose one of amd64/i386/ppc64le/arm64/arm32."
echo "Invalid architecture. Choose one of amd64/i386/ppc64le/arm64/arm32/s390x."
return 1
fi
build_deb ${BUILD_NAME} ${FILE_PATH} || return 1
Expand All @@ -144,7 +149,7 @@ help() {
echo
echo " -b, --branch <branch> [Required] Select Git branch [${BRANCH}]. By default: master."
echo " -t, --target <target> [Required] Target package to build: manager or agent."
echo " -a, --architecture <arch> [Optional] Target architecture of the package [amd64/i386/ppc64le/arm64/armhf]."
echo " -a, --architecture <arch> [Optional] Target architecture of the package [amd64/i386/ppc64le/arm64/armhf/s390x]."
echo " -j, --jobs <number> [Optional] Change number of parallel jobs when compiling the manager or agent. By default: 2."
echo " -r, --revision <rev> [Optional] Package revision. By default: 1."
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
Expand Down