From 34413b282f59137c9bcca7f051645fc13c59c21f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 6 Mar 2017 08:49:06 +0100 Subject: php-paragonie-random-compat: sync with Fedora --- makesrc.sh | 28 ------------ php-paragonie-random-compat-get-source.sh | 71 +++++++++++++++++++++++++++++++ php-paragonie-random-compat.spec | 18 ++++---- 3 files changed, 81 insertions(+), 36 deletions(-) delete mode 100755 makesrc.sh create mode 100755 php-paragonie-random-compat-get-source.sh diff --git a/makesrc.sh b/makesrc.sh deleted file mode 100755 index ab1375c..0000000 --- a/makesrc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -NAME=$(basename $PWD) -OWNER=$(sed -n '/^%global github_owner/{s/.* //;p}' $NAME.spec) -PROJECT=$(sed -n '/^%global github_name/{s/.* //;p}' $NAME.spec) -VERSION=$(sed -n '/^%global github_version/{s/.* //;p}' $NAME.spec) -COMMIT=$(sed -n '/^%global github_commit/{s/.* //;p}' $NAME.spec) -SHORT=${COMMIT:0:7} - -echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" - -echo "Cloning..." -rm -rf $PROJECT-$COMMIT -git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT - -echo "Getting commit..." -pushd $PROJECT-$COMMIT -git checkout $COMMIT -cp composer.json ../composer.json -popd - -echo "Archiving..." -tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT - -echo "Cleaning..." -rm -rf $PROJECT-$COMMIT - -echo "Done." diff --git a/php-paragonie-random-compat-get-source.sh b/php-paragonie-random-compat-get-source.sh new file mode 100755 index 0000000..4ad1051 --- /dev/null +++ b/php-paragonie-random-compat-get-source.sh @@ -0,0 +1,71 @@ +#/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 + +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 + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-paragonie-random-compat.spec b/php-paragonie-random-compat.spec index 2b49ce0..d846e7c 100644 --- a/php-paragonie-random-compat.spec +++ b/php-paragonie-random-compat.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-paragonie-random-compat # -# Copyright (c) 2015-2016 Shawn Iwinski +# Copyright (c) 2015-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -14,7 +14,6 @@ %global github_name random_compat %global github_version 2.0.9 %global github_commit 6968531206671f94377b01dc7888d5d1b858a01b -%global github_short %(c=%{github_commit}; echo ${c:0:7}) %global composer_vendor paragonie %global composer_project random_compat @@ -37,9 +36,9 @@ License: MIT URL: https://github.com/%{github_owner}/%{github_name} # GitHub export does not include tests. -# Run makesrc.sh to create full source. -Source0: %{name}-%{version}-%{github_short}.tgz -Source1: makesrc.sh +# Run php-paragonie-random-compat-get-source.sh to create full source. +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -48,14 +47,14 @@ BuildArch: noarch ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -## phpcompatinfo (computed from version 2.0.4) +## phpcompatinfo (computed from version 2.0.9) BuildRequires: php-pcre BuildRequires: php-zlib %endif # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 2.0.4) +# phpcompatinfo (computed from version 2.0.9) Requires: php-pcre # Weak dependencies %if 0%{?fedora} >= 21 @@ -101,7 +100,7 @@ BOOTSTRAP=%{buildroot}%{phpdir}/random_compat/autoload.php : Upstream tests with SCLs if available SCL_RETURN_CODE=0 -for SCL in php56 php70 php71; do +for SCL in %{?rhel:php54 php55} php56 php70 php71; do if which $SCL; then $SCL %{_bindir}/phpunit --verbose --bootstrap $BOOTSTRAP || SCL_RETURN_CODE=1 fi @@ -126,6 +125,9 @@ rm -rf %{buildroot} %changelog +* Sun Mar 05 2017 Shawn Iwinski - 2.0.9-1 +- Updated to 2.0.9 (RHBZ #1385987) + * Sat Mar 4 2017 Remi Collet - 2.0.9-1 - Update to 2.0.9 -- cgit