forked from pEp.foundation/pEpEngine
CI: build CentOS/RedHat 8 RPM packages
This commit cleans up the existing CI scripts a bit while adding jobs to build RPM packages. The directory structure allows for easily adding more package targets. RPM outputs will only be uploaded on tagged commits.master
parent
56cd005c02
commit
9999900575
@ -0,0 +1,30 @@
|
||||
ARG DOCKER_REGISTRY_HOST
|
||||
ARG CURRENT_DISTRO
|
||||
ARG PEPENGINE_VERSION
|
||||
ARG SEQUOIA_VERSION
|
||||
FROM ${DOCKER_REGISTRY_HOST}/pep-${CURRENT_DISTRO}-sequoia:${SEQUOIA_VERSION}
|
||||
|
||||
ENV BUILDROOT /build
|
||||
ENV INSTPREFIX /install
|
||||
ENV OUTDIR /out
|
||||
ARG PEP_MACHINE_DIR
|
||||
|
||||
### Setup working directory
|
||||
RUN mkdir ${BUILDROOT}/pEpEngine
|
||||
COPY ./scripts/common/build_pEpEngine_deps.sh ${BUILDROOT}/pEpEngine
|
||||
|
||||
USER root
|
||||
|
||||
RUN yum install -y python3 python3-lxml binutils && yum clean all
|
||||
|
||||
RUN chown -R pep-builder:pep-builder ${BUILDROOT}/pEpEngine
|
||||
WORKDIR ${BUILDROOT}/pEpEngine
|
||||
|
||||
ARG YML2_VERSION
|
||||
ARG ENGINE_VERSION
|
||||
ARG CURRENT_DISTRO
|
||||
|
||||
### Build pEpEngine dependencies
|
||||
USER pep-builder
|
||||
|
||||
RUN sh ./build_pEpEngine_deps.sh
|
@ -0,0 +1,20 @@
|
||||
ARG DOCKER_REGISTRY_HOST
|
||||
ARG CURRENT_DISTRO
|
||||
ARG PEP_MACHINE_DIR
|
||||
ARG PEPENGINE_VERSION
|
||||
FROM ${DOCKER_REGISTRY_HOST}/pep-${CURRENT_DISTRO}-engine:${PEPENGINE_VERSION} AS pEpBuild
|
||||
|
||||
FROM ${DOCKER_REGISTRY_HOST}/fpm-${CURRENT_DISTRO}:latest
|
||||
# whatever is required for building should be installed in this image; just like BuildRequires: for RPM specs
|
||||
RUN yum -y install readline-devel epel-release && \
|
||||
yum -y install patchelf chrpath
|
||||
|
||||
ARG PEP_MACHINE_DIR
|
||||
COPY --from=pEpBuild /install /source
|
||||
COPY --from=pEpBuild ${PEP_MACHINE_DIR}/system.db ${PEP_MACHINE_DIR}/system.db
|
||||
|
||||
COPY install.sh /usr/local/bin/install.sh
|
||||
|
||||
ENV INSTPREFIX /source
|
||||
|
||||
RUN /usr/local/bin/install.sh
|
@ -0,0 +1,29 @@
|
||||
#!/bin/bash -ex
|
||||
# we should always set proper ownership before exiting, otherwise
|
||||
# the created packages will have root:root ownership and we'll be unable
|
||||
# to delete them from our host.
|
||||
trap 'chown -R --reference /usr/bin/create-rpm.sh /out/' EXIT
|
||||
|
||||
# the source directory is mounted read-only to prevent issues where the build
|
||||
# could alter the source; we should copy it somewhere inside the container
|
||||
cd /source/out
|
||||
ls -alh
|
||||
tree
|
||||
INSTALL_TOP=/package
|
||||
mkdir -p ${INSTALL_TOP}/lib/pEp
|
||||
mkdir -p ${INSTALL_TOP}/include/pEp
|
||||
mkdir -p ${INSTALL_TOP}/share
|
||||
cp -ar lib/libpEpEngine.so ${INSTALL_TOP}/lib/.
|
||||
cp -ar lib/pEp/libetpan* ${INSTALL_TOP}/lib/pEp/..
|
||||
cp -ar include/pEp/* ${INSTALL_TOP}/include/pEp/.
|
||||
cp -ar share/* ${INSTALL_TOP}/share/.
|
||||
|
||||
cd /out
|
||||
|
||||
#this would be the no-signature command line
|
||||
fpm -t rpm -s dir \
|
||||
-n ${PKG_NAME} \
|
||||
--version ${PKG_VERSION} \
|
||||
--description "${PKG_DESCRIPTION}" \
|
||||
--depends ${PKG_DEPENDS} \
|
||||
-C ${PKG_INSTALL_PATH_STRING}
|
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
set -exuo pipefail
|
||||
|
||||
# ===========================
|
||||
# Distro
|
||||
# ===========================
|
||||
|
||||
echo 7 >"${INSTPREFIX}/D_REVISION"
|
||||
|
||||
D_REV=$(cat ${INSTPREFIX}/D_REVISION)
|
||||
D=""
|
||||
|
||||
D=${INSTPREFIX}/out
|
||||
|
||||
mkdir -p ${INSTPREFIX}/out
|
||||
rm -rf ${INSTPREFIX}/out/*
|
||||
# pep asn1c capnp cmake curl gmp llvm nettle ninja sequoia
|
||||
# bin include lib lib64 libexec share
|
||||
mkdir -p "$D"/{bin,ld,lib/pEp,share/pEp,include/pEp}
|
||||
|
||||
# Engine and below, and libpEpAdapter
|
||||
cp -a ${INSTPREFIX}/lib/libpEpEngine.so "$D"/lib
|
||||
cp -ar ${INSTPREFIX}/libetpan/lib/libetpan.so* "$D"/lib/pEp
|
||||
|
||||
cp -arv ${INSTPREFIX}/include/pEp/. "$D"/include/pEp
|
||||
|
||||
cp -arv ${PEP_MACHINE_DIR}/system.db "$D"/share/pEp
|
||||
|
||||
# Sequoia cmdline (optional above)
|
||||
if [ -f ${INSTPREFIX}/bin/sq ] ; then
|
||||
cp -a ${INSTPREFIX}/lib/libsequoia_*.so* "$D"/lib/pEp
|
||||
cp -a ${INSTPREFIX}/bin/sq "$D"/bin
|
||||
cp -a ${INSTPREFIX}/bin/sqv "$D"/bin
|
||||
cp -arv ${INSTPREFIX}/lib/sequoia "$D"/lib/pEp/.
|
||||
else
|
||||
cp -a ${INSTPREFIX}/lib/libsequoia_openpgp_ffi.* "$D"/lib/pEp
|
||||
cp -arv ${INSTPREFIX}/lib/sequoia "$D"/lib/pEp/.
|
||||
fi
|
||||
|
||||
# versions
|
||||
cp -a ${INSTPREFIX}/*.ver "$D"
|
||||
|
||||
find "$D"/lib -maxdepth 1 -type f -print -exec patchelf --set-rpath '$ORIGIN/pEp:$ORIGIN' {} \;
|
||||
find "$D"/lib/pEp -type f -print -exec patchelf --set-rpath '$ORIGIN' {} \;
|
||||
find "$D"/bin -type f -print -exec patchelf --set-rpath '$ORIGIN/../lib/pEp:$ORIGIN/../lib' {} \;
|
||||
|
||||
ls -lh "$D"/*
|
||||
du -sch "$D"
|
Loading…
Reference in New Issue