summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--Makefile4
-rw-r--r--composer.json75
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-phpseclib3-autoload.php11
-rw-r--r--php-phpseclib3.spec247
6 files changed, 374 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..01f0400
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13af741
--- /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..08b9c7c
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,75 @@
+{
+ "name": "phpseclib/phpseclib",
+ "type": "library",
+ "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
+ "keywords": [
+ "security",
+ "crypto",
+ "cryptography",
+ "encryption",
+ "signature",
+ "signing",
+ "rsa",
+ "aes",
+ "blowfish",
+ "twofish",
+ "ssh",
+ "sftp",
+ "x509",
+ "x.509",
+ "asn1",
+ "asn.1",
+ "BigInteger"
+ ],
+ "homepage": "http://phpseclib.sourceforge.net",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Jim Wigginton",
+ "email": "terrafrost@php.net",
+ "role": "Lead Developer"
+ },
+ {
+ "name": "Patrick Monnerat",
+ "email": "pm@datasphere.ch",
+ "role": "Developer"
+ },
+ {
+ "name": "Andreas Fischer",
+ "email": "bantu@phpbb.com",
+ "role": "Developer"
+ },
+ {
+ "name": "Hans-Jürgen Petrich",
+ "email": "petrich@tronic-media.com",
+ "role": "Developer"
+ },
+ {
+ "name": "Graham Campbell",
+ "email": "graham@alt-three.com",
+ "role": "Developer"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phing/phing": "~2.7",
+ "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
+ "squizlabs/php_codesniffer": "~2.0"
+ },
+ "suggest": {
+ "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
+ "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.",
+ "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
+ "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations."
+ },
+ "autoload": {
+ "files": [
+ "phpseclib/bootstrap.php"
+ ],
+ "psr-4": {
+ "phpseclib\\": "phpseclib/"
+ }
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..4abe187
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/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 '/^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-phpseclib3-autoload.php b/php-phpseclib3-autoload.php
new file mode 100644
index 0000000..93e0f67
--- /dev/null
+++ b/php-phpseclib3-autoload.php
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * Autoloader for phpseclib/phpseclib.
+ */
+require_once "/usr/share/php/Fedora/Autoloader/autoload.php";
+
+// composer.json: "autoload": { "files": [ "phpseclib/bootstrap.php" ], "psr-4": { "phpseclib\\": "phpseclib/" }
+require_once __DIR__ . '/bootstrap.php';
+\Fedora\Autoloader\Autoload::addPsr4('phpseclib\\', __DIR__);
+
diff --git a/php-phpseclib3.spec b/php-phpseclib3.spec
new file mode 100644
index 0000000..715d79d
--- /dev/null
+++ b/php-phpseclib3.spec
@@ -0,0 +1,247 @@
+%global composer_vendor phpseclib
+%global composer_project phpseclib
+
+%global github_owner phpseclib
+%global github_name phpseclib
+%global github_commit 136b9ca7eebef78be14abf90d65c5e57b6bc5d36
+%global github_short %(c=%{github_commit}; echo ${c:0:7})
+%bcond_without tests
+
+Name: php-%{composer_vendor}
+Version: 2.0.30
+Release: 1%{?dist}
+Summary: PHP Secure Communications Library
+License: MIT
+URL: https://github.com/%{github_owner}/%{github_name}
+
+Source0: %{name}-%{version}-%{github_short}.tgz
+Source1: %{name}-autoload.php
+# Generate a full archive from git snapshot, with tests
+Source2: makesrc.sh
+
+# remirepo:3
+# For test build on all available arch
+#global debug_package %%{nil}
+#global __debug_install_post /bin/true
+BuildArch: noarch
+
+%if %{with tests}
+BuildRequires: php-composer(fedora/autoloader)
+%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
+%global phpunit %{_bindir}/phpunit9
+%else
+%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8
+%global phpunit %{_bindir}/phpunit6
+%else
+%global phpunit %{_bindir}/phpunit
+%endif
+%endif
+BuildRequires: %{phpunit}
+BuildRequires: %{_bindir}/phpab
+# Optional at runtime, to avoid too muck skipped tests
+BuildRequires: php-bcmath
+BuildRequires: php-gmp
+%endif
+
+Requires: php(language) >= 5.3.3
+Requires: php-bcmath
+Requires: php-date
+Requires: php-gmp
+Requires: php-hash
+Requires: php-openssl
+Requires: php-pcre
+Requires: php-session
+Requires: php-standard
+Requires: php-xml
+# Autoloader
+Requires: php-composer(fedora/autoloader)
+
+Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
+
+
+%description
+MIT-licensed pure-PHP implementations of an arbitrary-precision integer
+arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4,
+Rijndael, AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509
+
+
+%prep
+%setup -qn %{github_name}-%{github_commit}
+cp %{SOURCE1} %{composer_vendor}/autoload.php
+
+
+%build
+
+
+%install
+mkdir -p %{buildroot}%{_datadir}/php
+cp -pr %{composer_vendor} %{buildroot}%{_datadir}/php
+
+
+%if %{with tests}
+%check
+%{_bindir}/phpab --output tests/bootstrap.php tests
+cat << 'EOF' | tee -a tests/bootstrap.php
+if (class_exists("PHPUnit_Framework_TestCase") && !class_exists("PHPUnit\\Framework\\TestCase")) {
+ class_alias("PHPUnit_Framework_TestCase", "PHPUnit\\Framework\\TestCase");
+}
+require "%{buildroot}%{_datadir}/php/%{composer_vendor}/autoload.php";
+date_default_timezone_set('UTC');
+EOF
+
+# from travis/run-phpunit.sh
+if %{phpunit} --atleast-version 8
+then
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n setUpBeforeClass()/n setUpBeforeClass(): void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n setUp()/n setUp(): void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n tearDown()/n tearDown(): void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertIsArray([^)]*)\)/\1: void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertIsString([^)]*)\)/\1: void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertStringContainsString([^)]*)\)/\1: void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertStringNotContainsString([^)]*)\)/\1: void/g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/^class Unit_Crypt_\(AES\|Hash\|RSA\)_/class /g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/^class Unit_File_\(X509\)_/class /g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/^class Unit_Math_\(BigInteger\)_/class /g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/^class Unit_\(Crypt\|File\|Math\|Net\)_/class /g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/^class Functional_Net_/class /g'
+ find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/extends Unit_Crypt_Hash_\(SHA512Test\|SHA256Test\)/extends \1/g'
+fi
+
+# avoid already defined class
+sed -e '/require /d' -i tests/Unit/Crypt/Hash/SHA*_96Test.php
+
+# testAuthorityInfoAccess fails without internet access
+ret=0
+for cmd in "php %{phpunit}" php73 php74 php80; do
+ if which $cmd; then
+ set $cmd
+ $1 -d memory_limit=1G ${2:-%{_bindir}/phpunit9} \
+ --filter '^((?!(testAuthorityInfoAccess)).)*$' \
+ --verbose || ret=1
+ fi
+done
+exit $ret
+%endif
+
+
+%files
+%{_datadir}/php/%{composer_vendor}
+%doc AUTHORS CHANGELOG.md composer.json README.md
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+
+
+%changelog
+* Thu Dec 17 2020 Remi Collet <remi@remirepo.net> - 2.0.30-1
+- update to 2.0.30
+- switch to phpunit9 on Fedora
+
+* Tue Sep 8 2020 Remi Collet <remi@remirepo.net> - 2.0.29-1
+- update to 2.0.29
+
+* Wed Jul 8 2020 Remi Collet <remi@remirepo.net> - 2.0.28-1
+- update to 2.0.28
+
+* Mon Apr 6 2020 Remi Collet <remi@remirepo.net> - 2.0.27-1
+- update to 2.0.27
+
+* Mon Mar 23 2020 Remi Collet <remi@remirepo.net> - 2.0.26-1
+- update to 2.0.26
+
+* Tue Feb 25 2020 Remi Collet <remi@remirepo.net> - 2.0.25-1
+- update to 2.0.25
+
+* Mon Feb 24 2020 Remi Collet <remi@remirepo.net> - 2.0.24-1
+- update to 2.0.24
+
+* Tue Sep 17 2019 Remi Collet <remi@remirepo.net> - 2.0.23-1
+- update to 2.0.23
+
+* Mon Sep 16 2019 Remi Collet <remi@remirepo.net> - 2.0.22-1
+- update to 2.0.22
+
+* Mon Jul 15 2019 Remi Collet <remi@remirepo.net> - 2.0.21-1
+- update to 2.0.21
+
+* Tue Jun 25 2019 Remi Collet <remi@remirepo.net> - 2.0.20-1
+- update to 2.0.20
+
+* Fri Jun 21 2019 Remi Collet <remi@remirepo.net> - 2.0.19-1
+- update to 2.0.19
+
+* Thu Jun 13 2019 Remi Collet <remi@remirepo.net> - 2.0.18-1
+- update to 2.0.18
+
+* Mon May 27 2019 Remi Collet <remi@remirepo.net> - 2.0.17-1
+- update to 2.0.17
+
+* Mon Mar 11 2019 Remi Collet <remi@remirepo.net> - 2.0.15-1
+- update to 2.0.15
+
+* Thu Jan 31 2019 Remi Collet <remi@remirepo.net> - 2.0.14-1
+- update to 2.0.14
+
+* Tue Dec 18 2018 Remi Collet <remi@remirepo.net> - 2.0.13-1
+- update to 2.0.13
+
+* Mon Nov 5 2018 Remi Collet <remi@remirepo.net> - 2.0.12-1
+- update to 2.0.12
+
+* Mon Apr 16 2018 Remi Collet <remi@remirepo.net> - 2.0.11-1
+- update to 2.0.11
+
+* Tue Feb 20 2018 Remi Collet <remi@remirepo.net> - 2.0.10-2
+- allow to run with old PHPUnit
+
+* Tue Feb 20 2018 Remi Collet <remi@remirepo.net> - 2.0.10-1
+- Update to 2.0.10
+- skip tests with PHPUnit < 4.8.35 (EPEL-6)
+
+* Wed Nov 29 2017 Remi Collet <remi@remirepo.net> - 2.0.9-1
+- Update to 2.0.9
+
+* Mon Oct 23 2017 Remi Collet <remi@remirepo.net> - 2.0.7-1
+- Update to 2.0.7
+
+* Thu Jun 8 2017 Remi Collet <remi@remirepo.net> - 2.0.6-2
+- define correct timezone for the test suite
+
+* Mon Jun 5 2017 Remi Collet <remi@remirepo.net> - 2.0.6-1
+- Update to 2.0.6
+
+* Mon May 8 2017 Remi Collet <remi@remirepo.net> - 2.0.5-1
+- Update to 2.0.5
+- switch to fedora/autoloader
+- use SCL of PHP when available for test suite
+- open https://github.com/phpseclib/phpseclib/issues/1122 - regression with 5.3
+- open https://github.com/phpseclib/phpseclib/pull/1121 - fix permission
+
+* Tue Oct 4 2016 Remi Collet <remi@fedoraproject.org> - 2.0.4-1
+- update to 2.0.4
+
+* Fri Sep 2 2016 Remi Collet <remi@fedoraproject.org> - 2.0.3-1
+- update to 2.0.3
+
+* Tue Jun 7 2016 Remi Collet <remi@fedoraproject.org> - 2.0.2-1
+- update to 2.0.2
+
+* Tue Jan 19 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
+- update to 2.0.1
+- sources from git snapshot for tests
+- run test suite with both PHP 5 and 7 when available
+
+* Sun Sep 6 2015 Remi Collet <remi@fedoraproject.org> - 2.0.0-4
+- change source0 to commit reference
+- add BR for better test coverage
+- add needed backport stuff for EL-5 in #remirepo
+
+* Wed Sep 02 2015 François Kooman <fkooman@tuxed.net> - 2.0.0-3
+- apply patch for test to avoid loading class that is now autoloaded
+
+* Wed Sep 02 2015 François Kooman <fkooman@tuxed.net> - 2.0.0-2
+- add autoload script
+- make use of autoload script when running tests during build
+- fix double inclusion of directory
+
+* Sat Aug 08 2015 François Kooman <fkooman@tuxed.net> - 2.0.0-1
+- initial package