1 |
%define nginx_user nginx |
2 |
%define nginx_group %{nginx_user} |
3 |
%define nginx_home /var/lib/nginx |
4 |
%define nginx_home_tmp %{nginx_home}/tmp |
5 |
%define nginx_logdir /var/log/nginx |
6 |
%define nginx_confdir %{_sysconfdir}/nginx |
7 |
%define nginx_datadir %{_datadir}/nginx |
8 |
%define nginx_webroot %{nginx_datadir}/html |
9 |
|
10 |
Summary: Robust, small and high performance http and reverse proxy server |
11 |
Name: nginx |
12 |
Version: 1.17.3 |
13 |
Release: %mkrel 1 |
14 |
Group: System/Servers |
15 |
# BSD License (two clause) |
16 |
# http://www.freebsd.org/copyright/freebsd-license.html |
17 |
License: BSD |
18 |
URL: http://nginx.net/ |
19 |
Source0: http://nginx.org/download/nginx-%{version}.tar.gz |
20 |
Source1: http://nginx.org/download/nginx-%{version}.tar.gz.asc |
21 |
Source3: %{name}.logrotate |
22 |
Source4: %{name}.sysconfig |
23 |
Source5: %{name}.service |
24 |
|
25 |
Source6: nginx.conf |
26 |
Source7: default.conf |
27 |
Source8: ssl.conf |
28 |
Source9: virtual.conf |
29 |
Source100: index.html |
30 |
Source101: poweredby.png |
31 |
Source102: nginx-logo.png |
32 |
Source103: 50x.html |
33 |
Source104: 404.html |
34 |
|
35 |
Requires(post): rpm-helper >= 0.24.8-1 |
36 |
Requires(preun): rpm-helper >= 0.24.8-1 |
37 |
BuildRequires: pkgconfig(geoip) |
38 |
BuildRequires: pkgconfig(gdlib) |
39 |
BuildRequires: pkgconfig(libxslt) |
40 |
BuildRequires: pkgconfig(openssl) |
41 |
BuildRequires: pkgconfig(libpcre) |
42 |
BuildRequires: pkgconfig(zlib) |
43 |
BuildRequires: perl-devel |
44 |
BuildRequires: perl(ExtUtils::Embed) |
45 |
Requires: pcre |
46 |
Requires: openssl |
47 |
Provides: webserver |
48 |
|
49 |
%description |
50 |
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 |
51 |
proxy server written by Igor Sysoev. |
52 |
|
53 |
%prep |
54 |
%setup -q |
55 |
|
56 |
%build |
57 |
%serverbuild |
58 |
# nginx does not utilize a standard configure script. It has its own |
59 |
# and the standard configure options cause the nginx configure script |
60 |
# to error out. This is is also the reason for the DESTDIR environment |
61 |
# variable. The configure script(s) have been patched (Patch1 and |
62 |
# Patch2) in order to support installing into a build environment. |
63 |
export DESTDIR=%{buildroot} |
64 |
./configure \ |
65 |
--prefix=%{nginx_datadir} \ |
66 |
--sbin-path=%{_sbindir}/%{name} \ |
67 |
--conf-path=%{nginx_confdir}/%{name}.conf \ |
68 |
--error-log-path=%{nginx_logdir}/error.log \ |
69 |
--http-log-path=%{nginx_logdir}/access.log \ |
70 |
--http-client-body-temp-path=%{nginx_home_tmp}/client_body \ |
71 |
--http-proxy-temp-path=%{nginx_home_tmp}/proxy \ |
72 |
--http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \ |
73 |
--http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \ |
74 |
--http-scgi-temp-path=%{nginx_home_tmp}/scgi \ |
75 |
--pid-path=/run/%{name}.pid \ |
76 |
--lock-path=/run/lock/subsys/%{name} \ |
77 |
--user=%{nginx_user} \ |
78 |
--group=%{nginx_group} \ |
79 |
--with-threads \ |
80 |
--with-file-aio \ |
81 |
--with-ipv6 \ |
82 |
--with-http_ssl_module \ |
83 |
--with-http_v2_module \ |
84 |
--with-http_realip_module \ |
85 |
--with-http_addition_module \ |
86 |
--with-http_xslt_module \ |
87 |
--with-http_image_filter_module \ |
88 |
--with-http_geoip_module \ |
89 |
--with-http_sub_module \ |
90 |
--with-http_dav_module \ |
91 |
--with-http_flv_module \ |
92 |
--with-http_mp4_module \ |
93 |
--with-http_gunzip_module \ |
94 |
--with-http_gzip_static_module \ |
95 |
--with-http_random_index_module \ |
96 |
--with-http_secure_link_module \ |
97 |
--with-http_degradation_module \ |
98 |
--with-http_stub_status_module \ |
99 |
--with-http_perl_module \ |
100 |
--with-mail \ |
101 |
--with-mail_ssl_module \ |
102 |
--with-stream \ |
103 |
--with-stream_ssl_module \ |
104 |
--with-cc-opt="$CFLAGS $(pcre-config --cflags)" |
105 |
|
106 |
%make_build |
107 |
|
108 |
%install |
109 |
%make_install INSTALLDIRS=vendor |
110 |
|
111 |
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d |
112 |
%{__install} -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} |
113 |
|
114 |
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig |
115 |
%{__install} -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/%{name} |
116 |
|
117 |
%{__install} -d -m 755 %{buildroot}%{_unitdir} |
118 |
%{__install} -m 644 %{SOURCE5} %{buildroot}%{_unitdir} |
119 |
|
120 |
%{__install} -m 644 %{SOURCE6} %{buildroot}%{nginx_confdir} |
121 |
|
122 |
%{__install} -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d |
123 |
%{__install} -m 644 %{SOURCE7} %{SOURCE8} %{SOURCE9} \ |
124 |
%{buildroot}%{nginx_confdir}/conf.d |
125 |
|
126 |
%{__install} -d -m 0755 %{buildroot}%{nginx_home_tmp} |
127 |
%{__install} -d -m 0755 %{buildroot}%{nginx_logdir} |
128 |
%{__install} -d -m 0755 %{buildroot}%{nginx_webroot} |
129 |
|
130 |
%{__install} -p -m 0644 %{SOURCE100} %{SOURCE101} %{SOURCE102} \ |
131 |
%{SOURCE103} %{SOURCE104} \ |
132 |
%{buildroot}%{nginx_webroot} |
133 |
|
134 |
# add current version |
135 |
perl -pi -e "s|_VERSION_|%{version}|g" %{buildroot}%{nginx_webroot}/index.html |
136 |
|
137 |
# convert to UTF-8 all files that give warnings. |
138 |
for textfile in CHANGES; do |
139 |
mv $textfile $textfile.old |
140 |
iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old |
141 |
rm -f $textfile.old |
142 |
done |
143 |
|
144 |
install -d %{buildroot}%{_mandir}/man8 |
145 |
install -m0644 man/*.8 %{buildroot}%{_mandir}/man8/ |
146 |
|
147 |
%pre |
148 |
%_pre_useradd %{nginx_user} %{nginx_home} /bin/false |
149 |
|
150 |
%post |
151 |
%_post_service %{nginx_user} |
152 |
|
153 |
%preun |
154 |
%_preun_service %{nginx_user} |
155 |
|
156 |
%postun |
157 |
%_postun_userdel %{nginx_user} |
158 |
|
159 |
%files |
160 |
%doc LICENSE CHANGES README |
161 |
%{nginx_datadir} |
162 |
%{_sbindir}/%{name} |
163 |
%{_mandir}/man3/%{name}.3pm* |
164 |
%{_mandir}/man8/* |
165 |
%{_unitdir}/%{name}.service |
166 |
%dir %{nginx_confdir} |
167 |
%dir %{nginx_confdir}/conf.d |
168 |
%config(noreplace) %{nginx_confdir}/conf.d/*.conf |
169 |
%config(noreplace) %{nginx_confdir}/win-utf |
170 |
%config(noreplace) %{nginx_confdir}/%{name}.conf.default |
171 |
%config(noreplace) %{nginx_confdir}/scgi_params |
172 |
%config(noreplace) %{nginx_confdir}/scgi_params.default |
173 |
%config(noreplace) %{nginx_confdir}/fastcgi.conf |
174 |
%config(noreplace) %{nginx_confdir}/fastcgi.conf.default |
175 |
%config(noreplace) %{nginx_confdir}/mime.types.default |
176 |
%config(noreplace) %{nginx_confdir}/fastcgi_params |
177 |
%config(noreplace) %{nginx_confdir}/fastcgi_params.default |
178 |
%config(noreplace) %{nginx_confdir}/koi-win |
179 |
%config(noreplace) %{nginx_confdir}/koi-utf |
180 |
%config(noreplace) %{nginx_confdir}/%{name}.conf |
181 |
%config(noreplace) %{nginx_confdir}/mime.types |
182 |
%config(noreplace) %{nginx_confdir}/uwsgi_params |
183 |
%config(noreplace) %{nginx_confdir}/uwsgi_params.default |
184 |
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
185 |
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} |
186 |
%{perl_vendorarch}/auto/%{name} |
187 |
%{perl_vendorarch}/%{name}.pm |
188 |
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home} |
189 |
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp} |
190 |
%attr(-,root,adm) %dir %{nginx_logdir} |