From bffb4313494bce47de37d688884fa8d534353af7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Nov 2020 09:34:05 +0100 Subject: update to 1.8.3 sources from git snapshot --- makesrc.sh | 1 + php-jsonlint-get-source.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++ php-jsonlint.spec | 12 ++++++--- 3 files changed, 74 insertions(+), 3 deletions(-) create mode 120000 makesrc.sh create mode 100755 php-jsonlint-get-source.sh diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..d39970a --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-jsonlint-get-source.sh \ No newline at end of file diff --git a/php-jsonlint-get-source.sh b/php-jsonlint-get-source.sh new file mode 100755 index 0000000..f8f69e8 --- /dev/null +++ b/php-jsonlint-get-source.sh @@ -0,0 +1,64 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +SPEC=`ls *.spec` +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) +TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz +CMP_FILE=$PWD/composer.json + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + cp composer.json $CMP_FILE + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR +popd + +rm -rf $TEMP_DIR diff --git a/php-jsonlint.spec b/php-jsonlint.spec index 75a6bbd..7bb6898 100644 --- a/php-jsonlint.spec +++ b/php-jsonlint.spec @@ -13,8 +13,8 @@ %global github_owner Seldaek %global github_name jsonlint -%global github_version 1.8.2 -%global github_commit 590cfec960b77fd55e39b7d9246659e95dd6d337 +%global github_version 1.8.3 +%global github_commit 9ad6ce79c342fbd44df10ea95511a1b24dee5b57 # "php": "^5.3 || ^7.0 || ^8.0" %global php_min_ver 5.3 @@ -29,7 +29,9 @@ Summary: JSON Lint for PHP License: MIT URL: https://github.com/%{github_owner}/%{github_name} -Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +# git snapshot to retrieve upstream test suite +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh # Bin usage without Composer autoloader Patch0: %{name}-bin-without-composer-autoloader.patch @@ -131,6 +133,10 @@ exit $ret %changelog +* Thu Nov 12 2020 Remi Collet - 1.8.3-1 +- update to 1.8.3 +- sources from git snapshot + * Wed Aug 26 2020 Remi Collet - 1.8.2-1 - update to 1.8.2 - switch to classmap autoloader -- cgit