首页 > 代码库 > Ngins rpm包制作,spec配置文件
Ngins rpm包制作,spec配置文件
Name: nginx
Version: 1.4.2
Release: 1%{?dist}
Summary: nginx from source
Group: System Environment/Daemons
License: GPLv2
URL: http://nginx.org
Source0: %{name}-%{version}.tar.gz
Source1: nginxd
Source2: nginx.conf
BuildRoot: %_topdir/BUILDROOT
BuildRequires: gcc,make
Requires: pcre,pcre-devel,openssl,openssl-devel,chkconfig
%description
Nginx RPM Soft
%prep
%setup -q
%build
./configure --prefix=/opt/app/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}/etc/rc.d/init.d/nginxd
%{__install} -p -D %{SOURCE2} %{buildroot}/opt/app/nginx/conf/nginx.conf
%pre
if [ $1 == 1 ];then
/usr/sbin/useradd -r www 2> /dev/null
fi
%post
#if [ $1 == 1 ];then
# /sbin/chkconfig --add nginxd
#fi
%preun
if [ $1 == 0 ];then
/usr/sbin/userdel -r www 2> /dev/null
fi
%postun
rm -rf /opt/app/nginx
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,0755)
/opt/app/nginx/
%config(noreplace) /opt/app/nginx/conf/nginx.conf
%attr(0755,root,root) /etc/rc.d/init.d/nginxd
%doc
%changelog
* Fri May 30 2014 laoguang <lkernel@163.com> - 1.0.14-1
- Initial version
Crazy_Linux !
本文出自 “Crazy_Linux” 博客,请务必保留此出处http://mkernel.blog.51cto.com/8015041/1433873