diff options
| -rwxr-xr-x | makesrc.sh | 27 | ||||
| -rw-r--r-- | php-phpunit-php-code-coverage14.spec | 7 |
2 files changed, 11 insertions, 23 deletions
@@ -1,36 +1,27 @@ #!/bin/bash NAME=$(basename $PWD) -DATE=$(sed -n '/^%global gh_date/{s/.* //;p}' $NAME.spec) 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} -DATE=$(date -d "$DATE -4 days" +%Y-%m-%d) - -if [ -f $NAME-$VERSION-$SHORT.tgz ]; then - echo "$NAME-$VERSION-$SHORT.tgz already there" +if [ -f $NAME-$VERSION.tgz ]; then + echo "$NAME-$VERSION.tgz already there" else - echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Date=$DATE\n" + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION \n" echo "Cloning..." - rm -rf $PROJECT-$COMMIT - git clone --branch ${VERSION:0:4} --shallow-since=$DATE https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT || \ - git clone --shallow-since=$DATE https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT || exit 1 + rm -rf $PROJECT-$VERSION + git clone https://github.com/$OWNER/$PROJECT.git --depth 1 --branch $VERSION $PROJECT-$VERSION || exit 1 - echo "Getting commit..." - pushd $PROJECT-$COMMIT - git checkout $COMMIT || exit 1 - cp composer.json ../composer.json - popd + echo "Getting composer..." + cp $PROJECT-$VERSION/composer.json composer.json echo "Archiving..." - tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs --exclude tools $PROJECT-$COMMIT + tar czf $NAME-$VERSION.tgz --exclude-vcs --exclude tools $PROJECT-$VERSION echo "Cleaning..." - rm -rf $PROJECT-$COMMIT + rm -rf $PROJECT-$VERSION echo "Done." fi diff --git a/php-phpunit-php-code-coverage14.spec b/php-phpunit-php-code-coverage14.spec index b451e05..ea4288e 100644 --- a/php-phpunit-php-code-coverage14.spec +++ b/php-phpunit-php-code-coverage14.spec @@ -10,11 +10,8 @@ %bcond_without tests # Github -%global gh_commit 24f1d7300e54e910197ee65e83d27a1e4bdc917e -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sebastianbergmann %global gh_project php-code-coverage -%global gh_date 2026-04-03 # Packagist %global pk_vendor phpunit %global pk_project php-code-coverage @@ -36,7 +33,7 @@ Summary: PHP code coverage information, version %{ver_major} License: BSD-3-Clause AND MIT AND Apache-2.0 URL: https://github.com/%{gh_owner}/%{gh_project} # run makesrc.sh to create a git snapshot with test suite -Source0: %{name}-%{version}-%{gh_short}.tgz +Source0: %{name}-%{version}.tgz Source1: makesrc.sh BuildArch: noarch @@ -116,7 +113,7 @@ Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}%{ver_major}/autoload.php %prep -%setup -q -n %{gh_project}-%{gh_commit} +%setup -q -n %{gh_project}-%{version} %build |
