$ cd ~ $ mkdir rpmbuild $ cd rpmbuild $ mkdir -pv {BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
升级OpenSSL到最新
1
$ yum update openssl openssl-devel
编译OpenSSH RPM
下载源码包
1 2 3
$ cd ~/rpmbuild/SOURCES/ $ wget http://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-7.1p2.tar.gz $ wget http://ftp.riken.jp/Linux/momonga/6/Everything/SOURCES/x11-ssh-askpass-1.2.4.1.tar.gz
配置SPEC文件
1 2 3 4 5 6 7
$ cd ~/rpmbuild/SPECS $ tar xfz ../SOURCES/openssh-7.1p2.tar.gz openssh-7.1p2/contrib/redhat/openssh.spec $ mv openssh-7.1p2/contrib/redhat/openssh.spec openssh-7.1p2.spec $ rm -rf openssh-7.1p2 $ sed -i -e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1/g" openssh-7.1p2.spec $ sed -i -e "s/%define no_x11_askpass 0/%define no_x11_askpass 1/g" openssh-7.1p2.spec $ sed -i -e "s/BuildPreReq/BuildRequires/g" openssh-7.1p2.spec
编译生成RPM
1 2
$ cd ~/rpmbuild/SPECS $ rpmbuild -bb openssh-7.1p2.spec
查看生成的RPM
1 2 3
$ cd ~/rpmbuild/RPMS/x86_64 $ ls openssh-* openssh-7.1p2-1.x86_64.rpm openssh-clients-7.1p2-1.x86_64.rpm openssh-debuginfo-7.1p2-1.x86_64.rpm openssh-server-7.1p2-1.x86_64.rpm
$ cd ~/rpmbuild/RPMS/x86_64 yum install openssh-7.1p2-1.x86_64.rpm openssh-clients-7.1p2-1.x86_64.rpm openssh-server-7.1p2-1.x86_64.rpm
诊断 openssh-clients-7.1p2-1.x86_64.rpm: openssh-clients-7.1p2-1.x86_64 openssh-clients-7.1p2-1.x86_64.rpm 将作为 openssh-clients-5.3p1-114.el6_7.x86_64 的更新 诊断 openssh-server-7.1p2-1.x86_64.rpm: openssh-server-7.1p2-1.x86_64 openssh-server-7.1p2-1.x86_64.rpm 将作为 openssh-server-5.3p1-114.el6_7.x86_64 的更新 解决依赖关系 --> 执行事务检查 ---> Package openssh.x86_64 0:5.3p1-114.el6_7 will be 升级 ---> Package openssh.x86_64 0:7.1p2-1 will be an update ---> Package openssh-clients.x86_64 0:5.3p1-114.el6_7 will be 升级 ---> Package openssh-clients.x86_64 0:7.1p2-1 will be an update ---> Package openssh-server.x86_64 0:5.3p1-114.el6_7 will be 升级 ---> Package openssh-server.x86_64 0:7.1p2-1 will be an update --> 完成依赖关系计算
依赖关系解决
======================================================================================================================================================================================================================================================================== 软件包 架构 版本 仓库 大小 ======================================================================================================================================================================================================================================================================== 正在升级: openssh x86_64 7.1p2-1 /openssh-7.1p2-1.x86_64 1.9 M openssh-clients x86_64 7.1p2-1 /openssh-clients-7.1p2-1.x86_64 2.0 M openssh-server x86_64 7.1p2-1 /openssh-server-7.1p2-1.x86_64 933 k