nginxtar包制作为RPM
1.       下载nginx的源码包
2.       将文件放到/usr/src/redhat/SOURCES/目录下
3.       编写SPEC文件
[root@mail SPECS]# vi nginx-0.8.35.spec
Summary:the first rpm package
Name:nginx
Version:0.8
Release:35
License:Share
Group:Applications/Text
Source0:nginx-0.8.35.tar.gz
%description
my test nginx
%prep
tar -zxvf $RPM_SOURCES_DIR/nginx-0.8.35.tar.gz
%build
cd $RPM_BUILD_DIR/nginx-0.8.35
./configure
make
%install
cd $RPM_BUILD_DIR/nginx-0.8.35
make install
%clean
rm -rf $RPM_BUILD_DIR/nginx-0.8.35
%files
%defattr(-,root,root)
/usr/local/nginx/sbin/nginx
%doc $RPM_BUILD_DIR/nginx-0.8.35/README
4.       制作RPM
[root@mail SPECS]# rpmbuild -ba nginx-0.8.35.spec    
若运行没有错误,则产生/usr/src/redhat/RPMS/i386/nginx-0.8-35.i386.rpm /usr/src/redhat/SRPMS/nginx-0.8-35.src.rpm两个文件。