diff options
-rwxr-xr-x | makesrc.sh | 24 | ||||
-rw-r--r-- | php-PHPParser.spec | 7 |
2 files changed, 27 insertions, 4 deletions
diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..d78aad2 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +NAME=php-PHPParser +OWNER=nikic +PROJECT=PHP-Parser +VERSION=$(sed -n '/^%global github_version/{s/.* //;p}' $NAME.spec) +COMMIT=$(sed -n '/^%global github_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +echo "Cloning..." +git clone https://github.com/nikic/PHP-Parser.git $PROJECT-$SHORT + +echo "Gettin commit..." +pushd $PROJECT-$SHORT +git checkout $COMMIT +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$SHORT + +echo "Cleaning..." +rm -rf $PROJECT-$SHORT + +echo "Done." diff --git a/php-PHPParser.spec b/php-PHPParser.spec index 0eb8551..a3e8149 100644 --- a/php-PHPParser.spec +++ b/php-PHPParser.spec @@ -18,10 +18,9 @@ Group: Development/Libraries License: BSD URL: https://github.com/%{github_owner}/%{github_name} # Upstream tarball don't provide test suite -# git clone https://github.com/nikic/PHP-Parser.git -# cd PHP-Parser; git checkout ac05ef6f95bf8361549604b6031c115f92f39528; cd .. -# tar czf php-PHPParser-1.1.0-ac05ef6.tgz --exclude .git PHP-Parser +# Use mksrc.sh to generate a git snapshot tarball Source0: %{name}-%{github_version}-%{github_short}.tgz +Source1: mksrc.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -57,7 +56,7 @@ A PHP parser written in PHP to simplify static analysis and code manipulation. %prep -%setup -q -n %{github_name} +%setup -q -n %{github_name}-%{github_short} %build |