216 lines
7.1 KiB
RPMSpec
216 lines
7.1 KiB
RPMSpec
%define nginx_user nginx
|
|
%define nginx_group %{nginx_user}
|
|
%define nginx_home %{_localstatedir}/lib/nginx
|
|
%define nginx_home_tmp %{nginx_home}/tmp
|
|
%define nginx_logdir %{_localstatedir}/log/nginx
|
|
%define nginx_confdir %{_sysconfdir}/nginx
|
|
%define nginx_datadir %{_datadir}/nginx
|
|
|
|
Name: nginx
|
|
Version: 0.5.34
|
|
Release: 1%{?dist}
|
|
Summary: Robust, small and high performance http and reverse proxy server
|
|
Group: System Environment/Daemons
|
|
|
|
# BSD License (two clause)
|
|
# http://www.freebsd.org/copyright/freebsd-license.html
|
|
License: BSD
|
|
URL: http://nginx.net/
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
BuildRequires: pcre-devel,zlib-devel,openssl-devel,perl-devel
|
|
Requires: pcre,zlib,openssl
|
|
Requires(pre): %{_sbindir}/useradd
|
|
Requires(post): /sbin/chkconfig
|
|
Requires(preun): /sbin/chkconfig, /sbin/service
|
|
Requires(postun): /sbin/service
|
|
|
|
Source0: http://sysoev.ru/nginx/nginx-%{version}.tar.gz
|
|
Source1: %{name}.init
|
|
Source2: %{name}.logrotate
|
|
|
|
# removes -Werror in upstream build scripts. -Werror conflicts with
|
|
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
|
|
Patch0: nginx-auto-cc-gcc.patch
|
|
|
|
# nginx has its own configure/build scripts. These patches allow nginx
|
|
# to install into a buildroot.
|
|
Patch1: nginx-auto-install.patch
|
|
Patch2: nginx-auto-options.patch
|
|
|
|
# configuration patch to match all the Fedora paths for logs, pid files
|
|
# etc.
|
|
Patch3: nginx-conf.patch
|
|
|
|
%description
|
|
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
|
|
proxy server written by Igor Sysoev.
|
|
|
|
%prep
|
|
%setup -q
|
|
|
|
%patch0 -p0
|
|
%patch1 -p0
|
|
%patch2 -p0
|
|
%patch3 -p0
|
|
|
|
%build
|
|
# nginx does not utilize a standard configure script. It has its own
|
|
# and the standard configure options cause the nginx configure script
|
|
# to error out. This is is also the reason for the DESTDIR environment
|
|
# variable. The configure script(s) have been patched (Patch1 and
|
|
# Patch2) in order to support installing into a build environment.
|
|
export DESTDIR=%{buildroot}
|
|
./configure \
|
|
--user=%{nginx_user} \
|
|
--group=%{nginx_group} \
|
|
--prefix=%{nginx_datadir} \
|
|
--sbin-path=%{_sbindir}/%{name} \
|
|
--conf-path=%{nginx_confdir}/%{name}.conf \
|
|
--error-log-path=%{nginx_logdir}/error.log \
|
|
--http-log-path=%{nginx_logdir}/access.log \
|
|
--http-client-body-temp-path=%{nginx_home_tmp}/client_body \
|
|
--http-proxy-temp-path=%{nginx_home_tmp}/proxy \
|
|
--http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
|
|
--pid-path=%{_localstatedir}/run/%{name}.pid \
|
|
--lock-path=%{_localstatedir}/lock/subsys/%{name} \
|
|
--with-http_ssl_module \
|
|
--with-http_realip_module \
|
|
--with-http_addition_module \
|
|
--with-http_sub_module \
|
|
--with-http_dav_module \
|
|
--with-http_flv_module \
|
|
--with-http_stub_status_module \
|
|
--with-http_perl_module \
|
|
--with-mail \
|
|
--with-mail_ssl_module \
|
|
--with-cc-opt="%{optflags} $(pcre-config --cflags)"
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
%install
|
|
rm -rf %{buildroot}
|
|
make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
|
|
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
|
|
find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \;
|
|
find %{buildroot} -type f -empty -exec rm -f {} \;
|
|
find %{buildroot} -type f -exec chmod 0644 {} \;
|
|
find %{buildroot} -type f -name '*.so' -exec chmod 0755 {} \;
|
|
chmod 0755 %{buildroot}%{_sbindir}/nginx
|
|
%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
|
|
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|
%{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
|
|
%{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
|
|
|
|
# convert to UTF-8 all files that give warnings.
|
|
for textfile in CHANGES
|
|
do
|
|
mv $textfile $textfile.old
|
|
iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old
|
|
rm -f $textfile.old
|
|
done
|
|
|
|
%clean
|
|
rm -rf %{buildroot}
|
|
|
|
%pre
|
|
%{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home} %{nginx_user} 2>/dev/null || :
|
|
|
|
%post
|
|
/sbin/chkconfig --add %{name}
|
|
|
|
%preun
|
|
if [ $1 = 0 ]; then
|
|
/sbin/service %{name} stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del %{name}
|
|
fi
|
|
|
|
%postun
|
|
if [ $1 -ge 1 ]; then
|
|
/sbin/service %{name} condrestart > /dev/null 2>&1 || :
|
|
fi
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc LICENSE CHANGES README
|
|
%dir %{nginx_datadir}
|
|
%dir %{nginx_datadir}/html
|
|
%{_datadir}/%{name}/*/*
|
|
%{_sbindir}/%{name}
|
|
%{_mandir}/man3/%{name}.3pm.gz
|
|
%{_initrddir}/%{name}
|
|
%dir %{nginx_confdir}
|
|
%config(noreplace) %{nginx_confdir}/win-utf
|
|
%config(noreplace) %{nginx_confdir}/%{name}.conf.default
|
|
%config(noreplace) %{nginx_confdir}/mime.types.default
|
|
%config(noreplace) %{nginx_confdir}/koi-win
|
|
%config(noreplace) %{nginx_confdir}/koi-utf
|
|
%config(noreplace) %{nginx_confdir}/%{name}.conf
|
|
%config(noreplace) %{nginx_confdir}/mime.types
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
|
%dir %{perl_vendorarch}/auto/%{name}
|
|
%{perl_vendorarch}/%{name}.pm
|
|
%{perl_vendorarch}/auto/%{name}/%{name}.so
|
|
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
|
|
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp}
|
|
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir}
|
|
|
|
|
|
%changelog
|
|
* Sat Dec 15 2007 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.34-1
|
|
- update to 0.5.34
|
|
|
|
* Sun Nov 11 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.33-1
|
|
- update to 0.5.33
|
|
|
|
* Mon Sep 24 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.32-1
|
|
- updated to 0.5.32
|
|
- fixed rpmlint UTF-8 complaints.
|
|
|
|
* Sat Aug 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.31-2
|
|
- added --with-http_stub_status_module build option.
|
|
- added --with-http_sub_module build option.
|
|
- added use of pcre-config --cflags
|
|
|
|
* Fri Aug 17 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.31-1
|
|
- Update to 0.5.31
|
|
- specify license is BSD
|
|
|
|
* Sat Aug 11 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.30-2
|
|
- Add BuildRequires: perl-devel - fixing rawhide build
|
|
|
|
* Mon Jul 30 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.30-1
|
|
- Update to 0.5.30
|
|
|
|
* Tue Jul 24 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.29-1
|
|
- Update to 0.5.29
|
|
|
|
* Wed Jul 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.28-1
|
|
- Update to 0.5.28
|
|
|
|
* Mon Jul 09 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.27-1
|
|
- Update to 0.5.27
|
|
|
|
* Mon Jun 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.26-1
|
|
- Update to 0.5.26
|
|
|
|
* Sat Apr 28 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.19-1
|
|
- Update to 0.5.19
|
|
|
|
* Mon Apr 02 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.17-1
|
|
- Update to 0.5.17
|
|
|
|
* Mon Mar 26 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.16-1
|
|
- Update to 0.5.16
|
|
- add ownership of /usr/share/nginx/html (#233950)
|
|
|
|
* Fri Mar 23 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-3
|
|
- fixed package review bugs (#235222) given by ruben@rubenkerkhof.com
|
|
|
|
* Thu Mar 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-2
|
|
- fixed package review bugs (#233522) given by kevin@tummy.com
|
|
|
|
* Thu Mar 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-1
|
|
- create patches to assist with building for Fedora
|
|
- initial packaging for Fedora
|