Blame php-udan11-sql-parser.spec

1752805
# remirepo/fedora spec file for php-udan11-sql-parser
1752805
#
9675fa5
# Copyright (c) 2015-2017 Remi Collet
1752805
# License: CC-BY-SA
1752805
# http://creativecommons.org/licenses/by-sa/4.0/
1752805
#
1752805
# Please, preserve the changelog entries
1752805
#
b35782e
b35782e
##TODO next version will have tests back
b35782e
e5b2a45
%global gh_commit    2b59d9e19432a385d952bcc94b3ffe6b11f22cbf
1752805
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
a58b248
%global gh_owner     phpmyadmin
73dcb77
#global gh_date      20150820
1752805
%global gh_project   sql-parser
1752805
%global with_tests   0%{!?_without_tests:1}
1752805
%global psr0         SqlParser
b35782e
%if 0%{?fedora} >= 26
b35782e
%global with_cmd     0
b35782e
%else
b35782e
%global with_cmd     1
b35782e
%endif
1752805
a58b248
Name:           php-udan11-%{gh_project}
e5b2a45
Version:        3.4.17
b35782e
Release:        2%{?gh_date?%{gh_date}git%{gh_short}}%{?dist}
1752805
Summary:        A validating SQL lexer and parser with a focus on MySQL dialect
1752805
1752805
Group:          Development/Libraries
1752805
License:        GPLv2+
1752805
URL:            https://github.com/%{gh_owner}/%{gh_project}
e5b2a45
Source0:        %{name}-%{version}-%{gh_short}.tgz
e5b2a45
Source1:        makesrc.sh
1752805
a58b248
# Use our autoloader
a58b248
Patch0:         %{name}-autoload.patch
6733ed7
1752805
BuildArch:      noarch
1752805
%if %{with_tests}
a6ce839
BuildRequires:  php(language) >= 5.3.0
1752805
# For tests, from composer.json "require-dev": {
6733ed7
#        "phpunit/php-code-coverage": "~2.0 || ~3.0",
6733ed7
#        "phpunit/phpunit": "~4.8 || ~5.1"
a7850fe
BuildRequires:  php-composer(phpunit/phpunit)
1752805
%endif
1752805
# For autoloader
e5b2a45
BuildRequires:  php-composer(fedora/autoloader)
1752805
1752805
# From composer.json, "require": {
a6ce839
#        "php": ">=5.3.0",
69b0bab
#        "ext-mbstring": "*"
a6ce839
Requires:       php(language) >= 5.3
1752805
Requires:       php-mbstring
69b0bab
# From phpcompatinfo report for 3.4.5
69b0bab
Requires:       php-ctype
1752805
Requires:       php-pcre
1752805
# For generated autoloader
6083358
Requires:       php-composer(fedora/autoloader)
b35782e
%if %{with_cmd}
b35782e
Requires:       php-cli
b35782e
%endif
1752805
1752805
# Rename
1752805
Obsoletes:      php-dmitry-php-sql-parser < 0-0.2
1752805
Provides:       php-dmitry-php-sql-parser = %{version}-%{release}
1752805
1752805
# Composer
a58b248
Provides:       php-composer(udan11/%{gh_project})      = %{version}
1752805
Provides:       php-composer(%{gh_owner}/%{gh_project}) = %{version}
1752805
1752805
1752805
%description
1752805
A validating SQL lexer and parser with a focus on MySQL dialect.
1752805
1752805
This library was originally developed for phpMyAdmin during
1752805
the Google Summer of Code 2015.
1752805
a58b248
Autoloader: %{_datadir}/php/%{psr0}/autoload.php
1752805
1752805
1752805
%prep
1752805
%setup -q -n %{gh_project}-%{gh_commit}
a58b248
%patch0 -p0 -b .rpm
1752805
1752805
1752805
%build
e5b2a45
: Create autoloader
e5b2a45
cat <<'AUTOLOAD' | tee src/autoload.php
e5b2a45
e5b2a45
/* Autoloader for %{name} and its dependencies */
e5b2a45
require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
e5b2a45
e5b2a45
\Fedora\Autoloader\Autoload::addPsr4('%{psr0}\\', __DIR__);
e5b2a45
AUTOLOAD
1752805
1752805
1752805
%install
a58b248
a58b248
: Library
1752805
mkdir -p   %{buildroot}%{_datadir}/php
1752805
cp -pr src %{buildroot}%{_datadir}/php/%{psr0}
1752805
b35782e
%if %{with_cmd}
a58b248
: Commands
a58b248
install -Dpm 0755 bin/highlight-query %{buildroot}%{_bindir}/%{gh_project}-highlight-query
a58b248
install -Dpm 0755 bin/lint-query      %{buildroot}%{_bindir}/%{gh_project}-lint-query
b35782e
%endif
a58b248
1752805
1752805
%check
1752805
%if %{with_tests}
1752805
mkdir vendor
1752805
cat << 'EOF' | tee vendor/autoload.php
1752805
1752805
require '%{buildroot}%{_datadir}/php/%{psr0}/autoload.php';
e5b2a45
\Fedora\Autoloader\Autoload::addPsr4('%{psr0}\\Tests\\', dirname(__DIR__).'/tests');
1752805
EOF
1752805
a7850fe
if %{_bindir}/phpunit --atleast-version 4.8; then
6733ed7
   %{_bindir}/phpunit --no-coverage --verbose
