[nginx/f16] Update to 1.0.13 and spec file cleanup
Jamie Nguyen
jamielinux at fedoraproject.org
Tue Mar 6 08:47:59 UTC 2012
commit 7098a82a41d3303738b9c571618b948debdb3268
Author: Jamie Nguyen <jamie at tomoyolinux.co.uk>
Date: Tue Mar 6 08:46:21 2012 +0000
Update to 1.0.13 and spec file cleanup
.gitignore | 1 +
nginx.spec | 230 +++++++++++++++++++++++++++++++++---------------------------
sources | 2 +-
3 files changed, 128 insertions(+), 105 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6676a0e..db83f73 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ x86_64/
*swp
*.rpm
/nginx-1.0.12.tar.gz
+/nginx-1.0.13.tar.gz
diff --git a/nginx.spec b/nginx.spec
index 9ca0ee8..bc857e5 100644
--- a/nginx.spec
+++ b/nginx.spec
@@ -1,76 +1,82 @@
-%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
-%define nginx_webroot %{nginx_datadir}/html
-
-Name: nginx
-Version: 1.0.12
-Release: 1%{?dist}
-Summary: Robust, small and high performance HTTP and reverse proxy server
-Group: System Environment/Daemons
-
+%global nginx_user nginx
+%global nginx_group %{nginx_user}
+%global nginx_home %{_localstatedir}/lib/nginx
+%global nginx_home_tmp %{nginx_home}/tmp
+%global nginx_logdir %{_localstatedir}/log/nginx
+%global nginx_confdir %{_sysconfdir}/nginx
+%global nginx_datadir %{_datadir}/nginx
+%global nginx_webroot %{nginx_datadir}/html
+
+Name: nginx
+Version: 1.0.13
+Release: 1%{?dist}
+
+Summary: A high performance web server 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,perl(ExtUtils::Embed)
-BuildRequires: libxslt-devel,GeoIP-devel,gd-devel
-Requires: pcre,openssl,GeoIP,gd
-Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
-# for /usr/sbin/useradd
-Requires(pre): shadow-utils
-Requires(post): chkconfig
-# for /sbin/service
-Requires(preun): chkconfig, initscripts
-Requires(postun): initscripts
-Provides: webserver
-
-Source0: http://nginx.org/download/nginx-%{version}.tar.gz
-Source1: %{name}.init
-Source2: %{name}.logrotate
-Source3: virtual.conf
-Source4: ssl.conf
-Source5: %{name}.sysconfig
-Source6: nginx.conf
-Source7: default.conf
-Source100: index.html
-Source101: poweredby.png
-Source102: nginx-logo.png
-Source103: 50x.html
-Source104: 404.html
+License: BSD
+URL: http://nginx.org/
+
+Source0: http://nginx.org/download/nginx-%{version}.tar.gz
+Source1: nginx.init
+Source2: nginx.logrotate
+Source3: nginx.conf
+Source4: default.conf
+Source5: ssl.conf
+Source6: virtual.conf
+Source7: nginx.sysconfig
+Source100: index.html
+Source101: poweredby.png
+Source102: nginx-logo.png
+Source103: 404.html
+Source104: 50x.html
# 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
+BuildRequires: GeoIP-devel
+BuildRequires: gd-devel
+BuildRequires: libxslt-devel
+BuildRequires: openssl-devel
+BuildRequires: pcre-devel
+BuildRequires: perl-devel
+BuildRequires: perl(ExtUtils::Embed)
+BuildRequires: zlib-devel
+BuildRequires: systemd-units
+Requires: GeoIP
+Requires: gd
+Requires: openssl
+Requires: pcre
+Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Requires(pre): shadow-utils
+Requires(post): chkconfig
+Requires(preun): chkconfig, initscripts
+Requires(postun): initscripts
+Provides: webserver
+
%description
-Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
-proxy server written by Igor Sysoev.
+Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and
+IMAP protocols, with a strong focus on high concurrency, performance and low
+memory usage.
+
%prep
%setup -q
-
%patch0 -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.
+# variable.
export DESTDIR=%{buildroot}
./configure \
- --user=%{nginx_user} \
- --group=%{nginx_group} \
--prefix=%{nginx_datadir} \
- --sbin-path=%{_sbindir}/%{name} \
- --conf-path=%{nginx_confdir}/%{name}.conf \
+ --sbin-path=%{_sbindir}/nginx \
+ --conf-path=%{nginx_confdir}/nginx.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 \
@@ -78,8 +84,12 @@ export DESTDIR=%{buildroot}
--http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
--http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \
--http-scgi-temp-path=%{nginx_home_tmp}/scgi \
- --pid-path=%{_localstatedir}/run/%{name}.pid \
- --lock-path=%{_localstatedir}/lock/subsys/%{name} \
+ --pid-path=%{_localstatedir}/run/nginx.pid \
+ --lock-path=%{_localstatedir}/lock/subsys/nginx \
+ --user=%{nginx_user} \
+ --group=%{nginx_group} \
+ --with-file-aio \
+ --with-ipv6 \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
@@ -97,47 +107,52 @@ export DESTDIR=%{buildroot}
--with-http_stub_status_module \
--with-http_perl_module \
--with-mail \
- --with-file-aio \
--with-mail_ssl_module \
- --with-ipv6 \
--with-cc-opt="%{optflags} $(pcre-config --cflags)" \
--with-ld-opt="-Wl,-E" # so the perl module finds its symbols
+
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 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
-%{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
-%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE7} %{buildroot}%{nginx_confdir}/conf.d
-%{__install} -p -m 0644 %{SOURCE6} %{buildroot}%{nginx_confdir}
-%{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
-%{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
-%{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot}
-%{__install} -p -m 0644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{buildroot}%{nginx_webroot}
-
-# 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}
+
+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 -iname '*.so' -exec chmod 0755 '{}' \;
+
+install -p -D -m 0755 %{SOURCE1} \
+ %{buildroot}%{_initrddir}/nginx
+install -p -D -m 0644 %{SOURCE2} \
+ %{buildroot}%{_sysconfdir}/logrotate.d/nginx
+install -p -D -m 0644 %{SOURCE7} \
+ %{buildroot}%{_sysconfdir}/sysconfig/nginx
+
+install -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
+install -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
+install -p -d -m 0755 %{buildroot}%{nginx_logdir}
+install -p -d -m 0755 %{buildroot}%{nginx_webroot}
+
+install -p -m 0644 %{SOURCE3} \
+ %{buildroot}%{nginx_confdir}
+install -p -m 0644 %{SOURCE4} %{SOURCE5} %{SOURCE6} \
+ %{buildroot}%{nginx_confdir}/conf.d
+install -p -m 0644 %{SOURCE100} \
+ %{buildroot}%{nginx_webroot}
+install -p -m 0644 %{SOURCE101} %{SOURCE102} \
+ %{buildroot}%{nginx_webroot}
+install -p -m 0644 %{SOURCE103} %{SOURCE104} \
+ %{buildroot}%{nginx_webroot}
+
%pre
-if [ $1 == 1 ]; then
- %{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home} %{nginx_user} 2>/dev/null || :
+if [ $1 -eq 1 ]; then
+ getent group %{nginx_group} > /dev/null || groupadd -r %{nginx_group}
+ getent passwd %{nginx_user} > /dev/null || \
+ useradd -r -d %{nginx_home} -g %{nginx_group} \
+ -s /sbin/nologin -c "Nginx web server" %{nginx_user}
+ exit 0
fi
%post
@@ -157,41 +172,48 @@ if [ $1 == 2 ]; then
fi
%files
-%defattr(-,root,root,-)
%doc LICENSE CHANGES README
%{nginx_datadir}/
-%{_sbindir}/%{name}
-%{_mandir}/man3/%{name}.3pm.gz
-%{_initrddir}/%{name}
+%{_sbindir}/nginx
+%{_mandir}/man3/nginx.3pm.gz
+%{_initrddir}/nginx
%dir %{nginx_confdir}
%dir %{nginx_confdir}/conf.d
%dir %{nginx_logdir}
-%config(noreplace) %{nginx_confdir}/conf.d/*.conf
-%config(noreplace) %{nginx_confdir}/win-utf
-%config(noreplace) %{nginx_confdir}/%{name}.conf.default
-%config(noreplace) %{nginx_confdir}/mime.types.default
%config(noreplace) %{nginx_confdir}/fastcgi.conf
%config(noreplace) %{nginx_confdir}/fastcgi.conf.default
%config(noreplace) %{nginx_confdir}/fastcgi_params
%config(noreplace) %{nginx_confdir}/fastcgi_params.default
+%config(noreplace) %{nginx_confdir}/koi-utf
+%config(noreplace) %{nginx_confdir}/koi-win
+%config(noreplace) %{nginx_confdir}/mime.types
+%config(noreplace) %{nginx_confdir}/mime.types.default
+%config(noreplace) %{nginx_confdir}/nginx.conf
+%config(noreplace) %{nginx_confdir}/nginx.conf.default
%config(noreplace) %{nginx_confdir}/scgi_params
%config(noreplace) %{nginx_confdir}/scgi_params.default
%config(noreplace) %{nginx_confdir}/uwsgi_params
%config(noreplace) %{nginx_confdir}/uwsgi_params.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}
-%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
-%dir %{perl_vendorarch}/auto/%{name}
-%{perl_vendorarch}/%{name}.pm
-%{perl_vendorarch}/auto/%{name}/%{name}.so
+%config(noreplace) %{nginx_confdir}/win-utf
+%config(noreplace) %{nginx_confdir}/conf.d/*.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/nginx
+%config(noreplace) %{_sysconfdir}/sysconfig/nginx
+%dir %{perl_vendorarch}/auto/nginx
+%{perl_vendorarch}/nginx.pm
+%{perl_vendorarch}/auto/nginx/nginx.so
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp}
%changelog
+* Tue Mar 03 2012 Jamie Nguyen <jamie at tomoyolinux.co.uk> - 1.0.13-1
+- update to upstream release 1.0.13
+- general spec file cleanup to match rawhide (for easier diff), including:
+- replace %%define with %%global
+- amend %%pre scriptlet to match with guidelines
+- remove obsolete BuildRoot tag, %%clean section and %%defattr
+- remove various unnecessary commands
+
* Sun Feb 19 2012 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.0.12-1
- Update to 1.0.12
diff --git a/sources b/sources
index 4f149b1..3242b66 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d0ceefeb2a68ecb19e78ee894a5b52a3 nginx-1.0.12.tar.gz
+58360774e4875e8fc4c4286448cb54d0 nginx-1.0.13.tar.gz
More information about the scm-commits
mailing list