Files
nginx-unit/pkg/rpm/unit.module.spec.in
Valentin Bartenev ce6ce15c20 Fixed violation of the strict aliasing rules in 5d0edd35c4ce.
In order to reduce number of operations over rb-tree and process them in
batches simultaneously, all the timers changes are temporary stored in array.
While processing of these changes, the same memory is also used for storing
pointers to postpone timers adding.

As the same block of memory has been referenced by two different types of
pointers (nxt_timer_change_t * and nxt_timer_t **), some compilers may reorder
operations with these pointers and produce broken code.  See ticket #221 on
GitHub for a particular case.

Now the same "nxt_timer_change_t" structure is used in both cases.

Also, reverted the -fno-strict-aliasing flag, which has been introduced in
ef76227ec159 as a workaround for this issue.
2019-02-26 17:42:20 +03:00

108 lines
2.5 KiB
RPMSpec

# distribution specific definitions
%define bdir %{_builddir}/%{name}-%{version}
%%MODULE_DEFINITIONS%%
%if (0%{?rhel} == 7 && 0%{?amzn} == 0)
%define dist .el7
%endif
%define unit_version %%UNIT_VERSION%%
%define unit_release %%UNIT_RELEASE%%%{?dist}.ngx
%define CC_OPT %{optflags}
%define CONFIGURE_ARGS $(echo "%%CONFIGURE_ARGS%%")
Name: %%NAME%%
Summary: %%SUMMARY%%
Version: %%VERSION%%
Release: %%RELEASE%%%{?dist}.ngx
License: ASL 2.0
Vendor: Nginx Software, Inc.
URL: https://unit.nginx.org/
Packager: Nginx Software, Inc. <https://www.nginx.com>
Group: System Environment/Daemons
Source0: unit-%{version}.tar.gz
%%MODULE_SOURCES%%
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: unit == %%UNIT_VERSION%%-%%UNIT_RELEASE%%%{?dist}.ngx
%description
NGINX Unit is a runtime and delivery environment for modern distributed
applications. It runs the application code in multiple languages
(PHP, Python, Go, etc.), and tightly couples it with traffic delivery
in and out of the application. Take this application server and proxy
directly in the cloud / container environments and fully control your app
dynamically via an API.
This package contains %%SUMMARY%%.
%if 0%{?suse_version}
%debug_package
%endif
%if 0%{?fedora}
%define _debugsource_template %{nil}
%endif
%prep
%setup -qcTn %{name}-%{unit_version}
tar --strip-components=1 -zxf %{SOURCE0}
%build
./configure \
%{CONFIGURE_ARGS} \
--modules=%{_libdir}/unit/debug-modules \
--cc-opt="%{CC_OPT}" \
--debug
./configure %%MODULE_CONFARGS%%
make %%MODULE_MAKEARGS%%
%{__mv} build build-debug
./configure \
%{CONFIGURE_ARGS} \
--modules=%{_libdir}/unit/modules \
--cc-opt="%{CC_OPT}"
./configure %%MODULE_CONFARGS%%
make %%MODULE_MAKEARGS%%
%{__mv} build build-nodebug
%install
%{__rm} -rf %{buildroot}
%{__mkdir} -p %{buildroot}%{_datadir}/doc/%%NAME%%
%{__install} -m 644 -p NOTICE \
%{buildroot}%{_datadir}/doc/%%NAME%%/COPYRIGHT
%%MODULE_PREINSTALL%%
%{__ln_s} build-debug build
DESTDIR=%{buildroot} make %%MODULE_INSTARGS%%
%{__rm} -f build
%{__ln_s} build-nodebug build
DESTDIR=%{buildroot} make %%MODULE_INSTARGS%%
%check
%{__rm} -rf %{buildroot}/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 %{buildroot}
%post
if [ $1 -eq 1 ]; then
%%MODULE_POST%%
fi
%files
%defattr(-,root,root,-)
%dir %{_datadir}/doc/%%NAME%%
%{_datadir}/doc/%%NAME%%/*
%%MODULE_FILES%%
%changelog