From ec546752769681144b07e6d4dba0045023f0c49d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 12 Jun 2019 16:24:21 +0200 Subject: v1.1.0 from Fedora --- composer.json | 55 +++++++++++++++++++++++++ makesrc.sh | 1 + php-cache-adapter-common-get-source.sh | 74 ++++++++++++++++++++++++++++++++++ php-cache-adapter-common.spec | 39 +++++++++++++----- 4 files changed, 160 insertions(+), 9 deletions(-) create mode 100644 composer.json create mode 120000 makesrc.sh create mode 100755 php-cache-adapter-common-get-source.sh diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..be69af0 --- /dev/null +++ b/composer.json @@ -0,0 +1,55 @@ +{ + "name": "cache/adapter-common", + "description": "Common classes for PSR-6 adapters", + "type": "library", + "license": "MIT", + "minimum-stability": "dev", + "prefer-stable": true, + "keywords": [ + "cache", + "psr-6", + "tag" + ], + "homepage": "http://www.php-cache.com/en/latest/", + "authors": [ + { + "name": "Aaron Scherer", + "email": "aequasi@gmail.com", + "homepage": "https://github.com/aequasi" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/nyholm" + } + ], + "require": { + "php": "^5.6 || ^7.0", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "psr/log": "^1.0", + "cache/tag-interop": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.21", + "cache/integration-tests": "^0.16" + }, + "autoload": { + "psr-4": { + "Cache\\Adapter\\Common\\": "" + } + }, + "autoload-dev": { + "psr-4": { + "Cache\\Adapter\\Common\\Tests\\": "Tests/" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..c75fdc0 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-cache-adapter-common-get-source.sh \ No newline at end of file diff --git a/php-cache-adapter-common-get-source.sh b/php-cache-adapter-common-get-source.sh new file mode 100755 index 0000000..ce6064d --- /dev/null +++ b/php-cache-adapter-common-get-source.sh @@ -0,0 +1,74 @@ +#/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" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +SPEC_DIR=`pwd` + +print "SPEC_DIR = $SPEC_DIR" + +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) + +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 ${SPEC_DIR} + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + TAR_FILE=${SPEC_DIR}/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-cache-adapter-common.spec b/php-cache-adapter-common.spec index 7ce1026..ebcbd57 100644 --- a/php-cache-adapter-common.spec +++ b/php-cache-adapter-common.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-cache-adapter-common # -# Copyright (c) 2017 Shawn Iwinski +# Copyright (c) 2017-2019 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner php-cache %global github_name adapter-common -%global github_version 0.4.0 -%global github_commit 2adecd1375fe2ce15b1679349965d7fa73f2676b +%global github_version 1.1.0 +%global github_commit 6320bb5f5574cb88438059b59f8708da6b6f1d32 %global composer_vendor cache %global composer_project adapter-common @@ -43,26 +43,36 @@ Version: %{github_version} Release: 1%{?github_release}%{?dist} Summary: Common classes for PSR-6 adapters -Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} -Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +# GitHub export does not include tests +# Run php-cache-adapter-common-get-source.sh to create full source +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildArch: noarch # Tests %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-composer(phpunit/phpunit) +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(cache/tag-interop) >= %{cache_tag_interop_min_ver} with php-composer(cache/tag-interop) < %{cache_tag_interop_max_ver}) +BuildRequires: (php-composer(psr/cache) >= %{psr_cache_min_ver} with php-composer(psr/cache) < %{psr_cache_max_ver}) +BuildRequires: (php-composer(psr/log) >= %{psr_log_min_ver} with php-composer(psr/log) < %{psr_log_max_ver}) +BuildRequires: (php-composer(psr/simple-cache) >= %{psr_simple_cache_min_ver} with php-composer(psr/simple-cache) < %{psr_simple_cache_max_ver}) +%else BuildRequires: php-composer(cache/tag-interop) < %{cache_tag_interop_max_ver} BuildRequires: php-composer(cache/tag-interop) >= %{cache_tag_interop_min_ver} -BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php-composer(psr/cache) < %{psr_cache_max_ver} BuildRequires: php-composer(psr/cache) >= %{psr_cache_min_ver} BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} BuildRequires: php-composer(psr/simple-cache) < %{psr_simple_cache_max_ver} BuildRequires: php-composer(psr/simple-cache) >= %{psr_simple_cache_min_ver} -## phpcompatinfo (computed from version 0.4.0) +%endif +## phpcompatinfo (computed from version 1.1.0) BuildRequires: php-date BuildRequires: php-pcre BuildRequires: php-reflection @@ -73,6 +83,12 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(cache/tag-interop) >= %{cache_tag_interop_min_ver} with php-composer(cache/tag-interop) < %{cache_tag_interop_max_ver}) +Requires: (php-composer(psr/cache) >= %{psr_cache_min_ver} with php-composer(psr/cache) < %{psr_cache_max_ver}) +Requires: (php-composer(psr/log) >= %{psr_log_min_ver} with php-composer(psr/log) < %{psr_log_max_ver}) +Requires: (php-composer(psr/simple-cache) >= %{psr_simple_cache_min_ver} with php-composer(psr/simple-cache) < %{psr_simple_cache_max_ver}) +%else Requires: php-composer(cache/tag-interop) < %{cache_tag_interop_max_ver} Requires: php-composer(cache/tag-interop) >= %{cache_tag_interop_min_ver} Requires: php-composer(psr/cache) < %{psr_cache_max_ver} @@ -81,7 +97,8 @@ Requires: php-composer(psr/log) < %{psr_log_max_ver} Requires: php-composer(psr/log) >= %{psr_log_min_ver} Requires: php-composer(psr/simple-cache) < %{psr_simple_cache_max_ver} Requires: php-composer(psr/simple-cache) >= %{psr_simple_cache_min_ver} -# phpcompatinfo (computed from version 0.4.0) +%endif +# phpcompatinfo (computed from version 1.1.0) Requires: php-date Requires: php-pcre Requires: php-spl @@ -138,7 +155,7 @@ BOOTSTRAP : Upstream tests RETURN_CODE=0 -for PHP_EXEC in php php70 php71 php72; do +for PHP_EXEC in php php71 php72 php73 php74; do if which $PHP_EXEC; then $PHP_EXEC %{_bindir}/phpunit --verbose --bootstrap bootstrap.php \ || RETURN_CODE=1 @@ -165,5 +182,9 @@ exit $RETURN_CODE %changelog +* Sat Jun 01 2019 Shawn Iwinski - 1.1.0-1 +- Update to 1.1.0 (RHBZ #1474797) +- Add range version dependencies for Fedora >= 27 || RHEL >= 8 + * Fri Apr 14 2017 Shawn Iwinski - 0.4.0-1 - Initial package -- cgit