summaryrefslogtreecommitdiffstats
path: root/unit-php.spec
blob: dd8358a100de2e4aae363ee6ee4d41042b141c8c (plain)
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
# remirepo/fedora spec file for unit-php
#
# Copyright (c) 2019-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global gh_owner     nginx
%global project      unit
%global gh_commit    24ed91f40634372d99f67f0e4e3c2ac0abde81bd
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})

%undefine _debugsource_packages

# Disable RPATH check
%global __arch_install_post /bin/true

# Disable auto-provides (php_plugin.so is not a library)
AutoProv: 0

%if 0%{?scl:1}
%scl_package unit-php
%global modname %scl
AutoReq: 0
# ensure correct dependencies
Requires: %{scl_prefix}php-cli
Requires: %{scl_prefix}php-embedded
%else
%global _root_libdir          %{_libdir}
%global _root_sharedstatedir  %{_sharedstatedir}
%global modname php
%endif

Name:          %{?scl_prefix}%{project}-php
Version:       1.33.0
Release:       1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary:       PHP module for NGINX Unit
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

BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-embedded
BuildRequires: openssl-devel
BuildRequires: pcre2-devel

Requires:      %{project} = %{version}


%description
This package contains the PHP module for NGINX unit,
designed to work with %{project} in nginx official repository.

Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}
and NGINX unit %{version}.


%prep
%setup -qn %{project}-%{gh_commit}


%build
%{?dtsenable}

modbuild() {
: Main unit configuration
./configure \
  --prefix=%{_prefix} \
  --statedir=%{_root_sharedstatedir}/unit \
  --control="unix:/var/run/unit/control.sock" \
  --pid=/var/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}" \
  --ld-opt="-L%{_libdir} %{?scl:-Wl,-rpath,%{_libdir}}" \
  $*

: PHP module configuration
./configure php --config=%{_bindir}/php-config --module=%{modname}

make %{modname} %{?_smp_mflags}
}

: Debug build
modbuild --modulesdir=%{_root_libdir}/unit/debug-modules --debug
mv build deb-build

: Standard build
modbuild --modulesdir=%{_root_libdir}/unit/modules
mv build std-build



%install
%{?dtsenable}

rm -f build
ln -s deb-build build
make %{modname}-install DESTDIR=%{buildroot}

rm -f build
ln -s std-build build
make %{modname}-install DESTDIR=%{buildroot}


%files
%license LICENSE
%doc NOTICE CHANGES *.md
%{_root_libdir}/unit/debug-modules/%{modname}.unit.so
%{_root_libdir}/unit/modules/%{modname}.unit.so


%changelog
* Wed Sep 18 2024 Remi Collet <remi@remirepo.net> - 1.33.0-1
- update to 1.33.0

* Tue Mar 26 2024 Remi Collet <remi@remirepo.net> - 1.32.1-1
- update to 1.32.1

* Tue Feb 27 2024 Remi Collet <remi@remirepo.net> - 1.32.0-1
- update to 1.32.0

* 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

* 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 patch 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-2
- fix build with PHP 8.2 using patch from
  https://github.com/nginx/unit/pull/713

* Thu Jun  2 2022 Remi Collet <remi@remirepo.net> - 1.27.0-1
- update to 1.27.0

* Thu Dec  2 2021 Remi Collet <remi@remirepo.net> - 1.26.1-1
- update to 1.26.1

* Thu Nov 18 2021 Remi Collet <remi@remirepo.net> - 1.26.0-1
- update to 1.26.0

* Fri Sep  3 2021 Remi Collet <remi@remirepo.net> - 1.25.0-3
- fix build with recent glibc using patch from
  https://github.com/nginx/unit/pull/576

* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.25.0-2
- rebuild for 8.1.0RC1

* 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

* Wed Sep 30 2020 Remi Collet <remi@remirepo.net> - 1.19.0-3
- rebuild for PHP 8.0.0RC1

* Wed Sep  2 2020 Remi Collet <remi@remirepo.net> - 1.19.0-2
- add patch for PHP 8.0.0beta3 from
  https://github.com/nginx/unit/pull/474

* Fri Aug 14 2020 Remi Collet <remi@remirepo.net> - 1.19.0-1
- update to 1.19.0
- drop patch merged upstream

* Wed Aug  5 2020 Remi Collet <remi@remirepo.net> - 1.18.0-2
- rebuild for 8.0.0beta1
- add patch for PHP 8.0.0 from
  https://github.com/nginx/unit/pull/441

* Sun May 31 2020 Remi Collet <remi@remirepo.net> - 1.18.0-1
- update to 1.18.0
- drop patches merged upstream

* Fri Apr 17 2020 Remi Collet <remi@remirepo.net> - 1.17.0-2
- fix build with PHP 8 using patches from
  https://github.com/nginx/unit/pull/425

* 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

* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 1.10.0-2
- rebuild for 7.4.0RC1

* 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

* Wed Jan 16 2019 Remi Collet <remi@remirepo.net> - 1.7-2
- rebuild

* Mon Jan 14 2019 Remi Collet <remi@remirepo.net> - 1.7-1
- initial package