diff options
-rw-r--r-- | composer.json | 2 | ||||
-rwxr-xr-x | php-simplesamlphp-saml2-get-source.sh | 73 | ||||
-rw-r--r-- | php-simplesamlphp-saml2.spec | 70 |
3 files changed, 118 insertions, 27 deletions
diff --git a/composer.json b/composer.json index 26461cd..6a386db 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "simplesamlphp/saml2", "description": "SAML2 PHP library from SimpleSAMLphp", - "license": "LGPL-2.1", + "license": "LGPL-2.1-or-later", "authors": [ { "name": "Andreas Åkre Solberg", diff --git a/php-simplesamlphp-saml2-get-source.sh b/php-simplesamlphp-saml2-get-source.sh new file mode 100755 index 0000000..b2ac62b --- /dev/null +++ b/php-simplesamlphp-saml2-get-source.sh @@ -0,0 +1,73 @@ +#/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 + 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-simplesamlphp-saml2.spec b/php-simplesamlphp-saml2.spec index cee1b8f..d598887 100644 --- a/php-simplesamlphp-saml2.spec +++ b/php-simplesamlphp-saml2.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-simplesamlphp-saml2 # -# Copyright (c) 2016 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2016-2018 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner simplesamlphp %global github_name saml2 -%global github_version 2.3.4 -%global github_commit 967edad97f38578f9b4561d6f624c974dd2c14a9 +%global github_version 2.3.8 +%global github_commit 5d69753a61b4bfb95eed3ea0c3f8cbb4e6e0ad2f %global composer_vendor simplesamlphp %global composer_project saml2 @@ -38,35 +38,44 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 5%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: SAML2 PHP library from SimpleSAMLphp Group: Development/Libraries -License: LGPLv2 +License: LGPLv2+ 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-simplesamlphp-saml2-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(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} -BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} +%if 0%{?fedora} >= 27 +BuildRequires: (php-composer(psr/log) >= %{psr_log_min_ver} with php-composer(psr/log) < %{psr_log_max_ver}) +BuildRequires: (php-composer(robrichards/xmlseclibs) >= %{robrichards_xmlseclibs_min_ver} with php-composer(robrichards/xmlseclibs) < %{robrichards_xmlseclibs_max_ver}) +BuildRequires: (php-composer(mockery/mockery) >= %{mockery_min_ver} with php-composer(mockery/mockery) < %{mockery_max_ver}) +%else +BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} +BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} BuildRequires: php-composer(robrichards/xmlseclibs) < %{robrichards_xmlseclibs_max_ver} BuildRequires: php-composer(robrichards/xmlseclibs) >= %{robrichards_xmlseclibs_min_ver} BuildRequires: php-dom BuildRequires: php-openssl -%if 0 -BuildRequires: php-composer(mockery/mockery) >= %{mockery_min_ver} -BuildRequires: php-composer(mockery/mockery) < %{mockery_max_ver} +BuildRequires: php-composer(mockery/mockery) < %{mockery_max_ver} +BuildRequires: php-composer(mockery/mockery) >= %{mockery_min_ver} %endif -## phpcompatinfo (computed from version 2.3.4) +## phpcompatinfo (computed from version 2.3.8) BuildRequires: php-date BuildRequires: php-libxml BuildRequires: php-mcrypt BuildRequires: php-pcre +BuildRequires: php-soap BuildRequires: php-spl BuildRequires: php-zlib ## Autoloader @@ -74,17 +83,23 @@ BuildRequires: php-composer(fedora/autoloader) %endif # composer.json -Requires: php(language) >= %{php_min_ver} -Requires: php-composer(psr/log) < %{psr_log_max_ver} -Requires: php-composer(psr/log) >= %{psr_log_min_ver} -Requires: php-composer(robrichards/xmlseclibs) < %{robrichards_xmlseclibs_max_ver} -Requires: php-composer(robrichards/xmlseclibs) >= %{robrichards_xmlseclibs_min_ver} +Requires: php(language) >= %{php_min_ver} Requires: php-dom Requires: php-openssl -# phpcompatinfo (computed from version 2.3.4) +%if 0%{?fedora} >= 27 +Requires: (php-composer(psr/log) >= %{psr_log_min_ver} with php-composer(psr/log) < %{psr_log_max_ver}) +Requires: (php-composer(robrichards/xmlseclibs) >= %{robrichards_xmlseclibs_min_ver} with php-composer(robrichards/xmlseclibs) < %{robrichards_xmlseclibs_max_ver}) +%else +Requires: php-composer(psr/log) < %{psr_log_max_ver} +Requires: php-composer(psr/log) >= %{psr_log_min_ver} +Requires: php-composer(robrichards/xmlseclibs) < %{robrichards_xmlseclibs_max_ver} +Requires: php-composer(robrichards/xmlseclibs) >= %{robrichards_xmlseclibs_min_ver} +%endif +# phpcompatinfo (computed from version 2.3.8) Requires: php-date Requires: php-libxml Requires: php-pcre +Requires: php-soap Requires: php-spl Requires: php-zlib # Autoloader @@ -146,20 +161,17 @@ cat <<'AUTOLOAD' | tee vendor/autoload.php <?php require '%{buildroot}%{phpdir}/SAML2/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('SAML2\\', dirname(__DIR__).'/tests/SAML2'); -%if 1 require_once '%{phpdir}/Mockery/autoload.php'; -%endif AUTOLOAD -%if 0 -: Remove tests requiring Mockery -grep -r --files-with-matches Mockery tests | xargs rm -f -%endif +: Skip test known to fail +sed 's/function testToString/function SKIP_testToString/' \ + -i tests/SAML2/XML/saml/NameIDTest.php : Upstream tests RETURN_CODE=0 PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do +for PHP_EXEC in "" %{?rhel:php54 php55 php56} php70 php71 php72; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --configuration=tools/phpunit \ || RETURN_CODE=1 @@ -180,6 +192,12 @@ exit $RETURN_CODE %changelog +* Sat Mar 10 2018 Shawn Iwinski <shawn@iwin.ski> - 2.3.8-1 +- Update to 2.3.8 (RHBZ #1534984, SSPSA 201801-01, CVE-2018-6519, SSPSA 201802-01, CVE-2018-7644, SSPSA 201803-01, CVE-2018-7711) +- License changed from LGPLv2 to LGPLv2+ +- Add "get source" script since upstream excludes tests from export +- Use range dependencies on F27+ + * Sat Sep 23 2017 Shawn Iwinski <shawn@iwin.ski> - 2.3.4-5 - Test with SCLs if available - Add max version constraint to mockery/mockery BuildRequires |