Skip to content
Snippets Groups Projects
Commit 19c5a333 authored by Francesco Giacomini's avatar Francesco Giacomini
Browse files

WIP

parent e13a2e24
No related branches found
No related tags found
1 merge request!26Migration to EL9
Pipeline #211164 failed
# Copyright 2018-2023 Istituto Nazionale di Fisica Nucleare
# SPDX-License-Identifier: EUPL-1.2
FROM centos:7
FROM almalinux:9
# Allow customization of build user ID and name
ARG USERNAME=vscode
......@@ -10,7 +10,7 @@ ARG USER_GID=${USER_UID}
COPY library-scripts/*.sh /tmp/library-scripts/
RUN yum update -y && \
RUN \
sh /tmp/library-scripts/provide-dev-deps.sh && \
sh /tmp/library-scripts/provide-user.sh ${USERNAME} ${USER_UID} ${USER_GID} && \
yum clean all && rm -rf /var/cache/yum
......
......@@ -5,80 +5,77 @@
downloadNginx() {
# check if a version of nginx is specified
if [ -z ${ngxVersion} ]; then
ngxVersion=1.24.0
fi
echo "nginx version required: ${ngxVersion}";
# check if ~/rpmbuild exists and is not empty
if [ "$(ls -A ${HOME}/rpmbuild)" ];
then
echo "Error: ${HOME}/rpmbuild already exists and is not empty"
# check if ~/rpmbuild exists and is not empty
if [ -d ${HOME}/rpmbuild ] && [ "$(ls -A ${HOME}/rpmbuild)" ]; then
>&2 echo "Error: ${HOME}/rpmbuild already exists and is not empty"
return 1
fi
# setup rpmbuild dir
cat <<EOF > ${HOME}/.rpmmacros
fi
# set nginx version
if [ -z ${ngxVersion} ]; then
ngxVersion=1.26.1-2
fi
echo "Downloading nginx version ${ngxVersion}"
src_package_name="nginx-${ngxVersion}.el9.ngx.src.rpm"
src_package_url="https://nginx.org/packages/centos/9/SRPMS/${src_package_name}"
# setup rpmbuild dir
cat <<EOF > ~/.rpmmacros
%_topdir %{getenv:HOME}/rpmbuild
EOF
cd
rpmdev-setuptree
# download nginx sources
cd ~/rpmbuild/SOURCES/
wget http://nginx.org/packages/centos/7/SRPMS/nginx-$ngxVersion-1.el7.ngx.src.rpm
rpm2cpio nginx-$ngxVersion-1.el7.ngx.src.rpm | cpio -idm
if [ -z ${CI_PROJECT_DIR} ]; then
CI_PROJECT_DIR="/workspaces/ngx_http_voms_module";
fi
cd $CI_PROJECT_DIR
cd
rpmdev-setuptree
# download nginx sources
cd ~/rpmbuild/SOURCES/
wget ${src_package_url}
rpm2cpio ${src_package_name} | cpio -idm
}
buildHttpgNginxRPM() {
if [ -z ${CI_PROJECT_DIR} ]; then
CI_PROJECT_DIR="/workspaces/ngx_http_voms_module";
fi
if [ -z ${CI_PROJECT_DIR} ]; then
>&2 echo "CI_PROJECT_DIR not set, assuming the current working directory \'${PWD}\'"
CI_PROJECT_DIR="${PWD}"
fi
# set the nginx spec file with the httpg patch
cd ~/rpmbuild/SOURCES/
cp ${CI_PROJECT_DIR}/nginx-httpg_no_delegation.patch ${HOME}/rpmbuild/SOURCES/
cp ${CI_PROJECT_DIR}/rpm/nginx.spec ~/rpmbuild/SPECS
# set the nginx spec file with the httpg patch
cd ~/rpmbuild/SOURCES/
cp ${CI_PROJECT_DIR}/nginx-httpg_no_delegation.patch ~/rpmbuild/SOURCES/
cp ${CI_PROJECT_DIR}/rpm/nginx.spec ~/rpmbuild/SPECS
# build rpm
rpmlint ~/rpmbuild/SPECS/nginx.spec
rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec
# build rpm
rpmlint ~/rpmbuild/SPECS/nginx.spec
rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec
# include httpg in the rpm name
mv ~/rpmbuild/RPMS/x86_64/nginx-$ngxVersion-1.el7.ngx.x86_64.rpm ~/rpmbuild/RPMS/x86_64/nginx-httpg-$ngxVersion-1.el7.ngx.x86_64.rpm
mv ~/rpmbuild/RPMS/x86_64/nginx-debuginfo-$ngxVersion-1.el7.ngx.x86_64.rpm ~/rpmbuild/RPMS/x86_64/nginx-httpg-debuginfo-$ngxVersion-1.el7.ngx.x86_64.rpm
mv ~/rpmbuild/SRPMS/nginx-$ngxVersion-1.el7.ngx.src.rpm ~/rpmbuild/SRPMS/nginx-httpg-$ngxVersion-1.el7.ngx.src.rpm
# include httpg in the rpm name
mv ~/rpmbuild/RPMS/x86_64/nginx-$ngxVersion-1.el7.ngx.x86_64.rpm ~/rpmbuild/RPMS/x86_64/nginx-httpg-$ngxVersion-1.el7.ngx.x86_64.rpm
mv ~/rpmbuild/RPMS/x86_64/nginx-debuginfo-$ngxVersion-1.el7.ngx.x86_64.rpm ~/rpmbuild/RPMS/x86_64/nginx-httpg-debuginfo-$ngxVersion-1.el7.ngx.x86_64.rpm
mv ~/rpmbuild/SRPMS/nginx-$ngxVersion-1.el7.ngx.src.rpm ~/rpmbuild/SRPMS/nginx-httpg-$ngxVersion-1.el7.ngx.src.rpm
cd ${CI_PROJECT_DIR}
cd ${CI_PROJECT_DIR}
}
buildVomsModuleRPM() {
if [ -z ${CI_PROJECT_DIR} ]; then
CI_PROJECT_DIR="/workspaces/ngx_http_voms_module";
fi
if [ -z ${CI_PROJECT_DIR} ]; then
CI_PROJECT_DIR="/workspaces/ngx_http_voms_module"
fi
# set voms modules sources
cd ~/rpmbuild/SOURCES/
mkdir ngx-http-voms-module
cp ${CI_PROJECT_DIR}/config ngx-http-voms-module/
cp ${CI_PROJECT_DIR}/config.make ngx-http-voms-module/
cp -r ${CI_PROJECT_DIR}/src ngx-http-voms-module/
cp ${CI_PROJECT_DIR}/rpm/nginx-module-http-voms.spec ~/rpmbuild/SPECS
# set voms modules sources
cd ~/rpmbuild/SOURCES/
mkdir ngx-http-voms-module
cp ${CI_PROJECT_DIR}/config ngx-http-voms-module/
cp ${CI_PROJECT_DIR}/config.make ngx-http-voms-module/
cp -r ${CI_PROJECT_DIR}/src ngx-http-voms-module/
cp ${CI_PROJECT_DIR}/rpm/nginx-module-http-voms.spec ~/rpmbuild/SPECS
# build rpm
rpmlint ~/rpmbuild/SPECS/nginx-module-http-voms.spec
rpmbuild -ba ~/rpmbuild/SPECS/nginx-module-http-voms.spec
# build rpm
rpmlint ~/rpmbuild/SPECS/nginx-module-http-voms.spec
rpmbuild -ba ~/rpmbuild/SPECS/nginx-module-http-voms.spec
cd ${CI_PROJECT_DIR}
cd ${CI_PROJECT_DIR}
}
......@@ -5,39 +5,28 @@
set -ex
yum -y install \
https://repo.ius.io/ius-release-el7.rpm \
centos-release-scl \
epel-release
dnf install -y epel-release
dnf update -y
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
yum -y install \
hostname \
dnf install -y --setopt=tsflags=nodocs \
which \
wget \
tar \
sudo \
file \
less \
git236 \
devtoolset-10 \
git \
gcc-c++ \
GeoIP-devel \
gd-devel \
gettext \
ccache \
libxslt-devel \
lcov \
perl-ExtUtils-Embed \
perl-Test-Nginx \
perl-Digest-SHA \
readline-devel \
boost-devel \
voms-devel \
make \
patch \
openssl \
zlib-devel \
pcre2-devel \
rpmdevtools \
......
echo "objs/addon/src/ngx_http_voms_module.o: CFLAGS += --std=c++1y -Werror" >> $NGX_MAKEFILE
echo "objs/addon/src/ngx_http_voms_module.o: CFLAGS += -Werror" >> $NGX_MAKEFILE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment