Browse Source

新增:nginx-module-brotli-1.17.4

呉真机器人 5 years ago
parent
commit
5cfdefe732
3 changed files with 176 additions and 0 deletions
  1. 26 0
      COPYRIGHT
  2. 150 0
      nginx-module-brotli.spec
  3. BIN
      ngx_brotli-1.0.7-1.tar.gz

+ 26 - 0
COPYRIGHT

@@ -0,0 +1,26 @@
+/* 
+ * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */

+ 150 - 0
nginx-module-brotli.spec

@@ -0,0 +1,150 @@
+#
+%define nginx_user nginx
+%define nginx_group nginx
+
+%if 0%{?rhel} || 0%{?amzn}
+%define _group System Environment/Daemons
+BuildRequires: openssl-devel
+%endif
+
+%if 0%{?suse_version} >= 1315
+%define _group Productivity/Networking/Web/Servers
+BuildRequires: libopenssl-devel
+%define _debugsource_template %{nil}
+%endif
+
+%if 0%{?rhel} == 7
+%define epoch 1
+Epoch: %{epoch}
+%define dist .el7
+%endif
+
+%if 0%{?rhel} == 8
+%define epoch 1
+Epoch: %{epoch}
+%define _debugsource_template %{nil}
+%endif
+
+%define main_version 1.17.4
+%define main_release 1%{?dist}.ngx
+
+%define bdir %{_builddir}/%{name}-%{main_version}
+
+Summary: nginx Brotli dynamic modules
+Name: nginx-module-brotli
+Version: 1.17.4
+Release: 1%{?dist}.ngx
+Vendor: Nginx, Inc.
+URL: http://nginx.org/
+Group: %{_group}
+
+Source0: https://nginx.org/download/nginx-%{main_version}.tar.gz
+Source1: ngx_brotli-1.0.7-1.tar.gz
+Source2: COPYRIGHT
+
+
+
+
+License: 2-clause BSD-like license
+
+BuildRoot: %{_tmppath}/%{name}-%{main_version}-%{main_release}-root
+BuildRequires: zlib-devel
+BuildRequires: pcre-devel
+Requires: nginx == %{?epoch:%{epoch}:}1.17.4-1%{?dist}.ngx
+
+%description
+nginx Brotli dynamic modules.
+
+%if 0%{?suse_version} || 0%{?amzn}
+%debug_package
+%endif
+
+%define WITH_CC_OPT $(echo %{optflags} $(pcre-config --cflags))
+%define WITH_LD_OPT -Wl,-z,relro -Wl,-z,now
+
+%define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx --sbin-path=%{_sbindir}/nginx --modules-path=%{_libdir}/nginx/modules --conf-path=%{_sysconfdir}/nginx/nginx.conf --error-log-path=%{_localstatedir}/log/nginx/error.log --http-log-path=%{_localstatedir}/log/nginx/access.log --pid-path=%{_localstatedir}/run/nginx.pid --lock-path=%{_localstatedir}/run/nginx.lock --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module")
+%define MODULE_CONFIGURE_ARGS $(echo "--add-dynamic-module=./ngx_brotli/")
+
+%prep
+%setup -qcTn %{name}-%{main_version}
+tar --strip-components=1 -zxf %{SOURCE0}
+mkdir ngx_brotli
+cd ngx_brotli
+tar --strip-components=1 -zxf %{SOURCE1}
+
+
+
+%build
+
+cd %{bdir}
+./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \
+	--with-cc-opt="%{WITH_CC_OPT}" \
+	--with-ld-opt="%{WITH_LD_OPT}" \
+	--with-debug
+make %{?_smp_mflags} modules
+for so in `find %{bdir}/objs/ -type f -name "*.so"`; do
+debugso=`echo $so | sed -e "s|.so|-debug.so|"`
+mv $so $debugso
+done
+./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \
+	--with-cc-opt="%{WITH_CC_OPT}" \
+	--with-ld-opt="%{WITH_LD_OPT}"
+make %{?_smp_mflags} modules
+
+%install
+cd %{bdir}
+%{__rm} -rf $RPM_BUILD_ROOT
+%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/doc/nginx-module-brotli
+%{__install} -m 644 -p %{SOURCE2} \
+    $RPM_BUILD_ROOT%{_datadir}/doc/nginx-module-brotli/
+
+
+
+%{__mkdir} -p $RPM_BUILD_ROOT%{_libdir}/nginx/modules
+for so in `find %{bdir}/objs/ -maxdepth 1 -type f -name "*.so"`; do
+%{__install} -m755 $so \
+   $RPM_BUILD_ROOT%{_libdir}/nginx/modules/
+done
+
+%check
+%{__rm} -rf $RPM_BUILD_ROOT/usr/src
+cd %{bdir}
+grep -v 'usr/src' debugfiles.list > debugfiles.list.new && mv debugfiles.list.new debugfiles.list
+cat /dev/null > debugsources.list
+%if 0%{?suse_version} >= 1500
+cat /dev/null > debugsourcefiles.list
+%endif
+
+%clean
+%{__rm} -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%{_libdir}/nginx/modules/*
+%dir %{_datadir}/doc/nginx-module-brotli
+%{_datadir}/doc/nginx-module-brotli/*
+
+
+%post
+if [ $1 -eq 1 ]; then
+cat <<BANNER
+----------------------------------------------------------------------
+
+The Brotli dynamic modules for nginx have been installed.
+To enable these modules, add the following to /etc/nginx/nginx.conf
+and reload nginx:
+
+    load_module modules/ngx_http_brotli_filter_module.so;
+    load_module modules/ngx_http_brotli_static_module.so;
+
+Please refer to the modules documentation for further details:
+https://github.com/google/ngx_brotli
+https://github.com/google/brotli
+
+----------------------------------------------------------------------
+BANNER
+fi
+
+%changelog
+* Sun Oct 13 2019 Eugene Wu <kuretru@gmail.com>
+- base version updated to 1.17.4

BIN
ngx_brotli-1.0.7-1.tar.gz