Last active
December 2, 2022 19:30
-
-
Save olegbuevich/7ae572ef3ceb681c53c3307059aad648 to your computer and use it in GitHub Desktop.
Build openssh 8 rpms for centos 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
OPENSSH_VERSION="8.0p1" | |
sudo yum install -y epel-release | |
sudo yum install -y mock rpm-build | |
mkdir -p ~/rpmbuild/SOURCES | |
cd ~/rpmbuild/SOURCES | |
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz | |
tar zxf openssh-${OPENSSH_VERSION}.tar.gz | |
cp /etc/pam.d/sshd openssh-${OPENSSH_VERSION}/contrib/redhat/sshd.pam | |
tar cpzf openssh-${OPENSSH_VERSION}.tar.gz openssh-${OPENSSH_VERSION} | |
sed -i "s/sshd.pam.old/sshd.pam/g" openssh-${OPENSSH_VERSION}/contrib/redhat/openssh.spec | |
sed -i "s/\(^%define no_x11_askpass\).*$/\1 1/g" openssh-${OPENSSH_VERSION}/contrib/redhat/openssh.spec | |
sed -i "s/\(^%define no_gnome_askpass\).*$/\1 1/g" openssh-${OPENSSH_VERSION}/contrib/redhat/openssh.spec | |
sed -i "s/PreReq/Requires/g" openssh-${OPENSSH_VERSION}/contrib/redhat/openssh.spec | |
sed -i "s/^Source1/#Source1/g" openssh-${OPENSSH_VERSION}/contrib/redhat/openssh.spec | |
rpmbuild -bs openssh-${OPENSSH_VERSION}/contrib/redhat/openssh.spec | |
sudo mock -r epel-6-x86_64 --rebuild /home/vagrant/rpmbuild/SRPMS/openssh-${OPENSSH_VERSION}-1.el6.src.rpm | |
sudo mock -r epel-6-i386 --rebuild /home/vagrant/rpmbuild/SRPMS/openssh-${OPENSSH_VERSION}-1.el6.src.rpm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see
https://github.com/boypt/openssh-rpms
.
this solves bulding the rpm's:
openssh-9.1p1-2.el6.src.rpm
openssh-9.1p1-2.el6.x86_64.rpm
openssh-clients-9.1p1-2.el6.x86_64.rpm
openssh-debuginfo-9.1p1-2.el6.x86_64.rpm
openssh-server-9.1p1-2.el6.x86_64.rpm
.
without such a lot of issues like the very old script here on this side