一直想动手做rpm包,今天有时间就玩了玩。中间有点曲折,不过后来都出来了。我做的是nginx的rpm,带上upstream_hash。
以下是spec文件:
Summary: The fastest used web server on the Internet.
Name: nginx
Version: 0.7.63
Release:upstream_hash
Group: System Environment/Daemons
Source: nginx-0.7.63.tar.gz
#Source1: nginx.conf-dist
Source1: Nginx_upstream_hash-0.3.tar.gz
License: Nginx Group License
Provides: webserver
Packager: chuzhuo
Conflicts: nginx
BuildRoot: /tmp/nginx
%description
The fastest used web server on the Internet.
%prep
%setup -q -T -D -b 1 -n nginx_upstream_hash-0.3
%setup -q -n %{name}-%{version}
cp -r /usr/src/redhat/BUILD/nginx_upstream_hash-0.3/ /usr/src/redhat/BUILD/nginx-0.7.63
%build
# Build for Source: nginx-0.7.67
#cd nginx-0.7.67
#cd %{name}-%{version}
./configure --prefix=/opt/nginx \
--with-http_ssl_module \
--add-module=nginx_upstream_hash-0.3/
make
%install
make DESTDIR=$RPM_BUILD_ROOT install
# Install for nginx.conf
#install -m 600 $RPM_SOURCE_DIR/nginx.conf-dist $RPM_BUILD_ROOT/opt/nginx/conf/nginx.conf
%files
%defattr (-,root,root)
/opt/nginx
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Oct 14 2010 chuzhuo <>
-test for nginx-0.7.63
备注:
1.绿色部分不知道怎么写更好,就这样凑合了。
2.红色部分注意,被参考1误导耽误了不少时间。他写成这样:make install root=$RPM_BUILD_ROOT
参考:
1.http://wuxumjy.blog.sohu.com/73961467.html
2.
阅读(799) | 评论(0) | 转发(0) |