summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--Makefile4
-rw-r--r--composer.json26
l---------makesrc.sh1
-rwxr-xr-xphp-brumann-polyfill-unserialize-get-source.sh74
-rw-r--r--php-brumann-polyfill-unserialize.spec34
6 files changed, 138 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..ec4a2cf
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,26 @@
+{
+ "name": "brumann/polyfill-unserialize",
+ "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Denis Brumann",
+ "email": "denis.brumann@sensiolabs.de"
+ }
+ ],
+ "autoload": {
+ "psr-4": {
+ "Brumann\\Polyfill\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Tests\\Brumann\\Polyfill\\": "tests/"
+ }
+ },
+ "minimum-stability": "stable",
+ "require": {
+ "php": "^5.3|^7.0"
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 120000
index 0000000..f408c7d
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1 @@
+php-brumann-polyfill-unserialize-get-source.sh \ No newline at end of file
diff --git a/php-brumann-polyfill-unserialize-get-source.sh b/php-brumann-polyfill-unserialize-get-source.sh
new file mode 100755
index 0000000..3947de4
--- /dev/null
+++ b/php-brumann-polyfill-unserialize-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}/composer.json
+ 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-brumann-polyfill-unserialize.spec b/php-brumann-polyfill-unserialize.spec
index 315bf10..ef70875 100644
--- a/php-brumann-polyfill-unserialize.spec
+++ b/php-brumann-polyfill-unserialize.spec
@@ -1,7 +1,8 @@
+# remirepo spec file for php-brumann-polyfill-unserialize, from
#
# Fedora spec file for php-brumann-polyfill-unserialize
#
-# Copyright (c) 2019 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2019-2021 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -11,8 +12,8 @@
%global github_owner dbrumann
%global github_name polyfill-unserialize
-%global github_version 1.0.3
-%global github_commit 844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b
+%global github_version 1.0.4
+%global github_commit 8ed1cd343ddc134a7ef649aca0aa0fe2a1b45008
%global composer_vendor brumann
%global composer_project polyfill-unserialize
@@ -27,12 +28,16 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 1%{?github_release}%{?dist}
+Release: 4%{?github_release}%{?dist}
Summary: Backports unserialize options introduced in PHP 7.0
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-brumann-polyfill-unserialize-get-source.sh to create full source.
+Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
+Source1: %{name}-get-source.sh
BuildArch: noarch
# Tests
@@ -40,7 +45,7 @@ BuildArch: noarch
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
-## phpcompatinfo for version 1.0.3
+## phpcompatinfo for version 1.0.4
BuildRequires: php-pcre
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
@@ -48,7 +53,7 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo for version 1.0.3
+# phpcompatinfo for version 1.0.4
Requires: php-pcre
# Autoloader
Requires: php-composer(fedora/autoloader)
@@ -109,12 +114,17 @@ require '%{buildroot}%{phpdir}/Brumann/Polyfill/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Tests\\Brumann\\Polyfill\\', __DIR__.'/tests');
BOOTSTRAP
+# SKIP test_with_parent_not_allowed_serialized_class_is_not_accessible: notice promoted to warning
+
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in php php70 php71 php72 php73 php74; do
+for PHP_EXEC in php php73 php74 php80; do
if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1
+ $PHP_EXEC $PHPUNIT \
+ --bootstrap bootstrap.php \
+ --filter '^((?!(test_with_parent_not_allowed_serialized_class_is_not_accessible)).)*$' \
+ --verbose || RETURN_CODE=1
fi
done
exit $RETURN_CODE
@@ -133,5 +143,11 @@ exit $RETURN_CODE
%changelog
+* Tue Apr 6 2021 Remi Collet <remi@remirepo.net> - 1.0.4-4
+- skip 1 test failing with PHP 8
+
+* Sun Apr 05 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.4-1
+- Update to 1.0.4 (RHBZ #1742087)
+
* Wed May 08 2019 Shawn Iwinski <shawn@iwin.ski> - 1.0.3-1
- Initial package