- clean up conditionals and use bcond_with* everywhere

- drop passenger support for now

OBS-URL: https://build.opensuse.org/package/show/server:http/nginx?expand=0&rev=54
This commit is contained in:
Marcus Rückert 2015-10-16 15:03:32 +00:00 committed by Git OBS Bridge
parent c674182743
commit 348db313e0
2 changed files with 65 additions and 73 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Oct 16 15:01:17 UTC 2015 - mrueckert@suse.de
- clean up conditionals and use bcond_with* everywhere
- drop passenger support for now
-------------------------------------------------------------------
Thu Jun 11 14:55:50 UTC 2015 - i@marguerite.su

View File

@ -15,6 +15,27 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%bcond_with cpp_test
%bcond_with google_perftools
%bcond_without fancyindex
%if 0%{?suse_version} != 1315
%bcond_without libatomic
%else
%bcond_with libatomic
%endif
%if 0%{?suse_version} > 1220
%bcond_without http2
%else
%bcond_with http2
%endif
%if 0%{?suse_version} >= 1210
%bcond_without systemd
%else
%bcond_with systemd
%endif
%define pkg_name nginx
%define ngx_prefix %{_prefix}
@ -31,36 +52,19 @@
%define ngx_tmp_scgi %{ngx_home}/scgi/
%define ngx_tmp_uwsgi %{ngx_home}/uwsgi/
%define ngx_user_group nginx
%define with_cpp_test 0
%define with_google_perftools 0
%define with_fancyindex 1
%define fancyindex_version 0.3.5
%if 0%{?suse_version} <= 1310
#
%if %{with systemd}
%define ngx_pid_path /run/nginx.pid
%define ngx_lock_path /run/nginx.lock
%else
%define ngx_pid_path %{_localstatedir}/run/nginx.pid
%define ngx_lock_path %{_localstatedir}/run/nginx.lock
%else
%define ngx_pid_path /run/nginx.pid
%define ngx_lock_path /run/nginx.lock
%endif
%if 0%{?suse_version} != 1315
%define with_libatomic 1
%endif
%if 0%{?suse_version} >= 1220
# passenger is required by webyast
%if 0%{?suse_version} > 1310
%define with_passenger 0
%else
%define with_passenger 1
%endif
%endif
%if 0%{?suse_version} >= 1210
%define with_systemd 1
BuildRequires: systemd
%{?systemd_requires}
%endif
#
Name: nginx
Version: 1.8.0
Release: 0
%define fancyindex_version 0.3.5
Summary: A HTTP server and IMAP/POP3 proxy server
License: BSD-2-Clause
Group: Productivity/Networking/Web/Proxy
@ -91,35 +95,32 @@ BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: zlib-devel
%requires_eq perl
Requires(pre): %fillup_prereq
Requires(pre): %fillup_prereq
Requires(pre): %insserv_prereq
Requires(pre): pwdutils
Recommends: logrotate
Conflicts: otherproviders(nginx)
Conflicts: otherproviders(nginx)
Provides: http_daemon
Provides: httpd
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} == 1310
Patch7: nginx-1.4.2-passenger-4.0.18.patch
Patch8: nginx-1.8.0-passenger-4.0.18.patch
%endif
%if 0%{?suse_version} <= 1310
BuildRequires: GeoIP-devel
%else
#
%if 0%{?suse_version} > 1310
BuildRequires: libGeoIP-devel
%else
BuildRequires: GeoIP-devel
%endif
%if 0%{?with_google_perftools}
#
%if %{with google_perftools}
BuildRequires: google-perftools-devel
%endif
%if 0%{?with_libatomic}
#
%if %{with libatomic}
BuildRequires: libatomic-ops-devel
%endif
%if 0%{?with_passenger}
BuildRequires: curl-devel
BuildRequires: ruby-devel
BuildRequires: rubygem-passenger
BuildRequires: rubygem-passenger-devel-static
Recommends: packageand(rubygem-passenger:rubygem-passenger-nginx)
#
%if %{with systemd}
BuildRequires: systemd
%{?systemd_requires}
%endif
%description
@ -127,7 +128,7 @@ nginx [engine x] is a HTTP server and IMAP/POP3 proxy server written by Igor Sys
It has been running on many heavily loaded Russian sites for more than two years.
%prep
%if 0%{?with_fancyindex}
%if %{with fancyindex}
%setup -q -n %{pkg_name}-%{version} -b4
%else
%setup -q -n %{pkg_name}-%{version}
@ -141,26 +142,14 @@ It has been running on many heavily loaded Russian sites for more than two years
perl -pi -e 's|\r\n|\n|g' contrib/geo2nginx.pl
%if 0%{?with_passenger}
cp -a %{_libdir}/ruby/gems/%{rb_ver}/gems/passenger-* passenger
%if 0%{?suse_version} < 1310
if [[ -f "passenger/ext/common/libpassenger_common.a" ]] || \
[[ -f "passenger/ext/common/libboost_oxt.a" ]]; then
rm -r passenger/ext/common/libboost_oxt* passenger/ext/common/libpassenger_common*
fi
%endif
%patch7
%patch8
%endif
%if 0%{with_fancyindex}
%if %{with fancyindex}
mkdir -p ngx-fancyindex-%{fancyindex_version}
pushd ../ngx-fancyindex-%{fancyindex_version}
cp -r template* LICENSE *.rst $RPM_BUILD_DIR/%{pkg_name}-%{version}/ngx-fancyindex-%{fancyindex_version}/
popd
%endif
%if 0%{?suse_version} > 1310
%if %{with systemd}
sed -i "s/\/var\/run/\/run/" %{_sourcedir}/nginx.init
%endif
@ -181,13 +170,13 @@ sed -i "s/\/var\/run/\/run/" %{_sourcedir}/nginx.init
--user=nginx --group=nginx \
--without-select_module \
--without-poll_module \
--with-file-aio \
--with-threads \
--with-file-aio \
--with-ipv6 \
--with-http_ssl_module \
%if 0%{?suse_version} > 1220
%if %{with http2}
--with-http_spdy_module \
%endif
%endif
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
@ -209,19 +198,16 @@ sed -i "s/\/var\/run/\/run/" %{_sourcedir}/nginx.init
--with-mail \
--with-mail_ssl_module \
--with-pcre \
%if 0%{?with_libatomic}
%if %{with libatomic}
--with-libatomic \
%endif
%if 0%{?with_passenger}
--add-module=passenger/ext/nginx \
%endif
%if 0%{?with_google_perftools}
%if %{with google_perftools}
--with-google_perftools_module \
%endif
%if 0%{?with_cpp_test}
%if %{with cpp_test}
--with-cpp_test_module \
%endif
%if 0%{with_fancyindex}
%if %{with fancyindex}
--add-module=../ngx-fancyindex-%{fancyindex_version} \
%endif
--with-md5=%{_prefix} \
@ -242,7 +228,7 @@ install -d -m 0750 %{buildroot}%{ngx_home}/{,tmp,proxy,fastcgi,scgi,uwsgi}
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{pkg_name}
%if 0%{?with_systemd}
%if %{with systemd}
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/nginx.service
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcnginx
%else
@ -253,21 +239,21 @@ ln -s -f %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
rm %{buildroot}/srv/www/htdocs/index.html
%post
%if 0%{?with_systemd}
%if %{with systemd}
%service_add_post nginx.service
%else
%fillup_and_insserv %{pkg_name}
%endif
%preun
%if 0%{?with_systemd}
%if %{with systemd}
%service_del_preun nginx.service
%else
%stop_on_removal %{pkg_name}
%endif
%postun
%if 0%{?with_systemd}
%if %{with systemd}
%service_del_postun nginx.service
%else
%restart_on_update %{pkg_name}
@ -278,7 +264,7 @@ rm %{buildroot}/srv/www/htdocs/index.html
%{_sbindir}/groupadd -r %{ngx_user_group} &>/dev/null ||:
%{_sbindir}/useradd -g %{ngx_user_group} -s /bin/false -r -c "user for %{ngx_user_group}" -d %{ngx_home} %{ngx_user_group} &>/dev/null ||:
%if 0%{?with_systemd}
%if %{with systemd}
%service_add_pre nginx.service
%endif
@ -319,10 +305,10 @@ rm %{buildroot}/srv/www/htdocs/index.html
%dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{ngx_tmp_uwsgi}
%doc CHANGES*
%doc conf/ contrib/
%if 0%{with_fancyindex}
%if %{with fancyindex}
%doc ngx-fancyindex-%{fancyindex_version}/
%endif
%if 0%{?with_systemd}
%if %{with systemd}
%{_unitdir}/nginx.service
%else
%{_sysconfdir}/init.d/%{pkg_name}