summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-01-20 19:32:43 +0100
committerRemi Collet <fedora@famillecollet.com>2017-01-20 19:32:43 +0100
commit267cfd29deb0c67a05af269193482e3af17f882e (patch)
treec779d7cae585977e4739f6d56171d60500377294
parent0979cf63d24f80b6a20beadf51087d4d02f0e0ff (diff)
php-udan11-sql-parser: 3.4.17
-rw-r--r--composer.json5
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-udan11-sql-parser.spec25
3 files changed, 52 insertions, 6 deletions
diff --git a/composer.json b/composer.json
index b1e9836..4917e6d 100644
--- a/composer.json
+++ b/composer.json
@@ -31,5 +31,10 @@
"psr-4": {
"SqlParser\\": "src"
}
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "SqlParser\\Tests\\": "tests"
+ }
}
}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..87d223d
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+rm -rf $PROJECT-$COMMIT
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-udan11-sql-parser.spec b/php-udan11-sql-parser.spec
index ac5e14a..e3b5660 100644
--- a/php-udan11-sql-parser.spec
+++ b/php-udan11-sql-parser.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 18a18d5106aa04ad7c7b79d9b92f123069ceea6e
+%global gh_commit 2b59d9e19432a385d952bcc94b3ffe6b11f22cbf
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner phpmyadmin
#global gh_date 20150820
@@ -15,14 +15,15 @@
%global psr0 SqlParser
Name: php-udan11-%{gh_project}
-Version: 3.4.16
+Version: 3.4.17
Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist}
Summary: A validating SQL lexer and parser with a focus on MySQL dialect
Group: Development/Libraries
License: GPLv2+
URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{?gh_short}.tar.gz
+Source0: %{name}-%{version}-%{gh_short}.tgz
+Source1: makesrc.sh
# Use our autoloader
Patch0: %{name}-autoload.patch
@@ -37,7 +38,7 @@ BuildRequires: php(language) >= 5.3.0
BuildRequires: php-composer(phpunit/phpunit)
%endif
# For autoloader
-BuildRequires: php-fedora-autoloader-devel
+BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require": {
# "php": ">=5.3.0",
@@ -76,8 +77,14 @@ Autoloader: %{_datadir}/php/%{psr0}/autoload.php
%build
-: generate an simple autoloader
-%{_bindir}/phpab --template fedora --output src/autoload.php src
+: Create autoloader
+cat <<'AUTOLOAD' | tee src/autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('%{psr0}\\', __DIR__);
+AUTOLOAD
%install
@@ -98,6 +105,7 @@ mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require '%{buildroot}%{_datadir}/php/%{psr0}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('%{psr0}\\Tests\\', dirname(__DIR__).'/tests');
EOF
# remirepo:11
@@ -139,6 +147,11 @@ rm -rf %{buildroot}
%changelog
+* Fri Jan 20 2017 Remi Collet <remi@fedoraproject.org> - 3.4.17-1
+- update to 3.4.17
+- sources from a git snapshot to retrieve test suite
+- switch to PSR-4 autoloader
+
* Fri Jan 6 2017 Remi Collet <remi@fedoraproject.org> - 3.4.16-1
- update to 3.4.16