RHELAS4 下 rpmbuild 制作httpd-2.0.59 系列 rpm包

RHELAS4 下 rpmbuild 制作httpd-2.0.59 系列 rpm包

说明: RHELAS4 U2-U4 以Apache 2.0.X Released 产品线最新版本httpd-2.0.59.tar.gz+
apr-0.9.13+apr-util-0.9.13来制作最新版本的rpm软件安装包


第一步 编译环境
mkdir $HOME/rpm
mkdir $HOME/rpm/SOURCES
mkdir $HOME/rpm/SPECS
mkdir $HOME/rpm/BUILD
mkdir $HOME/rpm/SRPMS
mkdir $HOME/rpm/RPMS
mkdir $HOME/rpm/RPMS/i386
echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros

第二下 下载httpd-2.0.59对应的apr的版本apr-0.9.13+apr-util-0.9.13
rpmbuild -ta --nodeps apr-0.9.13.tar.gz

rpm ivh /root/rpm/RPMS/i386/apr-0.9.13-1.i386.rpm (如果系统里有用 Uvh升级安装)

rpm ivh /root/rpm/RPMS/i386/apr-devel-0.9.13-1.i386.rpm

rpmbuild -ta --nodeps apr-util-0.9.13.tar.gz (系统里有apr-0.9.13才能编译此步) 

rpm ivh /root/rpm/RPMS/i386/apr-util-0.9.13-1.i386.rpm
rpm ivh /root/rpm/RPMS/i386/apr-util-devel-0.9.13-1.i386.rpm


第三步 http://httpd.apache.org 下载
注:  Apache 2.2.X Released   为一个产品线
      Apache 2.0.X Released   httpd-2.0.59.tar.gz为此产品线的最新版本
    Apache 1.3.X Released  

第四步 提取 httpd.spces
tar -zxvf     httpd-2.0.59.tar.gz
cp httpd.spec   $HOME/rpm/SPECS下
cp httpd-2.0.59.tar.gz  $HOME/rpm/SOURCES

vi $HOME/rpm/SPECS/httpd.spec


%prep
%setup -q
上面插入以下

[Copy to clipboard] [ - ]
CODE:
%package suexec
Group: System Environment/Daemons
Summary: suexec binary for the Apache HTTP server
PreReq: httpd = %{version}-%{release}

%description suexec
This package includes the /usr/sbin/suexec binary which can be installed
to allow the Apache HTTP server to run CGI programs (and any programs
executed by SSI pages) as a user other than the 'apache' user.

在%changelog的上方插入以下

[Copy to clipboard] [ - ]
CODE:
%files suexec
%defattr(-,root,root)
%attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
%{_mandir}/man8/suexec.8*

下面开始用rpmbuild制作最新httpd-2.0.X 最新rpm安装包
rpmbuild -ba --nodeps $HOME/rpm/SPECS/httpd.spec

到些你就会得到以下提示
Wrote: /root/rpm/SRPMS/httpd-2.0.59-1.src.rpm
Wrote: /root/rpm/RPMS/i386/httpd-2.0.59-1.i386.rpm
Wrote: /root/rpm/RPMS/i386/httpd-devel-2.0.59-1.i386.rpm
Wrote: /root/rpm/RPMS/i386/httpd-manual-2.0.59-1.i386.rpm
Wrote: /root/rpm/RPMS/i386/mod_ssl-2.0.59-1.i386.rpm
Wrote: /root/rpm/RPMS/i386/httpd-suexec-2.0.59-1.i386.rpm
Wrote: /root/rpm/RPMS/i386/httpd-debuginfo-2.0.59-1.i386.rpm


到些结束谢谢观看!!!!!!!!!!!!!

谢谢。

如果可以做一个包含相关模块和软件的更好哦。
[root@mail bin]# rpm -qa|grep mod
mod_authz_ldap-0.26-2
mod_auth_kerb-5.0-1
mikmod-3.1.6-32.EL4
usermode-gtk-1.74-1
mod_auth_mysql-2.6.1-2.2
mod_python-3.1.3-5.1
mod_auth_pgsql-2.0.1-6
module-init-tools-3.1-0.pre5.3
usermode-1.74-1
mod_perl-1.99_16-4
mod_ssl-2.0.52-19.ent
[root@mail bin]#

用httpd-2.0.59.tar.gz 制作的rpm包 里有个
Wrote: /root/rpm/RPMS/i386/mod_ssl-2.0.59-1.i386.rpm