Name: php-bjeavons-zxcvbn-php Summary: Realistic password strength estimation PHP library based on Zxcvbn JS Version: 1.3.1 Release: 1%{?dist} License: MIT URL: https://github.com/bjeavons/zxcvbn-php # Upstream tarball doesn't include tests #Source0: %%{url}/archive/v%%{version}/zxcvbn-php-%%{version}.tar.gz Source0: zxcvbn-php-%{version}.tar.gz Source1: make_zxcvbn_php_tarball.sh Patch1: zxcvbn-php-1.3.1-Patch_failing_test.patch BuildArch: noarch BuildRequires: php(language) >= 7.2 BuildRequires: php-composer(symfony/polyfill-mbstring) >= 1.3.1 BuildRequires: php-fedora-autoloader-devel # Tests %if 0%{?fedora} BuildRequires: phpunit9 %endif Requires: php(language) >= 7.2 Requires: php-json Requires: php-ctype Requires: php-date Requires: php-intl Requires: php-mbstring Requires: php-pcre Requires: php-spl Requires: php-composer(symfony/polyfill-mbstring) >= 1.3.1 Recommends: php-gmp Provides: php-composer(bjeavons/zxcvbn-php) = %{version} %description Zxcvbn-PHP is a password strength estimator using pattern matching and minimum entropy calculation. Zxcvbn-PHP is based on the the Javascript zxcvbn project from Dropbox and @lowe. "zxcvbn" is bad password, just like "qwerty" and "123456". zxcvbn attempts to give sound password advice through pattern matching and conservative entropy calculations. It finds 10k common passwords, common American names and surnames, common English words, and common patterns like dates, repeats (aaa), sequences (abcd), and QWERTY patterns. %prep %autosetup -n zxcvbn-php-%{version} -p1 %build # Generate autoloader phpab --template fedora --output src/autoload.php src phpab --template fedora --output test-autoload.php test %install # Install install -d -m 0755 %{buildroot}%{_datadir}/php/bjeavons/zxcvbn-php/ cp -a src/* %{buildroot}%{_datadir}/php/bjeavons/zxcvbn-php/ %check %if 0%{?fedora} mkdir -p vendor cat > vendor/autoload.php << EOF EOF phpunit9 \ --verbose \ --do-not-cache-result \ --no-coverage \ --testdox \ test %endif %files %license LICENSE.txt %doc README.md composer.json %{_datadir}/php/bjeavons/zxcvbn-php/ %changelog * Fri Jan 19 2024 Xavier Bachelot - 1.3.1-1 - Initial package