diff options
author | Remi Collet <remi@remirepo.net> | 2019-06-12 16:26:29 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-06-12 16:26:29 +0200 |
commit | a86ca544d50fa2d40ee61e086e0c64fdec65f506 (patch) | |
tree | 938025370e374329c488dc3b5a785615d08ac188 | |
parent | d4b2e8a139e059fc247c7454f6c04bc086a7e3d4 (diff) |
-rw-r--r-- | composer.json | 54 | ||||
l--------- | makesrc.sh | 1 | ||||
-rwxr-xr-x | php-cache-filesystem-adapter-get-source.sh | 74 | ||||
-rw-r--r-- | php-cache-filesystem-adapter.spec | 52 |
4 files changed, 166 insertions, 15 deletions
diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..cbaa880 --- /dev/null +++ b/composer.json @@ -0,0 +1,54 @@ +{ + "name": "cache/filesystem-adapter", + "description": "A PSR-6 cache implementation using filesystem. This implementation supports tags", + "type": "library", + "license": "MIT", + "minimum-stability": "dev", + "prefer-stable": true, + "keywords": [ + "cache", + "psr-6", + "filesystem", + "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", + "cache/adapter-common": "^1.0", + "league/flysystem": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.21", + "cache/integration-tests": "^0.16" + }, + "provide": { + "psr/cache-implementation": "^1.0" + }, + "autoload": { + "psr-4": { + "Cache\\Adapter\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..236d809 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-cache-filesystem-adapter-get-source.sh
\ No newline at end of file diff --git a/php-cache-filesystem-adapter-get-source.sh b/php-cache-filesystem-adapter-get-source.sh new file mode 100755 index 0000000..ce6064d --- /dev/null +++ b/php-cache-filesystem-adapter-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-filesystem-adapter.spec b/php-cache-filesystem-adapter.spec index 07f07cf..cf1b15c 100644 --- a/php-cache-filesystem-adapter.spec +++ b/php-cache-filesystem-adapter.spec @@ -1,8 +1,8 @@ -# remirepo spec file for php-cache-filesystem-common, from: +# remirepo spec file for php-cache-filesystem-adapter, from: # -# Fedora spec file for php-cache-filesystem-common +# Fedora spec file for php-cache-filesystem-adapter # -# Copyright (c) 2017 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,17 +12,17 @@ %global github_owner php-cache %global github_name filesystem-adapter -%global github_version 0.4.0 -%global github_commit 98ee81842156d18dade449f4dd5b3a89f9a9fcc9 +%global github_version 1.0.0 +%global github_commit d50680b6dabbe39f9831f5fc9efa61c09d936017 %global composer_vendor cache %global composer_project filesystem-adapter # "php": "^5.6 || ^7.0" %global php_min_ver 5.6 -# "cache/adapter-common": "^0.4" -%global cache_adapter_common_min_ver 0.4 -%global cache_adapter_common_max_ver 1.0 +# "cache/adapter-common": "^1.0" +%global cache_adapter_common_min_ver 1.0 +%global cache_adapter_common_max_ver 2.0 # "cache/integration-tests": "^0.16" %global cache_integration_tests_min_ver 0.16 %global cache_integration_tests_max_ver 1.0 @@ -43,31 +43,42 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 2%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: A PSR-6 cache implementation using filesystem -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-filesystem-adapter-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/adapter-common) >= %{cache_adapter_common_min_ver} with php-composer(cache/adapter-common) < %{cache_adapter_common_max_ver}) +BuildRequires: (php-composer(cache/integration-tests) >= %{cache_integration_tests_min_ver} with php-composer(cache/integration-tests) < %{cache_integration_tests_max_ver}) +BuildRequires: (php-composer(league/flysystem) >= %{league_flysystem_min_ver} with php-composer(league/flysystem) < %{league_flysystem_max_ver}) +BuildRequires: (php-composer(psr/cache) >= %{psr_cache_min_ver} with php-composer(psr/cache) < %{psr_cache_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/adapter-common) < %{cache_adapter_common_max_ver} BuildRequires: php-composer(cache/adapter-common) >= %{cache_adapter_common_min_ver} BuildRequires: php-composer(cache/integration-tests) < %{cache_integration_tests_max_ver} BuildRequires: php-composer(cache/integration-tests) >= %{cache_integration_tests_min_ver} BuildRequires: php-composer(league/flysystem) < %{league_flysystem_max_ver} BuildRequires: php-composer(league/flysystem) >= %{league_flysystem_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/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.0.0) BuildRequires: php-date BuildRequires: php-pcre ## Autoloader @@ -76,6 +87,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/adapter-common) >= %{cache_adapter_common_min_ver} with php-composer(cache/adapter-common) < %{cache_adapter_common_max_ver}) +Requires: (php-composer(league/flysystem) >= %{league_flysystem_min_ver} with php-composer(league/flysystem) < %{league_flysystem_max_ver}) +Requires: (php-composer(psr/cache) >= %{psr_cache_min_ver} with php-composer(psr/cache) < %{psr_cache_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/adapter-common) < %{cache_adapter_common_max_ver} Requires: php-composer(cache/adapter-common) >= %{cache_adapter_common_min_ver} Requires: php-composer(league/flysystem) < %{league_flysystem_max_ver} @@ -84,7 +101,8 @@ Requires: php-composer(psr/cache) < %{psr_cache_max_ver} Requires: php-composer(psr/cache) >= %{psr_cache_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.0.0) Requires: php-date Requires: php-pcre # Autoloader @@ -146,7 +164,7 @@ BOOTSTRAP : Upstream tests RETURN_CODE=0 PHPUNIT=$(which phpunit) -for PHP_EXEC in "" php70 php71 php72; do +for PHP_EXEC in "" php71 php72 php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ || RETURN_CODE=1 @@ -172,6 +190,10 @@ exit $RETURN_CODE %changelog +* Sat Jun 01 2019 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1 +- Update to 1.0.0 (RHBZ #1471569) +- Add range version dependencies for Fedora >= 27 || RHEL >= 8 + * Tue May 30 2017 Shawn Iwinski <shawn@iwin.ski> - 0.4.0-2 - Fix directory ownership |