httpd源码构建rpm

系统版本:isoft-serveros-v4.2(centos7)

源码下载链接:

安装依赖

yum install -y wget gcc rpm-build 
yum install -y autoconf zlib-devel libselinux-devel libuuid-devel apr-devel apr-util-devel pcre-devel openldap-devel lua-devel libxml2-devel openssl-devel
yum install -y libtool doxygen
yum install -y postgresql-devel mysql-devel sqlite-devel unixODBC-devel nss-devel

libdb4-devel依赖需要使用epel源安装,这里使用阿里的epel源

# 添加阿里yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 手动修改repo文件中的系统版本,因为本系统检测到的版本号是4
sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo
# 安装epel源
yum install -y epel-release
# 安装libdb4-devel
yum install -y libdb4-devel

编译准备

[root@localhost ~]# mkdir -p /root/rpmbuild/{SPECS,SOURCES}
[root@localhost ~]# cd /root/rpmbuild/SOURCES/
[root@localhost SOURCES]# wget --no-check-certificate https://dlcdn.apache.org//apr/apr-util-1.6.1.tar.bz2
[root@localhost SOURCES]# tar  jxf apr-1.7.0.tar.bz2
[root@localhost SOURCES]# tar  jxf apr-util-1.6.1.tar.bz2
[root@localhost SOURCES]# tar  jxf httpd-2.4.52.tar.bz2
[root@localhost SOURCES]# cp apr-1.7.0/apr.spec ../SPECS/
[root@localhost SOURCES]# cp apr-util-1.6.1/apr-util.spec ../SPECS/
[root@localhost SOURCES]# cp httpd-2.4.52/httpd.spec ../SPECS/

开始编译

[root@localhost SOURCES]# cd ../SPECS/

# 修改spec文件
[root@localhost SPECS]# vim apr.spec
Release: 1%dist
[root@localhost SPECS]# vim apr-util.spec
Release: 1%dist
[root@localhost SPECS]# vim httpd.spec
Release: 1%dist

[root@localhost SPECS]# rpmbuild -ba apr.spec
[root@localhost SPECS]# rpm -Uvh /root/rpmbuild/RPMS/x86_64/apr-*

[root@localhost SPECS]# rpmbuild -ba apr-util.spec
[root@localhost SPECS]# rpm -Uvh /root/rpmbuild/RPMS/x86_64/apr-util-*

[root@localhost SPECS]# rpmbuild -ba httpd.spec
[root@localhost SPECS]# rpm -Uvh /root/rpmbuild/RPMS/x86_64/httpd-*
[root@localhost SPECS]# rpm -Uvh /root/rpmbuild/RPMS/x86_64/mod_*

# 打包所有的软件包
[root@localhost ~]# tar zcf httpd-2.4.25.tar.gz x86_64/

image-20220304112802458

这里修改%dist是为了修改编译后生成的软件包的名字,dist具体代表什么可以在/etc/rpm/macros.dist文件中看到

image-20220308100545732

文章作者:lvbibir
文章链接:https://lvbibir.cn/archives/752
版权声明:转载请注明来自 lvbibir's blog!
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