Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to compile and generate OpenSSH rpm package in CentOS6 system?

Shulou Source: shulou.com Published: 2022-06-03 06:07:35 10月01日 Update

How to compile and generate OpenSSH rpm package in CentOS6 system? This problem may be often seen in our daily work. Through this question, I hope you can gain more. Let's take a look at the solution with the editor today.

1. Install the compiler component

Yum-y groupinstall "Development tools"

Yum-y install pam-devel rpm-build rpmdevtools zlib-devel krb5-devel tcp_wrappers tcp_wrappers-devel tcp_wrappers-libs libX11-devel xmkmf libXt-devel wget openssl-devel

2. Configure the compilation environment

Cd ~

Mkdir rpmbuild

Cd rpmbuild

Mkdir-pv {BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

3. Upgrade the current OpenSSL

Yum update openssl openssl-devel

4. Download the source package

Cd ~ / rpmbuild/SOURCES/

Wget http://mirror.jmu.edu/pub/OpenBSD/OpenSSH/portable/openssh-7.3p1.tar.gz

5. Configure spec

Cd ~ / rpmbuild/SPECS

Tar xfz.. / SOURCES/openssh-7.3p1.tar.gz openssh-7.3p1/contrib/redhat/openssh.spec

Mv openssh-7.3p1/contrib/redhat/openssh.spec openssh-7.3p1.spec

Rm-rf openssh-7.3p1

Sed-I-e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1gamma g" openssh-7.3p1.spec

Sed-I-e "s/%define no_x11_askpass 0/%define no_x11_askpass 1gamma g" openssh-7.3p1.spec

Sed-I-e "s/BuildPreReq/BuildRequires/g" openssh-7.3p1.spec

6. Compile the source code

Cd ~ / rpmbuild/SPECS

Rpmbuild-bb openssh-7.3p1.spec

7. View the generated binaries

Cd ~ / rpmbuild/RPMS/x86_64

Ls openssh-*

The above is the method of compiling and generating the rpm package of OpenSSH in the CentOS6 system, and you have to use it to know the details. If you want to read more related articles, you are welcome to follow the industry information channel!

Tags: Compile generate system more source code problems configuration binaries content that is situations files articles schemes methods daily work environment components industry essentials Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Huawei Shulou Information Redmi