Logoj0ke.net Open Build Service > Projects > home:jg:http > nginx-devel > Changes
Sign Up | Log In

Changes of Revision 4

[-] Added nginx-devel.spec
x
 
1
@@ -0,0 +1,248 @@
2
+%define nginx_user      nginx
3
+%define nginx_group     %{nginx_user}
4
+%define nginx_home      %{_localstatedir}/lib/nginx
5
+%define nginx_home_tmp  %{nginx_home}/tmp
6
+%define nginx_logdir    %{_localstatedir}/log/nginx
7
+%define nginx_confdir   %{_sysconfdir}/nginx
8
+%define nginx_datadir   %{_datadir}/nginx
9
+%define nginx_webroot   %{nginx_datadir}/html
10
+%define rtmp_ext                nginx-rtmp-module
11
+%define rtmp_ext_version        0.9.11
12
+%define rtmp                    %{rtmp_ext}-%{rtmp_ext_version}
13
+%define rtmp_nover              %{rtmp_ext}
14
+%define with_rtmp_ext           1
15
+
16
+Name:           nginx-devel
17
+version:        1.3.14
18
+Release:        1
19
+Summary:        Robust, small and high performance http and reverse proxy server
20
+Group:          System Environment/Daemons   
21
+
22
+License:        BSD
23
+URL:            http://nginx.net/ 
24
+BuildRoot:      %{_tmppath}/%{name}-%{version}-root
25
+
26
+BuildRequires:      pcre-devel,zlib-devel,openssl-devel,perl(ExtUtils::Embed)
27
+Requires:           pcre,zlib,openssl
28
+Requires:           perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
29
+Requires(pre):      shadow-utils
30
+Requires(post):     chkconfig
31
+Requires(preun):    chkconfig, initscripts
32
+Requires(postun):   initscripts
33
+
34
+Source0:    http://sysoev.ru/nginx/nginx-%{version}.tar.gz
35
+Source1:    %{name}.init
36
+Source2:    %{name}.logrotate
37
+Source3:    virtual.conf
38
+Source4:    ssl.conf
39
+Source5:    nginx-upstream-fair.tgz
40
+Source6:    upstream-fair.conf
41
+Source7:    %{name}.sysconfig
42
+Source8:    ngx_slowfs_cache-1.5.tar.gz
43
+Source9:    Nginx-limit-traffic-rate-module.tar.gz
44
+Source10:   %{rtmp}.tar.bz2
45
+Source100:  index.html
46
+Source101:  poweredby.png
47
+Source102:  nginx-logo.png
48
+Source103:  50x.html
49
+Source104:  404.html
50
+
51
+# removes -Werror in upstream build scripts.  -Werror conflicts with
52
+# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
53
+Patch0:     nginx-auto-cc-gcc.patch
54
+
55
+# configuration patch to match all the Fedora paths for logs, pid files
56
+# etc.
57
+Patch1:     nginx-conf-0.7.x.patch
58
+Patch2:        spdy-69.patch
59
+
60
+# syslog patch, use syslog instead of nginx logfiles
61
+#Patch2:       nginx-syslog.patch
62
+#Patch3:       nginx-unix-sockets.diff
63
+#Patch4:       nginx-versiontilt.patch
64
+
65
+%description
66
+Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
67
+proxy server written by Igor Sysoev.
68
+
69
+One third party module, nginx-upstream-fair, has been added.
70
+
71
+%prep
72
+%setup -q
73
+
74
+%patch0 -p0
75
+%patch1 -p0
76
+%patch2 -p1
77
+
78
+#%patch2 -p1
79
+# %patch3 -p1
80
+#%patch4 -p1
81
+%{__tar} zxvf %{SOURCE5}
82
+%{__tar} zxvf %{SOURCE9}
83
+%{__tar} jxvf %{SOURCE10}
84
+
85
+%build
86
+export DESTDIR=%{buildroot}
87
+./configure \
88
+    --user=%{nginx_user} \
89
+    --group=%{nginx_group} \
90
+    --prefix=%{nginx_datadir} \
91
+    --sbin-path=%{_sbindir}/%{name} \
92
+    --conf-path=%{nginx_confdir}/%{name}.conf \
93
+    --error-log-path=%{nginx_logdir}/error.log \
94
+    --http-log-path=%{nginx_logdir}/access.log \
95
+    --http-client-body-temp-path=%{nginx_home_tmp}/client_body \
96
+    --http-proxy-temp-path=%{nginx_home_tmp}/proxy \
97
+    --http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
98
+    --pid-path=%{_localstatedir}/run/%{name}.pid \
99
+    --lock-path=%{_localstatedir}/lock/subsys/%{name} \
100
+    --with-http_ssl_module \
101
+    --with-http_realip_module \
102
+    --with-http_addition_module \
103
+    --with-http_sub_module \
104
+    --with-http_dav_module \
105
+    --with-http_flv_module \
106
+    --with-http_gzip_static_module \
107
+    --with-http_stub_status_module \
108
+    --with-http_mp4_module \
109
+    --with-mail \
110
+    --with-mail_ssl_module \
111
+    --with-debug \
112
+    --with-ipv6 \
113
+    --with-http_spdy_module \
114
+    --with-cc-opt="%{optflags} $(pcre-config --cflags)" \
115
+    --add-module=%{_builddir}/nginx-%{version}/nginx-upstream-fair \
116
+%if 0%{with_rtmp_ext}
117
+    --add-module=%{_builddir}/nginx-%{version}/%{rtmp} \
118
+%endif
119
+    --add-module=%{_builddir}/nginx-%{version}/Nginx-limit-traffic-rate-module
120
+%if 0%{?fedora_version} > 10 
121
+    --with-file-aio
122
+%endif
123
+
124
+make %{?_smp_mflags} 
125
+
126
+mv nginx-upstream-fair/README nginx-upstream-fair/README.nginx-upstream-fair
127
+
128
+%install
129
+rm -rf %{buildroot}
130
+make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
131
+find %{buildroot} -type f -name .packlist -exec rm -f {} \;
132
+find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \;
133
+find %{buildroot} -type f -empty -exec rm -f {} \;
134
+find %{buildroot} -type f -exec chmod 0644 {} \;
135
+find %{buildroot} -type f -name '*.so' -exec chmod 0755 {} \;
136
+chmod 0755 %{buildroot}%{_sbindir}/nginx
137
+%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
138
+%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
139
+%{__install} -p -D -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
140
+%{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
141
+%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE6} %{buildroot}%{nginx_confdir}/conf.d
142
+%{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
143
+%{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
144
+%{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot}
145
+%{__install} -p -m 0644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{buildroot}%{nginx_webroot}
146
+
147
+# convert to UTF-8 all files that give warnings.
148
+for textfile in CHANGES
149
+do
150
+    mv $textfile $textfile.old
151
+    iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old
152
+    rm -f $textfile.old
153
+done
154
+
155
+%clean
156
+rm -rf %{buildroot}
157
+
158
+%pre
159
+%{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home} %{nginx_user} 2>/dev/null || :
160
+
161
+%post
162
+/sbin/chkconfig --add %{name}
163
+
164
+%preun
165
+if [ $1 = 0 ]; then
166
+    /sbin/service %{name} stop >/dev/null 2>&1
167
+    /sbin/chkconfig --del %{name}
168
+fi
169
+
170
+%postun
171
+if [ $1 -ge 1 ]; then
172
+    /sbin/service %{name} condrestart > /dev/null 2>&1 || :
173
+fi
174
+
175
+%files
176
+%defattr(-,root,root,-)
177
+%doc LICENSE CHANGES README nginx-upstream-fair/README.nginx-upstream-fair
178
+%{nginx_datadir}/
179
+%{_sbindir}/%{name}
180
+# %{_mandir}/man3/%{name}.3pm.gz
181
+%{_initrddir}/%{name}
182
+%dir %{nginx_confdir}
183
+%dir %{nginx_confdir}/conf.d
184
+%config(noreplace) %{nginx_confdir}/conf.d/*.conf
185
+%config(noreplace) %{nginx_confdir}/win-utf
186
+%config(noreplace) %{nginx_confdir}/%{name}.conf.default
187
+%config(noreplace) %{nginx_confdir}/mime.types.default
188
+%config(noreplace) %{nginx_confdir}/fastcgi_params
189
+%config(noreplace) %{nginx_confdir}/fastcgi_params.default
190
+%config(noreplace) %{nginx_confdir}/fastcgi.conf
191
+%config(noreplace) %{nginx_confdir}/fastcgi.conf.default
192
+%config(noreplace) %{nginx_confdir}/scgi_params
193
+%config(noreplace) %{nginx_confdir}/scgi_params.default
194
+%config(noreplace) %{nginx_confdir}/uwsgi_params           
195
+%config(noreplace) %{nginx_confdir}/uwsgi_params.default
196
+%config(noreplace) %{nginx_confdir}/koi-win
197
+%config(noreplace) %{nginx_confdir}/koi-utf
198
+%config(noreplace) %{nginx_confdir}/%{name}.conf
199
+%config(noreplace) %{nginx_confdir}/mime.types
200
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
201
[+] Deleted nginx.spec ^