summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-04-06 10:30:16 +0200
committerRemi Collet <remi@remirepo.net>2020-04-06 10:30:16 +0200
commit0c36a997c2475f9231d42f4801bde4875d219d12 (patch)
tree825a35ff803d98fd9dbea034fb9262941ff8f378
parent950db6737720f7390d68c8e2844b51a9cf8b5c61 (diff)
v1.0.4 from Fedora
l---------makesrc.sh1
-rwxr-xr-xphp-brumann-polyfill-unserialize-get-source.sh74
-rw-r--r--php-brumann-polyfill-unserialize.spec21
3 files changed, 89 insertions, 7 deletions
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 e59d84f..1eebb71 100644
--- a/php-brumann-polyfill-unserialize.spec
+++ b/php-brumann-polyfill-unserialize.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-brumann-polyfill-unserialize
#
-# Copyright (c) 2019 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2019-2020 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,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
@@ -33,7 +33,11 @@ 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
@@ -41,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)
@@ -49,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)
@@ -113,7 +117,7 @@ BOOTSTRAP
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in php php71 php72 php73 php74; do
+for PHP_EXEC in php php72 php73 php74; do
if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1
fi
@@ -134,5 +138,8 @@ exit $RETURN_CODE
%changelog
+* 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