| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- ##
- ## nginx.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2017 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## 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.
- ##
- # package version
- %define V_nginx 1.13.5
- %define V_nginx_headmore 0.32
- %define V_nginx_ajp 0.3.0
- %define V_nginx_lua 0.10.10
- %define V_nginx_redis 0.14
- %define V_nginx_echo 0.61rc1
- %define V_nginx_davext 0.1.0
- %define V_nginx_digest 20150331
- %define V_nginx_fancyindex 0.4.2
- %define V_nginx_geoip2 2.0
- %define V_nginx_njs c347ea0bbdd6
- %define V_nginx_brotli 20170902
- # package information
- Name: nginx
- Summary: Reverse Proxy Server
- URL: http://nginx.org/
- Vendor: Igor Sysoev
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: PLUS
- Group: Web
- License: MIT-style
- Version: %{V_nginx}
- Release: 20170905
- # package options
- %option with_ajp no
- %option with_perl no
- %option with_lua no
- %option with_redis no
- %option with_echo no
- %option with_davext no
- %option with_digest no
- %option with_fancyindex no
- %option with_geoip2 no
- %option with_njs no
- %option with_stream no
- %option with_brotli no
- # list of sources
- Source0: http://nginx.org/download/nginx-%{V_nginx}.tar.gz
- Source1: https://github.com/openresty/headers-more-nginx-module/archive/v%{V_nginx_headmore}.tar.gz
- Source2: https://github.com/yaoweibin/nginx_ajp_module/archive/v%{V_nginx_ajp}.tar.gz
- Source3: https://github.com/openresty/lua-nginx-module/archive/v%{V_nginx_lua}.tar.gz
- Source4: https://github.com/openresty/redis2-nginx-module/archive/v%{V_nginx_redis}.tar.gz
- Source5: https://github.com/openresty/echo-nginx-module/archive/v%{V_nginx_echo}.tar.gz
- Source6: https://github.com/arut/nginx-dav-ext-module/archive/v%{V_nginx_davext}.tar.gz
- Source7: http://download.openpkg.org/components/versioned/nginx/nginx-http-auth-digest-%{V_nginx_digest}.tar.gz
- Source8: https://github.com/aperezdc/ngx-fancyindex/archive/v%{V_nginx_fancyindex}.tar.gz
- Source9: https://github.com/leev/ngx_http_geoip2_module/archive/%{V_nginx_geoip2}.tar.gz
- Source10: http://hg.nginx.org/njs/archive/%{V_nginx_njs}.tar.gz
- Source11: http://download.openpkg.org/components/versioned/nginx/ngx_brotli-%{V_nginx_brotli}.tar.xz
- Source12: nginx.conf
- Source13: rc.nginx
- Patch0: nginx.patch
- # build information
- BuildPreReq: OpenPKG, openpkg >= 20160101
- PreReq: OpenPKG, openpkg >= 20160101, x509
- BuildPreReq: zlib, pcre, openssl, geoip
- PreReq: zlib, pcre, openssl, geoip
- %if "%{with_perl}" == "yes"
- BuildPreReq: perl
- PreReq: perl
- %endif
- %if "%{with_davext}" == "yes"
- BuildPreReq: expat
- PreReq: expat
- %endif
- %if "%{with_geoip2}" == "yes"
- BuildPreReq: geoip2
- PreReq: geoip2
- %endif
- %if "%{with_lua}" == "yes"
- BuildPreReq: lua51
- PreReq: lua51
- %endif
- %description
- Nginx (pronounced "engine X" is a lightweight, event-driven
- high-performance Web server/reverse proxy and e-mail (IMAP/POP3)
- proxy. It provides the following HTTP features: Handling of static
- files, index files, and auto-indexing; Reverse proxy with caching;
- Load balancing; Fault tolerance; SSL support; FastCGI support with
- caching; Name- and IP-based virtual servers; FLV streaming; MP4
- streaming; Web page access authentication; gzip compression; and
- ability to handle more than 10.000 simultaneous connections.
- %track
- prog nginx:nginx = {
- version = %{V_nginx}
- url = http://nginx.org/en/download.html
- regex = nginx-(1\.\d+\.\d+)\.tar\.gz
- }
- prog nginx:nginx-headmore = {
- version = %{V_nginx_headmore}
- url = https://github.com/openresty/headers-more-nginx-module/releases
- regex = v(\d+\.\d\d)\.tar\.gz
- }
- prog nginx:nginx-ajp = {
- version = %{V_nginx_ajp}
- url = https://github.com/yaoweibin/nginx_ajp_module/releases
- regex = v(__VER__)\.tar\.gz
- }
- prog nginx:nginx-lua = {
- version = %{V_nginx_lua}
- url = https://github.com/openresty/lua-nginx-module/releases
- regex = v(__VER__)\.tar\.gz
- }
- prog nginx:nginx-redis = {
- version = %{V_nginx_redis}
- url = https://github.com/openresty/redis2-nginx-module/releases
- regex = v(__VER__)\.tar\.gz
- }
- prog nginx:nginx-echo = {
- version = %{V_nginx_echo}
- url = https://github.com/openresty/echo-nginx-module/releases
- regex = v(__VER__)\.tar\.gz
- }
- prog nginx:nginx-davext = {
- version = %{V_nginx_davext}
- url = https://github.com/arut/nginx-dav-ext-module/releases
- regex = v(__VER__)\.tar\.gz
- }
- prog nginx:nginx-digest = {
- version = %{V_nginx_digest}
- url = http://download.openpkg.org/components/versioned/nginx/
- regex = nginx-http-auth-digest-(__VER__)\.tar\.gz
- }
- prog nginx:nginx-fancyindex = {
- version = %{V_nginx_fancyindex}
- url = https://github.com/aperezdc/ngx-fancyindex/releases
- regex = v(__VER__)\.tar\.gz
- }
- prog nginx:nginx-geoip2 = {
- version = %{V_nginx_geoip2}
- url = https://github.com/leev/ngx_http_geoip2_module/releases
- regex = (__VER__)\.tar\.gz
- }
- prog nginx:nginx-njs = {
- version = %{V_nginx_njs}
- url = http://hg.nginx.org/njs/
- regex = rev/([\da-f]+)
- }
- prog nginx:nginx-brotli = {
- version = %{V_nginx_brotli}
- url = http://download.openpkg.org/components/versioned/nginx/
- regex = ngx_brotli-(__VER__)\.tar\.xz
- }
- %prep
- %setup -q
- %patch -p0
- %setup -q -T -D -a 1
- mv headers-more-nginx-module-* nginx_headers_more_module
- %if "%{with_ajp}" == "yes"
- %setup -q -T -D -a 2
- mv nginx_ajp_module-* nginx_ajp_module
- %endif
- %if "%{with_lua}" == "yes"
- %setup -q -T -D -a 3
- mv lua-nginx-module-* nginx_lua_module
- %endif
- %if "%{with_redis}" == "yes"
- %setup -q -T -D -a 4
- mv redis2-nginx-module-* nginx_redis_module
- %endif
- %if "%{with_echo}" == "yes"
- %setup -q -T -D -a 5
- mv echo-nginx-module-* nginx_echo_module
- %endif
- %if "%{with_davext}" == "yes"
- %setup -q -T -D -a 6
- mv nginx-dav-ext-module-* nginx_davext_module
- %endif
- %if "%{with_digest}" == "yes"
- %setup -q -T -D -a 7
- mv nginx-http-auth-digest nginx_http_auth_digest_module
- %endif
- %if "%{with_fancyindex}" == "yes"
- %setup -q -T -D -a 8
- mv ngx-fancyindex-* nginx_fancyindex_module
- %endif
- %if "%{with_geoip2}" == "yes"
- %setup -q -T -D -a 9
- mv ngx_http_geoip2_module-* ngx_http_geoip2_module
- %endif
- %if "%{with_njs}" == "yes"
- %setup -q -T -D -a 10
- mv njs-* ngx_njs_module
- %endif
- %if "%{with_brotli}" == "yes"
- %setup -q -T -D -a 11
- mv ngx_brotli nginx_brotli_module
- %endif
- %build
- # configure program
- %{l_shtool} subst \
- -e 's;/usr/local;%{l_prefix};g' \
- auto/lib/*/conf
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O} %{l_cppflags openssl .}" \
- LDFLAGS="%{l_ldflags}" \
- %if "%{with_lua}" == "yes"
- LUA_INC=%{l_prefix}/include/lua51/lua \
- LUA_LIB=%{l_prefix}/lib/lua51 \
- %endif
- ./configure \
- --prefix=%{l_prefix} \
- --conf-path=%{l_prefix}/etc/nginx/nginx.conf \
- --error-log-path=%{l_prefix}/var/nginx/log/nginx.log \
- --pid-path=%{l_prefix}/var/nginx/var/nginx.pid \
- --lock-path=%{l_prefix}/var/nginx/var/nginx.lck \
- --http-log-path=%{l_prefix}/var/nginx/log/nginx.access.log \
- --http-client-body-temp-path=%{l_prefix}/var/nginx/tmp/cbody \
- --http-proxy-temp-path=%{l_prefix}/var/nginx/tmp/proxy \
- --http-fastcgi-temp-path=%{l_prefix}/var/nginx/tmp/fastcgi \
- --http-uwsgi-temp-path=%{l_prefix}/var/nginx/tmp/uwsgi \
- --http-scgi-temp-path=%{l_prefix}/var/nginx/tmp/scgi \
- --user=%{l_nusr} \
- --group=%{l_ngrp} \
- --add-module=`pwd`/nginx_headers_more_module \
- %if "%{with_ajp}" == "yes"
- --add-module=`pwd`/nginx_ajp_module \
- %endif
- %if "%{with_perl}" == "yes"
- --with-http_perl_module \
- --with-perl=%{l_prefix}/bin/perl \
- %endif
- %if "%{with_lua}" == "yes"
- --add-module=`pwd`/nginx_lua_module \
- %endif
- %if "%{with_redis}" == "yes"
- --add-module=`pwd`/nginx_redis_module \
- %endif
- %if "%{with_echo}" == "yes"
- --add-module=`pwd`/nginx_echo_module \
- %endif
- %if "%{with_davext}" == "yes"
- --add-module=`pwd`/nginx_davext_module \
- %endif
- %if "%{with_digest}" == "yes"
- --add-module=`pwd`/nginx_http_auth_digest_module \
- %endif
- %if "%{with_fancyindex}" == "yes"
- --add-module=`pwd`/nginx_fancyindex_module \
- %endif
- %if "%{with_geoip2}" == "yes"
- --add-module=`pwd`/ngx_http_geoip2_module \
- %endif
- %if "%{with_njs}" == "yes"
- --add-module=`pwd`/ngx_njs_module/nginx \
- %endif
- %if "%{with_brotli}" == "yes"
- --add-module=`pwd`/nginx_brotli_module \
- %endif
- %if "%{with_stream}" == "yes"
- --with-stream \
- --with-stream_ssl_module \
- --with-stream_realip_module \
- --with-stream_geoip_module \
- --with-stream_ssl_preread_module \
- %endif
- --with-http_addition_module \
- --with-http_auth_request_module \
- --with-http_dav_module \
- --with-http_degradation_module \
- --with-http_flv_module \
- --with-http_geoip_module \
- --with-http_gunzip_module \
- --with-http_gzip_static_module \
- --with-http_random_index_module \
- --with-http_realip_module \
- --with-http_secure_link_module \
- --with-http_ssl_module \
- --with-http_v2_module \
- --with-http_stub_status_module \
- --with-http_sub_module
- # build program
- %{l_make} %{l_mflags -O}
- %install
- # install program
- %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
- # strip down installation
- strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
- # install default configuration
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/*
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/nginx \
- $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/nginx.d
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- %{SOURCE nginx.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/
- %{l_shtool} install -c -m 644 \
- conf/mime.types $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/
- # install run-command script
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.nginx} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # create run-time directories
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/tmp/cbody \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/tmp/proxy \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/tmp/fastcgi \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/tmp/uwsgi \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/tmp/scgi \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/log \
- $RPM_BUILD_ROOT%{l_prefix}/var/nginx/run
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/nginx/*' \
- '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/nginx/*' \
- '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/nginx/*/*'
- %files -f files
- %clean
|