summaryrefslogtreecommitdiffstats
path: root/php-pecl-parsekit.spec
blob: 39d238ddedb7617ec0e90fa6ccda7ec0f787677f (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
%{!?__pecl:      %{expand:   %%global __pecl   %{_bindir}/pecl}}

%global   pecl_name  parsekit

Summary:       PHP Opcode Analyser
Name:          php-pecl-parsekit
Version:       1.3.0
Release:       2%{?CVS:.CVS%{CVS}}%{?dist}.1
# https://bugs.php.net/65937 - license file
License:       PHP
URL:           http://pecl.php.net/package/parsekit
Group:         Development/Libraries
Source0:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz

# https://bugs.php.net/bug.php?id=61187
Patch1:        php-pecl-parsekit-1.3-php-5.4.patch

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php-pear
BuildRequires: php-devel

Requires(post): %{__pecl}
Requires(postun): %{__pecl}

Requires:      php(zend-abi) = %{php_zend_api}
Requires:      php(api) = %{php_core_api}

Provides:      php-%{pecl_name} = %{version}
Provides:      php-%{pecl_name}%{?_isa} = %{version}
Provides:      php-pecl(%{pecl_name}) = %{version}
Provides:      php-pecl(%{pecl_name})%{?_isa} = %{version}

# Other third party repo stuff
Obsoletes:     php53-pecl-%{pecl_name}
Obsoletes:     php53u-pecl-%{pecl_name}
%if "%{php_version}" > "5.4"
Obsoletes:     php54-pecl-%{pecl_name}
%endif
%if "%{php_version}" > "5.5"
Obsoletes:     php55u-pecl-%{pecl_name}
%endif

# filter private shared
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}


%description
Provides a userspace interpretation of the opcodes generated by the Zend engine
compiler built into PHP.

This extension is meant for development and debug purposes only and contains
some code which is potentially non-threadsafe.


%prep
%setup -qc

%if "%{php_version}" > "5.4"
cd %{pecl_name}-%{version}
%patch1 -p2 -b .php54
cd ..
%endif

# Create configuration file
cat <<'EOF' > %{pecl_name}.ini
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
EOF

cp -r %{pecl_name}-%{version} %{pecl_name}-zts


%build
cd %{pecl_name}-%{version}
%{_bindir}/phpize
%configure \
    --with-%{pecl_name}\
    --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}

cd ../%{pecl_name}-zts
%{_bindir}/zts-phpize
%configure \
    --with-%{pecl_name}\
    --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}


%install
rm -rf %{buildroot}

make install -C %{pecl_name}-%{version} install INSTALL_ROOT=%{buildroot}
make install -C %{pecl_name}-zts        install INSTALL_ROOT=%{buildroot}

# Drop in the bit of configuration
install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini

# Install XML package description
install -Dpm 0664 package2.xml %{buildroot}%{pecl_xmldir}/%{name}.xml


%check
# No test provided, just minimal load test
%{__php} --no-php-ini \
    --define extension_dir=%{buildroot}%{php_extdir} \
    --define extension=%{pecl_name}.so \
    -m | grep %{pecl_name}

%{__ztsphp} --no-php-ini \
    --define extension_dir=%{buildroot}%{php_ztsextdir} \
    --define extension=%{pecl_name}.so \
    -m | grep %{pecl_name}


%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
   %{pecl_uninstall} %{pecl_name} >/dev/null || :
fi


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc %{pecl_name}-%{version}/examples
%doc %{pecl_name}-%{version}/README
%{pecl_xmldir}/%{name}.xml

%{php_extdir}/%{pecl_name}.so
%config(noreplace) %{php_inidir}/%{pecl_name}.ini

%{php_ztsextdir}/%{pecl_name}.so
%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini


%changelog
* Sat Jan  5 2013 Remi Collet <RPMS@famillecollet.com> - 1.3.0-2
- also provides php-parsekit

* Sun Oct  7 2012 Remi Collet <RPMS@famillecollet.com> - 1.3.0-1
- latest changes from rawhide (rebase on upstream 1.3.0)

