blob: 7d1d1b0ea7c1ced790edefedf710543fbbcc4de1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# distribution specific definitions
%define bdir %{_builddir}/%{name}-%{version}
%%MODULE_DEFINITIONS%%
%if 0%{?rhel}%{?fedora}
BuildRequires: gcc
%if 0%{?amzn2}
BuildRequires: openssl11-devel
%else
BuildRequires: openssl-devel
%endif
%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: %%PACKAGE_VENDOR%%
URL: https://unit.nginx.org/
Source0: unit-%{version}.tar.gz
%%MODULE_SOURCES%%
BuildRequires: pcre2-devel
Requires: unit-r%%UNIT_VERSION%%
%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%{?fedora}) || (0%{?rhel} >= 8)
%define _debugsource_template %{nil}
%endif
%prep
%setup -qcTn %{name}-%{unit_version}
tar --strip-components=1 -zxf %{SOURCE0}
%build
%%MODULE_PREBUILD%%
./configure \
%{CONFIGURE_ARGS} \
--modulesdir=%{_libdir}/unit/debug-modules \
--cc-opt="%{CC_OPT}" \
--debug
./configure %%MODULE_CONFARGS%%
make %%MODULE_MAKEARGS%%
%{__mv} build build-debug
./configure \
%{CONFIGURE_ARGS} \
--modulesdir=%{_libdir}/unit/modules \
--cc-opt="%{CC_OPT}"
./configure %%MODULE_CONFARGS%%
make %%MODULE_MAKEARGS%%
%{__mv} build build-nodebug
%install
%{__mkdir} -p %{buildroot}%{_datadir}/doc/%%NAME%%
if [ `basename %{SOURCE100}` == COPYRIGHT.%{name} ]; then
%{__install} -m 644 -p %{SOURCE100} \
%{buildroot}%{_datadir}/doc/%%NAME%%/COPYRIGHT
else
%{__install} -m 644 -p NOTICE \
%{buildroot}%{_datadir}/doc/%%NAME%%/COPYRIGHT
fi
%%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%%
%%MODULE_POSTINSTALL%%
%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
%post
if [ $1 -eq 1 ]; then
%%MODULE_POST%%
fi
%files
%dir %{_datadir}/doc/%%NAME%%
%{_datadir}/doc/%%NAME%%/*
%%MODULE_FILES%%
%changelog
|