From 856e45a2034d2dc2d76e9e7032ffdc38bd4d0fd3 Mon Sep 17 00:00:00 2001 From: jjh Date: Sat, 24 Mar 2007 18:31:48 +0000 Subject: [PATCH] auto-import nginx-0.5.15-3 on branch devel from nginx-0.5.15-3.src.rpm --- .cvsignore | 1 + nginx-auto-cc-gcc.patch | 13 ++++ nginx-auto-install.patch | 68 +++++++++++++++++ nginx-auto-options.patch | 10 +++ nginx-conf.patch | 55 +++++++++++++ nginx.init | 82 ++++++++++++++++++++ nginx.logrotate | 12 +++ nginx.spec | 161 +++++++++++++++++++++++++++++++++++++++ sources | 1 + 9 files changed, 403 insertions(+) create mode 100644 nginx-auto-cc-gcc.patch create mode 100644 nginx-auto-install.patch create mode 100644 nginx-auto-options.patch create mode 100644 nginx-conf.patch create mode 100644 nginx.init create mode 100644 nginx.logrotate create mode 100644 nginx.spec diff --git a/.cvsignore b/.cvsignore index e69de29..d44aa47 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +nginx-0.5.15.tar.gz diff --git a/nginx-auto-cc-gcc.patch b/nginx-auto-cc-gcc.patch new file mode 100644 index 0000000..ff693dc --- /dev/null +++ b/nginx-auto-cc-gcc.patch @@ -0,0 +1,13 @@ +--- auto/cc/gcc.orig 2007-03-22 08:34:53.000000000 -0600 ++++ auto/cc/gcc 2007-03-22 08:58:47.000000000 -0600 +@@ -172,7 +172,9 @@ + + + # stop on warning +-CFLAGS="$CFLAGS -Werror" ++# This combined with Fedora's FORTIFY_SOURCE=2 option causes it nginx ++# to not compile. ++#CFLAGS="$CFLAGS -Werror" + + # debug + CFLAGS="$CFLAGS -g" diff --git a/nginx-auto-install.patch b/nginx-auto-install.patch new file mode 100644 index 0000000..86c855f --- /dev/null +++ b/nginx-auto-install.patch @@ -0,0 +1,68 @@ +--- auto/install.orig 2007-03-22 09:30:15.000000000 -0600 ++++ auto/install 2007-03-22 09:40:42.000000000 -0600 +@@ -19,42 +19,42 @@ + + install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \ + $NGX_INSTALL_PERL_MODULES +- test -d '$NGX_PREFIX' || mkdir -p '$NGX_PREFIX' ++ test -d '$NGX_DEST_DIR$NGX_PREFIX' || mkdir -p '$NGX_DEST_DIR$NGX_PREFIX' + +- test -d '`dirname "$NGX_SBIN_PATH"`' \ +- || mkdir -p '`dirname "$NGX_SBIN_PATH"`' +- test ! -f '$NGX_SBIN_PATH' || mv '$NGX_SBIN_PATH' '$NGX_SBIN_PATH.old' +- cp $NGX_OBJS/nginx '$NGX_SBIN_PATH' ++ test -d '`dirname "$NGX_DEST_DIR$NGX_SBIN_PATH"`' \ ++ || mkdir -p '`dirname "$NGX_DEST_DIR$NGX_SBIN_PATH"`' ++ test ! -f '$NGX_DEST_DIR$NGX_SBIN_PATH' || mv '$NGX_DEST_DIR$NGX_SBIN_PATH' '$NGX_DEST_DIR$NGX_SBIN_PATH.old' ++ cp $NGX_OBJS/nginx '$NGX_DEST_DIR$NGX_SBIN_PATH' + +- test -d '`dirname "$NGX_CONF_PATH"`' \ +- || mkdir -p '`dirname "$NGX_CONF_PATH"`' ++ test -d '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`' \ ++ || mkdir -p '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`' + +- cp conf/koi-win '`dirname "$NGX_CONF_PATH"`' +- cp conf/koi-utf '`dirname "$NGX_CONF_PATH"`' +- cp conf/win-utf '`dirname "$NGX_CONF_PATH"`' ++ cp conf/koi-win '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`' ++ cp conf/koi-utf '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`' ++ cp conf/win-utf '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`' + +- test -f '`dirname "$NGX_CONF_PATH"`/mime.types' || \ +- cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types' +- cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types.default' ++ test -f '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/mime.types' || \ ++ cp conf/mime.types '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/mime.types' ++ cp conf/mime.types '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/mime.types.default' + +- test -f '$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_CONF_PATH' +- cp conf/nginx.conf '`dirname "$NGX_CONF_PATH"`/nginx.conf.default' ++ test -f '$NGX_DEST_DIR$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_DEST_DIR$NGX_CONF_PATH' ++ cp conf/nginx.conf '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/nginx.conf.default' + +- test -d '`dirname "$NGX_PID_PATH"`' \ +- || mkdir -p '`dirname "$NGX_PID_PATH"`' ++ test -d '`dirname "$NGX_DEST_DIR$NGX_PID_PATH"`' \ ++ || mkdir -p '`dirname "$NGX_DEST_DIR$NGX_PID_PATH"`' + +- test -d '`dirname "$NGX_HTTP_LOG_PATH"`' || \ +- mkdir -p '`dirname "$NGX_HTTP_LOG_PATH"`' ++ test -d '`dirname "$NGX_DEST_DIR$NGX_HTTP_LOG_PATH"`' || \ ++ mkdir -p '`dirname "$NGX_DEST_DIR$NGX_HTTP_LOG_PATH"`' + +- test -d '$NGX_PREFIX/html' || cp -r html '$NGX_PREFIX' ++ test -d '$NGX_DEST_DIR$NGX_PREFIX/html' || cp -r html '$NGX_DEST_DIR$NGX_PREFIX' + END + + +-if test -n "$NGX_ERROR_LOG_PATH"; then ++if test -n "$NGX_DEST_DIR/$NGX_ERROR_LOG_PATH"; then + cat << END >> $NGX_MAKEFILE + +- test -d '`dirname "$NGX_ERROR_LOG_PATH"`' || \ +- mkdir -p '`dirname "$NGX_ERROR_LOG_PATH"`' ++ test -d '`dirname "$NGX_DEST_DIR/$NGX_ERROR_LOG_PATH"`' || \ ++ mkdir -p '`dirname "$NGX_DEST_DIR/$NGX_ERROR_LOG_PATH"`' + END + + fi diff --git a/nginx-auto-options.patch b/nginx-auto-options.patch new file mode 100644 index 0000000..0dc9b16 --- /dev/null +++ b/nginx-auto-options.patch @@ -0,0 +1,10 @@ +--- auto/options.orig 2007-03-22 09:34:58.000000000 -0600 ++++ auto/options 2007-03-22 09:35:33.000000000 -0600 +@@ -4,6 +4,7 @@ + + help=no + ++NGX_DEST_DIR=${DESTDIR:-} + NGX_PREFIX= + NGX_SBIN_PATH= + NGX_CONF_PATH= diff --git a/nginx-conf.patch b/nginx-conf.patch new file mode 100644 index 0000000..693020b --- /dev/null +++ b/nginx-conf.patch @@ -0,0 +1,55 @@ +--- conf/nginx.conf.orig 2007-03-22 22:44:23.000000000 -0600 ++++ conf/nginx.conf 2007-03-22 23:06:48.000000000 -0600 +@@ -1,12 +1,11 @@ +- +-#user nobody; ++user nginx; + worker_processes 1; + +-#error_log logs/error.log; +-#error_log logs/error.log notice; +-#error_log logs/error.log info; ++error_log /var/log/nginx/error.log; ++#error_log /var/log/nginx/error.log notice; ++#error_log /var/log/nginx/error.log info; + +-#pid logs/nginx.pid; ++pid /var/run/nginx.pid; + + + events { +@@ -15,14 +14,14 @@ + + + http { +- include conf/mime.types; ++ include /etc/nginx/mime.types; + default_type application/octet-stream; + +- #log_format main '$remote_addr - $remote_user [$time_local] $request ' +- # '"$status" $body_bytes_sent "$http_referer" ' +- # '"$http_user_agent" "$http_x_forwarded_for"'; ++ log_format main '$remote_addr - $remote_user [$time_local] $request ' ++ '"$status" $body_bytes_sent "$http_referer" ' ++ '"$http_user_agent" "$http_x_forwarded_for"'; + +- #access_log logs/access.log main; ++ access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; +@@ -38,7 +37,7 @@ + + #charset koi8-r; + +- #access_log logs/host.access.log main; ++ #access_log /var/log/nginx/host.access.log main; + + location / { + root html; +@@ -113,5 +112,4 @@ + # index index.html index.htm; + # } + #} +- + } diff --git a/nginx.init b/nginx.init new file mode 100644 index 0000000..9074c90 --- /dev/null +++ b/nginx.init @@ -0,0 +1,82 @@ +#!/bin/sh +# +# nginx - this script starts and stops the nginx daemin +# +# chkconfig: - 85 15 +# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ +# proxy and IMAP/POP3 proxy server +# processname: nginx +# config: /etc/nginx/nginx.conf +# pidfile: /var/run/nginx.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "$NETWORKING" = "no" ] && exit 0 + +nginx="/usr/sbin/nginx" +prog=$(basename $nginx) + +[ -e /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx + +lockfile=/var/lock/subsys/nginx + +start() { + echo -n $"Starting $prog: " + daemon $nginx -c /etc/$prog/$prog.conf + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog -QUIT + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $prog: " + killproc $nginx -HUP + RETVAL=$? + echo +} + +force_reload() { + restart +} + +fdr_status() { + status $prog +} + +case "$1" in + start|stop|restart|reload) + $1 + ;; + force-reload) + force_reload + ;; + status) + fdr_status + ;; + condrestart|try-restart) + [ ! -f $lockfile ] || restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" + exit 2 +esac diff --git a/nginx.logrotate b/nginx.logrotate new file mode 100644 index 0000000..48c39e1 --- /dev/null +++ b/nginx.logrotate @@ -0,0 +1,12 @@ +/var/log/nginx/*log { + daily + rotate 10 + missingok + notifempty + compress + sharedscripts + postrotate + [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid` + endscript +} + diff --git a/nginx.spec b/nginx.spec new file mode 100644 index 0000000..d398253 --- /dev/null +++ b/nginx.spec @@ -0,0 +1,161 @@ +%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 + +Name: nginx +Version: 0.5.15 +Release: 3%{?dist} +Summary: Robust, small and high performance http and reverse proxy server +Group: System Environment/Daemons + +# The license appears to be equivalent to the New BSD License +# (http://www.opensource.org/licenses/bsd-license.php) without the 3rd +# clause. Which according to OSI makes it functionally equivalent to +# the MIT license. The documentation on the nginx wiki +# (http://wiki.codemongers.com/Nginx) says : +# +# "The sources are licensed under a BSD-like license" +License: BSD-like +URL: http://nginx.net/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: pcre-devel,zlib-devel,openssl-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=%{_datadir}/%{name} \ + --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_dav_module \ + --with-http_flv_module \ + --with-http_perl_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-cc-opt="%{optflags}" +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} + +%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 %{_datadir}/%{name} +%{_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 +* Fri Mar 23 2007 Jeremy Hinegardner - 0.5.15-3 +- fixed package review bugs (#235222) given by ruben@rubenkerkhof.com + +* Thu Mar 22 2007 Jeremy Hinegardner - 0.5.15-2 +- fixed package review bugs (#233522) given by kevin@tummy.com + +* Thu Mar 22 2007 Jeremy Hinegardner - 0.5.15-1 +- create patches to assist with building for Fedora +- initial packaging for Fedora diff --git a/sources b/sources index e69de29..60acd65 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +651feea215c9d934542b4bae1711d921 nginx-0.5.15.tar.gz