* Sat Oct 6 2012 Pavel Alexeev <Pahan@Hubbitus.info> - 1.3.0-1
- Update to upstream release.
- Use pecl package.xml 2.0 version (bz#860331).

* Wed Sep 12 2012 Remi Collet <remi@fedoraproject.org> - 1.3-2.CVS20120226
- standardize for remi repo, lot of cleanups
- add ZTS extension
- add %%check section: minimal load test

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-2.CVS20120226
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun Mar 4 2012 Pavel Alexeev <Pahan@Hubbitus.info> 1.3-1.CVS20120226
- Change release enumerate manner as 1.3 was already released (Thanks to Remi Collet).

* Sun Feb 26 2012 Pavel Alexeev <Pahan@Hubbitus.info> 1.3-0.1.CVS20120226
- Update to 1.3 branch, try fix FBFS on PHP 5.4.
- Urls by patch wrote:
   https://bugs.php.net/bug.php?id=61187
   http://fossies.org/unix/www/php-5.4.0RC8.tar.gz:a/php-5.4.0RC8/NEWS
   http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/Zend/zend_compile.h?r1=298202&r2=298203&
   http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/Zend/zend_compile.h?annotate=321634
   http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/Zend/zend_compile.h?r1=301081&r2=303381
- Add patch php-pecl-parsekit-1.3-php-5.4.patch

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-8.CVS20090309
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Sep 12 2011 Pavel Alexeev <Pahan@Hubbitus.info> - 1.2-7.CVS20090309
- Fix FBFS f16-17. Bz#716157

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-6.CVS20090309
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5.CVS20090309
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jul 13 2009 Remi Collet <Fedora@FamilleCollet.com> - 1.2-4.CVS20090309
- rebuild for new PHP 5.3.0 ABI (20090626)

* Tue Jun 30 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 1.2-3.CVS20090309
- Most of changes inspired by continue Fedora review by Jason Tibbitts.
- Prefer %%global over %%define
- Source0 is not URL now for CVS build.
- "PECL" prefix removed from summary.
- Add %%release part into BuildRoot tag.
- Add more magic into Release define and fit it into one line.OD

* Mon Mar 9 2009 Pavel Alexeev <Pahan@Hubbitus.info> - 1.2-2.CVS20090309
- php-pecl-parsekit.Hu.spec renamed to normal php-pecl-parsekit.spec
- In Version changhes: As it is post release enumereate it after 0. Remove Hu-part.
- New CVS checkout 20090309
- Add php_apiver and __pecl macroses define. Remove peardir.
- Remove define macros xmldir and replace it by common pecl_xmldir
- Add comment of command how to get source.
- Add patch Patch2: php-pecl-parsekit-1.2.APIstatic.patch to allow build on recent versions.
- Fix several inconsistent macros usages.
- Add standard Requires/provides of php-api, abi, zend abi, php-pecl(%%peclName) = %%{version}...
- Delete pathces, which is not needed anymore in ew checkout.
- Remove Obsoletes:   php-pear-%%peclName
- Add Requires(post):   %%{__pecl} and Requires(postun):   %%{__pecl}
- Rpmlint warnings:
   o Mixed spaces turned to tabs.
   o Descrioption line too long: splited.
   o License from "PHP License" changed to just PHP
   o script-without-shebang /usr/share/pear/.pkgxml/parsekit.xml: chmod to 0664

* Tue May 13 2008 Pavel Alexeev <Pahan [ at ] Hubbitus [ DOT ] spb [ dOt.] su> - 1.2-0.CVS20080513.Hu.0
- Initial spec (copy of php-pecl-imagick.Hu.spec)
- Add (import from runkit spec-file) CVS-build support
- Add patches:
   Patch0:      php-pecl-parsekit-php51.patch (http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg28512.html)
   Patch1:      php-pecl-parsekit-1.2-PHP5.3.0.patch (self)
- Post and Pustun steps replaced by it is macroses-representated form (from php-pecl-phar)