From 267cfd29deb0c67a05af269193482e3af17f882e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 20 Jan 2017 19:32:43 +0100 Subject: php-udan11-sql-parser: 3.4.17 --- composer.json | 5 +++++ makesrc.sh | 28 ++++++++++++++++++++++++++++ php-udan11-sql-parser.spec | 25 +++++++++++++++++++------ 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100755 makesrc.sh 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 + - 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 - 3.4.16-1 - update to 3.4.16 -- cgit