docker: reduce depens; el5 add m32

This commit is contained in:
boypt
2026-04-08 05:42:06 +00:00
parent f26e73ec1c
commit 3f4f5801f6
8 changed files with 19 additions and 11 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@ BUILD/
*.orig
*.swp
*.tar.gz
*/RPMS/*
*/SRPMS/*
*/BUILD/*
*/BUILDROOT/*

View File

@@ -122,8 +122,8 @@ BUILD_RPM() {
# only on EL5, perl source is needed.
[[ $rpmtopdir == "el5" ]] && \
SOURCES+=($PERLSRC) && \
RPMBUILDOPTS+=('--define' "perlver ${PERLVER}"
'--define' 'dist .el5')
RPMBUILDOPTS+=('--define' "perlver ${PERLVER}" '--define' 'dist .el5') && \
[[ ${M32:-0} != 0 ]] && RPMBUILDOPTS+=('--target' i686) && export CFLAGS=-m32 LDFLAGS=-m32
# add dist variable if not defined
[[ $rpmtopdir == "el7" ]] && \

View File

@@ -14,9 +14,9 @@ RUN export CHINA_MIRROR="$CHINA_MIRROR" && \
if [ "$VERSION_NUM" = "2023" ]; then \
yum makecache timer && yum install -y libnsl systemd-devel; \
elif [ "$VERSION_NUM" = "2" ]; then \
yum makecache fast && yum install -y gtk2-devel imake systemd-devel; \
yum makecache fast && yum install -y gtk2-devel systemd-devel; \
elif [ "$VERSION_NUM" = "1" ]; then \
yum makecache fast && yum install -y imake; \
yum makecache fast \
fi && \
yum install -y wget autoconf automake gcc make rpm-build openssl-devel pam-devel krb5-devel zlib-devel libXt-devel libX11-devel perl perl-IPC-Cmd perl-Time-Piece && \
yum clean all

View File

@@ -22,7 +22,7 @@ RUN export CHINA_MIRROR="$CHINA_MIRROR" && \
elif [ "$VERSION_NUM" = "5" ]; then \
yum install -y gcc44; \
fi && \
yum install -y wget autoconf automake gcc make imake rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel && \
yum install -y wget autoconf automake gcc make rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel && \
yum clean all && \
rm -rfv /data/

View File

@@ -29,7 +29,7 @@ RUN if [ "$VERSION_NUM" = "8" ]; then \
fi; \
fi && \
yum clean all && yum makecache && \
yum install -y wget autoconf automake gcc make imake perl rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel openssl-devel systemd-devel && \
yum install -y wget autoconf automake gcc make perl rpm-build pam-devel krb5-devel zlib-devel openssl-devel systemd-devel && \
yum clean all
CMD ["bash", "-c", "./pullsrc.sh && ./compile.sh"]

View File

@@ -27,8 +27,8 @@ RUN if [ "$CHINA_MIRROR" != "0" ]; then \
fi && \
rm -rf /var/cache/yum/ && \
yum clean all && yum makecache timer && \
yum install -y autoconf automake gcc make imake rpm-build pam-devel krb5-devel zlib-devel systemd-devel openssl-devel \
libXt-devel libX11-devel gtk2-devel perl perl-IPC-Cmd perl-Time-Piece wget && \
yum install -y autoconf automake gcc make rpm-build pam-devel krb5-devel zlib-devel systemd-devel openssl-devel \
perl perl-IPC-Cmd perl-Time-Piece wget && \
yum clean all
CMD ["bash", "-c", "./pullsrc.sh && ./compile.sh"]

View File

@@ -266,7 +266,12 @@ popd
mkdir -p openssl
tar xfz %{SOURCE3} --strip-components=1 -C openssl
pushd openssl
./config no-dgram no-tests shared zlib -fPIC
./config \
%ifarch %{ix86}
linux-x86 \
%endif
no-dgram no-tests shared zlib -fPIC
make %{?_smp_mflags}
popd
@@ -283,6 +288,9 @@ CFLAGS="$RPM_OPT_FLAGS -Os"; export CFLAGS
export LD_LIBRARY_PATH="%{openssl_dir}"
%endif
%configure \
%ifarch %{ix86}
--host=i686-linux-gnu \
%endif
--sysconfdir=%{_sysconfdir}/ssh \
--libexecdir=%{_libexecdir}/openssh \
--datadir=%{_datadir}/openssh \

View File

@@ -29,7 +29,6 @@ OPENSSLMIR=${GH_PROXY:-}https://github.com/openssl/openssl/releases/download/ope
ASKPASSMIR=https://src.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3
PERLMIR=https://www.cpan.org/src/5.0
rpm -q wget >/dev/null || yum install -y wget
mkdir -p downloads
pushd downloads
if [[ ! -f $OPENSSLSRC ]]; then
@@ -50,7 +49,7 @@ if [[ ! -f $ASKPASSSRC ]]; then
echo "!!! Please download $ASKPASSSRC in $PWD by yourself."
fi
if [[ $($__dir/compile.sh GETEL) == "el5" && ! -f $PERLSRC ]]; then
if [[ $($__dir/compile.sh GETEL) == "el5" || ${ALL:-0} == 1 && ! -f $PERLSRC ]]; then
echo Get: $PERLMIR/$PERLSRC
wget --no-check-certificate $PERLMIR/$PERLSRC || \
echo "!!! Please download $PERLSRC in $PWD by yourself."