a7850fe
fi
1752805
%else
1752805
: Test suite disabled
1752805
%endif
1752805
1752805
1752805
%files
1752805
%{!?_licensedir:%global license %%doc}
1752805
%license LICENSE.txt
1752805
%doc composer.json
1752805
%doc README.md
1752805
%{_datadir}/php/%{psr0}
b35782e
%if %{with_cmd}
a58b248
%{_bindir}/%{gh_project}-highlight-query
a58b248
%{_bindir}/%{gh_project}-lint-query
b35782e
%endif
1752805
1752805
1752805
%changelog
b35782e
* Mon Jan 23 2017 Remi Collet <remi@fedoraproject.org> - 3.4.17-2
b35782e
- drop commands on F26
b35782e
e5b2a45
* Fri Jan 20 2017 Remi Collet <remi@fedoraproject.org> - 3.4.17-1
e5b2a45
- update to 3.4.17
e5b2a45
- sources from a git snapshot to retrieve test suite
e5b2a45
- switch to PSR-4 autoloader
e5b2a45
1291fc0
* Fri Jan  6 2017 Remi Collet <remi@fedoraproject.org> - 3.4.16-1
1291fc0
- update to 3.4.16
1291fc0
9675fa5
* Mon Jan  2 2017 Remi Collet <remi@fedoraproject.org> - 3.4.15-1
9675fa5
- update to 3.4.15
9675fa5
e30c1cb
* Wed Nov 30 2016 Remi Collet <remi@fedoraproject.org> - 3.4.14-1
e30c1cb
- update to 3.4.14
e30c1cb
811a99c
* Wed Nov 16 2016 Remi Collet <remi@fedoraproject.org> - 3.4.13-1
811a99c
- update to 3.4.13
811a99c
6083358
* Wed Nov  9 2016 Remi Collet <remi@fedoraproject.org> - 3.4.12-1
6083358
- update to 3.4.12
6083358
- switch to fedora/autoloader
6083358
9598c58
* Tue Oct 25 2016 Remi Collet <remi@fedoraproject.org> - 3.4.11-1
9598c58
- update to 3.4.11
9598c58
3ecad79
* Tue Oct  4 2016 Remi Collet <remi@fedoraproject.org> - 3.4.10-1
3ecad79
- update to 3.4.10
3ecad79
07e7168
* Tue Sep 20 2016 Remi Collet <remi@fedoraproject.org> - 3.4.7-1
07e7168
- update to 3.4.7
07e7168
a6ce839
* Tue Sep 13 2016 Remi Collet <remi@fedoraproject.org> - 3.4.6-1
a6ce839
- update to 3.4.6
a6ce839
- lower dependency on php >= 5.3
a6ce839
69b0bab
* Tue Sep 13 2016 Remi Collet <remi@fedoraproject.org> - 3.4.5-1
69b0bab
- update to 3.4.5
69b0bab
a58b248
* Tue Jul 26 2016 Remi Collet <remi@fedoraproject.org> - 3.4.4-1
a58b248
- update to 3.4.4
a58b248
- switch from udan11/sql-parser to phpmyadmin/sql-parser
a58b248
- add sql-parser-highlight-query and sql-parser-lint-query commands
a58b248
6733ed7
* Tue Mar  1 2016 Remi Collet <remi@fedoraproject.org> - 3.4.0-1
6733ed7
- update to 3.4.0 (for phpMyAdmin 4.5.5.1)
6733ed7
- add patch from phpMyAdmin
6733ed7
- raise dependency on php >= 5.4
6733ed7
a7850fe
* Tue Feb 23 2016 Remi Collet <remi@fedoraproject.org> - 3.3.1-1
a7850fe
- update to 3.3.1 (for phpMyAdmin 4.5.5)
a7850fe
- don't run test with old PHPUnit (EPEL-6)
a7850fe
3a4e93a
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.8-2
3a4e93a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3a4e93a
1921741
* Sat Dec 26 2015 Remi Collet <remi@fedoraproject.org> - 3.0.8-1
1921741
- update to 3.0.8 (for phpMyAdmin 4.5.3)
1921741
68b6bba
* Fri Nov 13 2015 Remi Collet <remi@fedoraproject.org> - 3.0.7-1
68b6bba
- update to 3.0.7
68b6bba
- run test suite with both PHP 5 and 7 when available
68b6bba
cc084cf
* Thu Oct 22 2015 Remi Collet <remi@fedoraproject.org> - 3.0.4-1
cc084cf
- update to 3.0.4 (for upcoming phpMyAdmin 4.5.1)
cc084cf
09253fe
* Wed Sep 23 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-2
09253fe
- upstream patch for phpMyAdmin 4.5.0.2
09253fe
09253fe
* Wed Sep 23 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
73dcb77
- tagged as 1.0.0 (no change)
73dcb77
1752805
* Sun Sep 20 2015 Remi Collet <remi@fedoraproject.org> - 0-0.3.20150820git1b2988f
1752805
- fix provides and self-obsoletion (review #1262807)
1752805
1752805
* Mon Sep 14 2015 Remi Collet <remi@fedoraproject.org> - 0-0.2.20150820git1b2988f
1752805
- rename to php-udan11-sql-parser
1752805
1752805
* Mon Sep 14 2015 Remi Collet <remi@fedoraproject.org> - 0-0.1.20150629git4aaed44
a7850fe
- initial package