|
|
1b1a943 |
# Fedora spec file for php-ast
|
|
|
1b1a943 |
# Without SCL compatibility stuff, from:
|
|
|
1b1a943 |
#
|
|
|
1b1a943 |
# remirepo spec file for php-ast
|
|
|
1b1a943 |
#
|
|
|
e1d5268 |
# Copyright (c) 2015-2020 Remi Collet
|
|
|
1b1a943 |
# License: CC-BY-SA
|
|
|
1b1a943 |
# http://creativecommons.org/licenses/by-sa/4.0/
|
|
|
1b1a943 |
#
|
|
|
1b1a943 |
# Please, preserve the changelog entries
|
|
|
1b1a943 |
#
|
|
|
aca699e |
|
|
|
aca699e |
# we don't want -z defs linker flag
|
|
|
aca699e |
%undefine _strict_symbol_defs_build
|
|
|
aca699e |
|
|
|
91fb9a1 |
%global gh_commit 701e8539e0a861b8fe3c0144a7554c376f42efe3
|
|
|
1b1a943 |
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
|
|
|
1b1a943 |
%global gh_owner nikic
|
|
|
1b1a943 |
%global gh_project php-ast
|
|
|
1b1a943 |
%global pecl_name ast
|
|
|
1b1a943 |
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
|
|
|
1b1a943 |
# After 20-tokenizer.ini
|
|
|
1b1a943 |
%global ini_name 40-%{pecl_name}.ini
|
|
|
1b1a943 |
|
|
|
1b1a943 |
Summary: Abstract Syntax Tree
|
|
|
1b1a943 |
Name: php-ast
|
|
|
004592b |
Version: 1.0.7
|
|
|
e1d5268 |
Release: 1%{?dist}
|
|
|
1b1a943 |
License: BSD
|
|
|
1b1a943 |
URL: https://github.com/%{gh_owner}/%{gh_project}
|
|
|
42703ce |
%if 0%{?gh_date}
|
|
|
1b1a943 |
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
|
|
|
42703ce |
%else
|
|
|
42703ce |
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
|
|
|
42703ce |
%endif
|
|
|
e18b89c |
|
|
|
1b1a943 |
BuildRequires: php-devel > 7
|
|
|
42703ce |
BuildRequires: php-pear
|
|
|
1b1a943 |
BuildRequires: php-tokenizer
|
|
|
1b1a943 |
|
|
|
42703ce |
# PECL
|
|
|
42703ce |
Provides: php-pecl-%{pecl_name} = %{version}-%{release}
|
|
|
42703ce |
Provides: php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
|
|
|
42703ce |
Provides: php-pecl(%{pecl_name}) = %{version}
|
|
|
42703ce |
Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
|
|
|
42703ce |
|
|
|
1b1a943 |
Requires: php(zend-abi) = %{php_zend_api}
|
|
|
1b1a943 |
Requires: php(api) = %{php_core_api}
|
|
|
1b1a943 |
Requires: php-tokenizer%{?_isa}
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%description
|
|
|
1b1a943 |
This extension exposes the abstract syntax tree generated by PHP 7.
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%prep
|
|
|
1b1a943 |
%setup -qc
|
|
|
42703ce |
%if 0%{?gh_date}
|
|
|
1b1a943 |
mv %{gh_project}-%{gh_commit} NTS
|
|
|
42703ce |
mv NTS/package.xml .
|
|
|
42703ce |
%else
|
|
|
42703ce |
mv %{pecl_name}-%{version}%{?prever} NTS
|
|
|
42703ce |
%endif
|
|
|
42703ce |
|
|
|
42703ce |
# Don't install/register tests
|
|
|
42703ce |
sed -e 's/role="test"/role="src"/' \
|
|
|
42703ce |
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
|
|
|
42703ce |
-i package.xml
|
|
|
1b1a943 |
|
|
|
1b1a943 |
cd NTS
|
|
|
e18b89c |
|
|
|
1b1a943 |
# Sanity check, really often broken
|
|
|
1b1a943 |
extver=$(sed -n '/#define PHP_AST_VERSION/{s/.* "//;s/".*$//;p}' php_ast.h)
|
|
|
1b1a943 |
if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
|
|
|
1b1a943 |
: Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}.
|
|
|
1b1a943 |
exit 1
|
|
|
1b1a943 |
fi
|
|
|
1b1a943 |
cd ..
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%if %{with_zts}
|
|
|
1b1a943 |
# duplicate for ZTS build
|
|
|
1b1a943 |
cp -pr NTS ZTS
|
|
|
1b1a943 |
%endif
|
|
|
1b1a943 |
|
|
|
1b1a943 |
# Drop in the bit of configuration
|
|
|
1b1a943 |
cat << 'EOF' | tee %{ini_name}
|
|
|
1b1a943 |
; Enable '%{summary}' extension module
|
|
|
1b1a943 |
extension = %{pecl_name}.so
|
|
|
1b1a943 |
EOF
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%build
|
|
|
1b1a943 |
cd NTS
|
|
|
1b1a943 |
%{_bindir}/phpize
|
|
|
1b1a943 |
%configure \
|
|
|
1b1a943 |
--with-php-config=%{_bindir}/php-config \
|
|
|
1b1a943 |
--enable-ast
|
|
|
1b1a943 |
make %{?_smp_mflags}
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%if %{with_zts}
|
|
|
1b1a943 |
cd ../ZTS
|
|
|
1b1a943 |
%{_bindir}/zts-phpize
|
|
|
1b1a943 |
%configure \
|
|
|
1b1a943 |
--with-php-config=%{_bindir}/zts-php-config \
|
|
|
1b1a943 |
--enable-ast
|
|
|
1b1a943 |
make %{?_smp_mflags}
|
|
|
1b1a943 |
%endif
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%install
|
|
|
42703ce |
# Install XML package description
|
|
|
42703ce |
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
|
|
|
42703ce |
|
|
|
1b1a943 |
# Install the NTS stuff
|
|
|
1b1a943 |
make -C NTS install INSTALL_ROOT=%{buildroot}
|
|
|
1b1a943 |
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%if %{with_zts}
|
|
|
1b1a943 |
# Install the ZTS stuff
|
|
|
1b1a943 |
make -C ZTS install INSTALL_ROOT=%{buildroot}
|
|
|
1b1a943 |
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
|
|
|
1b1a943 |
%endif
|
|
|
1b1a943 |
|
|
|
42703ce |
# Documentation
|
|
|
42703ce |
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
|
|
|
42703ce |
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
|
|
|
42703ce |
done
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%check
|
|
|
1b1a943 |
cd NTS
|
|
|
1b1a943 |
: Minimal load test for NTS extension
|
|
|
1b1a943 |
%{__php} --no-php-ini \
|
|
|
1b1a943 |
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
|
|
|
1b1a943 |
--modules | grep %{pecl_name}
|
|
|
1b1a943 |
|
|
|
1b1a943 |
: Upstream test suite for NTS extension
|
|
|
1b1a943 |
TEST_PHP_EXECUTABLE=%{__php} \
|
|
|
1b1a943 |
TEST_PHP_ARGS="-n -d extension=tokenizer.so -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
|
|
|
1b1a943 |
NO_INTERACTION=1 \
|
|
|
1b1a943 |
REPORT_EXIT_STATUS=1 \
|
|
|
1b1a943 |
%{__php} -n run-tests.php --show-diff || : ignore
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%if %{with_zts}
|
|
|
1b1a943 |
cd ../ZTS
|
|
|
1b1a943 |
: Minimal load test for ZTS extension
|
|
|
1b1a943 |
%{__ztsphp} --no-php-ini \
|
|
|
1b1a943 |
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
|
|
|
1b1a943 |
--modules | grep %{pecl_name}
|
|
|
1b1a943 |
|
|
|
1b1a943 |
: Upstream test suite for ZTS extension
|
|
|
1b1a943 |
TEST_PHP_EXECUTABLE=%{__ztsphp} \
|
|
|
1b1a943 |
TEST_PHP_ARGS="-n -d extension=tokenizer.so -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
|
|
|
1b1a943 |
NO_INTERACTION=1 \
|
|
|
1b1a943 |
REPORT_EXIT_STATUS=1 \
|
|
|
1b1a943 |
%{__ztsphp} -n run-tests.php --show-diff
|
|
|
1b1a943 |
%endif
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%files
|
|
|
1b1a943 |
%license NTS/LICENSE
|
|
|
42703ce |
%doc %{pecl_docdir}/%{pecl_name}
|
|
|
42703ce |
%{pecl_xmldir}/%{name}.xml
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%config(noreplace) %{php_inidir}/%{ini_name}
|
|
|
1b1a943 |
%{php_extdir}/%{pecl_name}.so
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%if %{with_zts}
|
|
|
1b1a943 |
%config(noreplace) %{php_ztsinidir}/%{ini_name}
|
|
|
1b1a943 |
%{php_ztsextdir}/%{pecl_name}.so
|
|
|
1b1a943 |
%endif
|
|
|
1b1a943 |
|
|
|
1b1a943 |
|
|
|
1b1a943 |
%changelog
|
|
|
004592b |
* Mon Jul 13 2020 Remi Collet <remi@remirepo.net> - 1.0.7-1
|
|
|
004592b |
- update to 1.0.7
|
|
|
004592b |
|
|
|
934f650 |
* Mon Feb 24 2020 Remi Collet <remi@remirepo.net> - 1.0.6-1
|
|
|
e1d5268 |
- update to 1.0.6
|
|
|
e1d5268 |
|
|
|
a121888 |
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-2
|
|
|
a121888 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
a121888 |
|
|
|
934f650 |
* Wed Nov 27 2019 Remi Collet <remi@remirepo.net> - 1.0.5-1
|
|
|
80ea10a |
- update to 1.0.5
|
|
|
80ea10a |
|
|
|
c42f567 |
* Tue Nov 12 2019 Remi Collet <remi@remirepo.net> - 1.0.4-1
|
|
|
c42f567 |
- update to 1.0.4
|
|
|
c42f567 |
|
|
|
6e136cc |
* Thu Oct 03 2019 Remi Collet <remi@remirepo.net> - 1.0.3-2
|
|
|
6e136cc |
- rebuild for https://fedoraproject.org/wiki/Changes/php74
|
|
|
6e136cc |
|
|
|
12dd288 |
* Mon Jul 29 2019 Remi Collet <remi@remirepo.net> - 1.0.3-1
|
|
|
12dd288 |
- update to 1.0.3
|
|
|
12dd288 |
|
|
|
bd4af0b |
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-2
|
|
|
bd4af0b |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
bd4af0b |
|
|
|
2763967 |
* Mon Jul 1 2019 Remi Collet <remi@remirepo.net> - 1.0.2-1
|
|
|
2763967 |
- update to 1.0.2
|
|
|
2763967 |
|
|
|
88b46bb |
* Mon Feb 11 2019 Remi Collet <remi@remirepo.net> - 1.0.1-1
|
|
|
88b46bb |
- update to 1.0.1
|
|
|
88b46bb |
|
|
|
a67a96b |
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
|
|
|
a67a96b |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
|
a67a96b |
|
|
|
c3ac41b |
* Mon Oct 22 2018 Remi Collet <remi@remirepo.net> - 1.0.0-1
|
|
|
c3ac41b |
- update to 1.0.0
|
|
|
c3ac41b |
|
|
|
838d99a |
* Thu Oct 11 2018 Remi Collet <remi@remirepo.net> - 0.1.7-2
|
|
|
838d99a |
- Rebuild for https://fedoraproject.org/wiki/Changes/php73
|
|
|
838d99a |
|
|
|
5c19256 |
* Sun Oct 7 2018 Remi Collet <remi@remirepo.net> - 0.1.7-1
|
|
|
5c19256 |
- update to 0.1.7
|
|
|
5c19256 |
|
|
|
2bdd44a |
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.6-4
|
|
|
2bdd44a |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
|
2bdd44a |
|
|
|
f3769c8 |
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.6-3
|
|
|
f3769c8 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
|
|
f3769c8 |
|
|
|
aca699e |
* Thu Jan 25 2018 Remi Collet <remi@remirepo.net> - 0.1.6-2
|
|
|
aca699e |
- undefine _strict_symbol_defs_build
|
|
|
aca699e |
|
|
|
a096128 |
* Mon Oct 9 2017 Remi Collet <remi@remirepo.net> - 0.1.6-1
|
|
|
a096128 |
- update to 0.1.6 (stable)
|
|
|
a096128 |
|
|
|
1616aa2 |
* Tue Oct 03 2017 Remi Collet <remi@fedoraproject.org> - 0.1.5-2
|
|
|
1616aa2 |
- rebuild for https://fedoraproject.org/wiki/Changes/php72
|
|
|
1616aa2 |
|
|
|
42703ce |
* Tue Aug 1 2017 Remi Collet <remi@remirepo.net> - 0.1.5-1
|
|
|
42703ce |
- update to 0.1.5 (stable)
|
|
|
42703ce |
- sources from PECL
|
|
|
8fcde76 |
|
|
|
e18b89c |
* Wed Mar 29 2017 Remi Collet <remi@remirepo.net> - 0.1.4-3
|
|
|
e18b89c |
- add upstream patch for PHP 7.1.4RC1, fix FTBFS detected by Koschei
|
|
|
e18b89c |
|
|
|
68e82e8 |
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-2
|
|
|
68e82e8 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
|
|
68e82e8 |
|
|
|
91fb9a1 |
* Thu Jan 26 2017 Remi Collet <remi@fedoraproject.org> - 0.1.4-1
|
|
|
91fb9a1 |
- update to 0.1.4
|
|
|
91fb9a1 |
|
|
|
6d43193 |
* Thu Jan 19 2017 Remi Collet <remi@fedoraproject.org> - 0.1.3-1
|
|
|
6d43193 |
- update to 0.1.3
|
|
|
6d43193 |
|
|
|
1b1a943 |
* Fri Nov 25 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-2
|
|
|
1b1a943 |
- fix LICENSE, drop empty file, from review #1398355
|
|
|
1b1a943 |
- add upstream patch for php 7.1
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Thu Nov 24 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-1
|
|
|
1b1a943 |
- drop SCL stuff for Fedora review
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Wed Sep 14 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-2
|
|
|
1b1a943 |
- rebuild for PHP 7.1 new API version
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Fri Aug 5 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-1
|
|
|
1b1a943 |
- update to 0.1.2
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Fri Jun 10 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-0.1.20160608gitb8f5805
|
|
|
1b1a943 |
- update to 0.1.2-dev for PHP 7.1
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Thu Jan 7 2016 Remi Collet <remi@fedoraproject.org> - 0.1.1-1
|
|
|
1b1a943 |
- update to 0.1.1
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Thu Oct 29 2015 Remi Collet <remi@fedoraproject.org> - 0.1.0-0.2.20151021gitac969d7
|
|
|
1b1a943 |
- add dependency on php-tokenizer, fix test suite
|
|
|
1b1a943 |
|
|
|
1b1a943 |
* Wed Oct 28 2015 Remi Collet <remi@fedoraproject.org> - 0.1.0-0.1.20151021gitac969d7
|
|
|
1b1a943 |
- new package, version 0.1.0dev
|