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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
# remirepo/fedora spec file for unit-php
#
# Copyright (c) 2019-2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%bcond_without tests
# require ONLINE build for sources download
%bcond_with wasm
%global gh_owner nginx
%global project unit
%global gh_commit 09ab626b13a027a4d3f8b5dcdcdba3e8eee76977
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
Name: unit
Summary: NGINX Unit application server
Version: 1.31.1
Release: 2%{?dist}
License: Apache-2.0
URL: https://unit.nginx.org/
Source0: https://github.com/%{gh_owner}/%{project}/archive/%{gh_commit}/%{project}-%{version}-%{gh_short}.tar.gz
Source1: unit.service
Source2: unit.init
Source3: unit.sysconf
Source4: unit.logrotate
BuildRequires: make
BuildRequires: gcc
BuildRequires: openssl-devel
BuildRequires: pcre2-devel
BuildRequires: systemd
%if %{with wasm}
BuildRequires: clang
BuildRequires: llvm
%endif
%if 0%{?rhel} == 7
%{?systemd_requires}
%else
%{?systemd_ordering}
%endif
Requires(pre): /usr/sbin/useradd
Requires: logrotate
Provides: nginx-unit = %{version}-%{release}
%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.
%package devel
Summary: NGINX Unit (development files)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Library and include files required for NGINX Unit modules development.
%prep
%setup -qn %{project}-%{gh_commit}
cp pkg/rpm/rpmbuild/SOURCES/unit.example.config example.config
%build
# see https://github.com/nginx/unit/issues/467
%define _lto_cflags %{nil}
unitconf() {
./configure \
--libdir=%{_libdir} \
--prefix=%{_prefix} \
--statedir=%{_sharedstatedir}/unit \
--control="unix:/run/unit/control.sock" \
--pid=/run/unit/unit.pid \
--runstatedir=/var/run \
--log=/var/log/unit/unit.log \
--logdir=/var/log \
--tmpdir=/var/tmp \
--user=unit \
--group=unit \
--openssl \
--cc-opt="%{optflags}" \
--tests \
$*
}
unitconf \
--modulesdir=%{_libdir}/unit/debug-modules \
--debug
make %{?_smp_mflags}
make %{?_smp_mflags} build/lib/libunit.a
mv build build-debug
%if %{with wasm}
make %{?_smp_mflags} -C pkg/contrib .libunit-wasm
%endif
unitconf \
--modulesdir=%{_libdir}/unit/modules
make %{?_smp_mflags}
%install
DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install
install -m755 -D tools/unitc %{buildroot}%{_bindir}/unitc
install -m755 -D tools/setup-unit %{buildroot}%{_bindir}/setup-unit
install -m755 build-debug/sbin/unitd %{buildroot}%{_sbindir}/unitd-debug
install -m644 build-debug/lib/libunit.a %{buildroot}%{_libdir}/libunit-debug.a
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
mkdir -p %{buildroot}%{_libdir}/%{name}/modules
mkdir -p %{buildroot}%{_libdir}/%{name}/debug-modules
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# init scripts
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d
%if %{with wasm}
mkdir -p %{buildroot}%{_includedir}/unit/
install -m 644 pkg/contrib/libunit-wasm/src/c/libunit-wasm.a %{buildroot}%{_libdir}/
install -m 644 pkg/contrib/libunit-wasm/src/c/include/unit/unit-wasm.h %{buildroot}%{_includedir}/unit/
%endif
%check
%if %{with tests}
make tests %{?_smp_mflags}
./build/tests
%endif
%pre
getent group unit >/dev/null || groupadd -r unit
getent passwd unit >/dev/null || \
useradd -r -g unit -s /sbin/nologin \
-d /nonexistent -c "unit user" unit
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%triggerpostun -- unit < 1.22.0
cat <<BANNER
----------------------------------------------------------------------
WARNING:
Since version 1.22.0, Unit's non-privileged processes run as unit:unit by
default. Review your system permissions and Unit configuration so apps and
routes that relied on these processes running as nobody:nogroup stay working.
More info: https://unit.nginx.org/installation/#official-packages
----------------------------------------------------------------------
BANNER
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc NOTICE CHANGES *.md
%doc example.config
%attr(0755,root,root) %{_bindir}/unitc
%attr(0755,root,root) %{_bindir}/setup-unit
%attr(0755,root,root) %{_sbindir}/unitd
%attr(0755,root,root) %{_sbindir}/unitd-debug
%dir %{_sysconfdir}/unit
%dir %{_libdir}/unit/modules
%dir %{_libdir}/unit/debug-modules
%dir %{_sharedstatedir}/unit
%dir %attr(0700,root,root) %{_localstatedir}/log/unit
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_mandir}/man8/unitd.8*
%dir %{_sysconfdir}/systemd/system/%{name}.service.d
%{_unitdir}/unit.service
%dir %attr(0755,root,root) %ghost /run/unit
%files devel
# API is not stable YET, so keep the static library for now (like upstream packages)
%{_libdir}/libunit.a
%{_libdir}/libunit-debug.a
%if %{with wasm}
%{_libdir}/libunit-wasm.a
%dir %{_includedir}/unit
%{_includedir}/unit/*.h
%endif
%{_includedir}/nxt_*.h
%{_datadir}/pkgconfig/unit.pc
%changelog
* Mon Nov 6 2023 Remi Collet <remi@remirepo.net> - 1.31.1-2
- weak dependencies on systemd
* Thu Oct 19 2023 Remi Collet <remi@remirepo.net> - 1.31.1-1
- update to 1.31.1
* Thu Aug 31 2023 Remi Collet <remi@remirepo.net> - 1.31.0-1
- update to 1.31.0
* Thu May 11 2023 Remi Collet <remi@remirepo.net> - 1.30.0-1
- update to 1.30.0
- add unitc and setup-unit commands
* Wed Mar 1 2023 Remi Collet <remi@remirepo.net> - 1.29.1-1
- update to 1.29.1
* Thu Dec 15 2022 Remi Collet <remi@remirepo.net> - 1.29.0-1
- update to 1.29.0
- drop patches merged upstream
* Tue Sep 13 2022 Remi Collet <remi@remirepo.net> - 1.28.0-1
- update to 1.28.0
* Thu Jun 2 2022 Remi Collet <remi@remirepo.net> - 1.27.0-1
- update to 1.27.0
* Mon Feb 21 2022 Remi Collet <remi@remirepo.net> - 1.26.1-3
- test build for upstream patch
* Fri Feb 11 2022 Remi Collet <remi@remirepo.net> - 1.26.1-2
- fix build error with GCC 12 using workaround to
https://github.com/nginx/unit/issues/639
* Thu Dec 2 2021 Remi Collet <remi@remirepo.net> - 1.26.1-1
- update to 1.26.1
* Mon Nov 22 2021 Remi Collet <remi@remirepo.net> - 1.26.0-3
- add patch proposal for https://github.com/nginx/unit/issues/600
* Thu Nov 18 2021 Remi Collet <remi@remirepo.net> - 1.26.0-2
- add better workaround for OpenSSL 3.0 from
https://github.com/nginx/unit/pull/598
* Thu Nov 18 2021 Remi Collet <remi@remirepo.net> - 1.26.0-1
- update to 1.26.0
* Sat Nov 6 2021 Remi Collet <remi@remirepo.net> - 1.25.0-3
- EL-9 build
* Fri Sep 3 2021 Remi Collet <remi@remirepo.net> - 1.25.0-2
- fix build with recent glibc using patch from
https://github.com/nginx/unit/pull/576
* Tue Aug 24 2021 Remi Collet <remi@remirepo.net> - 1.25.0-1
- update to 1.25.0
* Fri May 28 2021 Remi Collet <remi@remirepo.net> - 1.24.0-1
- update to 1.24.0
* Fri Mar 26 2021 Remi Collet <remi@remirepo.net> - 1.23.0-1
- update to 1.23.0
* Fri Feb 5 2021 Remi Collet <remi@remirepo.net> - 1.22.0-1
- update to 1.22.0
* Fri Nov 20 2020 Remi Collet <remi@remirepo.net> - 1.21.0-1
- update to 1.21.0
* Fri Oct 9 2020 Remi Collet <remi@remirepo.net> - 1.20.0-1
- update to 1.20.0
* Tue Aug 18 2020 Remi Collet <remi@remirepo.net> - 1.19.0-2
- F33 build without LTO
reported as https://github.com/nginx/unit/issues/467
* Fri Aug 14 2020 Remi Collet <remi@remirepo.net> - 1.19.0-1
- update to 1.19.0
* Sun May 31 2020 Remi Collet <remi@remirepo.net> - 1.18.0-1
- update to 1.18.0
* Fri Apr 17 2020 Remi Collet <remi@remirepo.net> - 1.17.0-1
- update to 1.17.0
* Fri Mar 13 2020 Remi Collet <remi@remirepo.net> - 1.16.0-1
- update to 1.16.0
* Fri Feb 7 2020 Remi Collet <remi@remirepo.net> - 1.15.0-1
- update to 1.15.0
* Fri Dec 27 2019 Remi Collet <remi@remirepo.net> - 1.14.0-1
- update to 1.14.0
* Fri Nov 15 2019 Remi Collet <remi@remirepo.net> - 1.13.0-1
- update to 1.13.0
* Fri Oct 4 2019 Remi Collet <remi@remirepo.net> - 1.12.0-1
- update to 1.12.0
* Fri Sep 20 2019 Remi Collet <remi@remirepo.net> - 1.11.0-1
- update to 1.11.0
* Fri Aug 23 2019 Remi Collet <remi@remirepo.net> - 1.10.0-1
- update to 1.10.0
* Fri May 31 2019 Remi Collet <remi@remirepo.net> - 1.9.0-1
- update to 1.9.0
* Sat Mar 2 2019 Remi Collet <remi@remirepo.net> - 1.8.0-1
- update to 1.8.0
* Fri Feb 8 2019 Remi Collet <remi@remirepo.net> - 1.7.1-1
- update to 1.7.1
* Thu Jan 17 2019 Remi Collet <remi@remirepo.net> - 1.7-2
- provide logrotate configuration
* Tue Jan 15 2019 Remi Collet <remi@remirepo.net> - 1.7-1
- initial package
- open https://github.com/nginx/unit/pull/215 system crypto policy
- open https://github.com/nginx/unit/pull/212 systemd improvments
|