接下来在%{_topdir}/SPECS目录中创建nginx.spec文件,其内容如下:
Name: nginx
Version: 1.0.14
Release: 1%{?dist}
Summary: A free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.
Group: System Environment/Daemons
Vendor: http://www.magedu.com
Packager: mage <linuxedu@foxmail.com>
License: BSD
URL: http://www.nginx.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
Nginx is a free, open-source, high-performance HTTP server and reverse proxy,
as well as an IMAP/POP3 proxy server. Igor Sysoev started development of Nginx
in 2002, with the first public release in 2004. Nginx now hosts nearly 12.18%
(22.2M) of active sites across all domains. Nginx is known for its high
performance, stability, rich feature set, simple configuration, and low
resource consumption.
为了保证接下来的制作过程能够顺利进行,此时可以使用rpmbuild命令的--nobuild选项测试spec文件所依赖的环境是否已经完全准备好。例如:
[mage@www.magedu.com SPECS]$ rpmbuild --nobuild nginx.spec
error: Failed build dependencies:
pcre-devel is needed by nginx-1.0.14-1.i386
gd-devel is needed by nginx-1.0.14-1.i386
5.4.2.3 查看完成的rpm包摘要信息
对于制作完成的rpm包,其摘要信息是由spec文件中标签段定义生成的。对于未安装的rpm包,可以使用rpm命令的-qpi选项进行。
[mage@www.magedu.com ~]$ rpm -qpi ~/rpmworkshop/RPMS/i386/nginx-1.0.14-1.i386.rpm
Name : nginx Relocations: (not relocatable)
Version : 1.0.14 Vendor: http://www.magedu.com
Release : 1 Build Date: Wed 11 Apr 2012 05:01:14 PM CST
Install Date: (not installed) Build Host: mail.magedu.com
Group : System Environment/Daemons Source RPM: nginx-1.0.14-1.src.rpm
Size : 705987 License: BSD
Signature : (none)
Packager : mage <linuxedu@foxmail.com>
URL : http://www.nginx.org/
Summary : A free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.
Description :
Nginx is a free, open-source, high-performance HTTP server and reverse proxy,
as well as an IMAP/POP3 proxy server. Igor Sysoev started development of Nginx
in 2002, with the first public release in 2004. Nginx now hosts nearly 12.18%
(22.2M) of active sites across all domains. Nginx is known for its high
performance, stability, rich feature set, simple configuration, and low
resource consumption.