[packages/php-symfony-Console] Initial

arekm arekm at pld-linux.org
Sat Apr 4 00:14:26 CEST 2026


commit 46e785a845aa1702e8b021d4bc520f78b7b8666f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Apr 4 00:14:06 2026 +0200

    Initial

 php-symfony-Console.spec | 120 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
---
diff --git a/php-symfony-Console.spec b/php-symfony-Console.spec
new file mode 100644
index 0000000..c606f46
--- /dev/null
+++ b/php-symfony-Console.spec
@@ -0,0 +1,120 @@
+%define		package	Console
+%define		php_min_version 8.2
+Summary:	Symfony Console Component
+Summary(pl.UTF-8):	Komponent Symfony Console
+Name:		php-symfony-Console
+Version:	7.2.9
+Release:	1
+License:	MIT
+Group:		Development/Languages/PHP
+Source0:	https://github.com/symfony/console/archive/v%{version}/console-%{version}.tar.gz
+# Source0-md5:	76af0ca344159f6c783c3ce8a3969426
+URL:		https://symfony.com/doc/current/components/console.html
+BuildRequires:	%{_bindir}/php
+BuildRequires:	rpmbuild(macros) >= 1.610
+Requires:	php(core) >= %{php_min_version}
+Requires:	php(mbstring)
+Requires:	php(pcre)
+Requires:	php(spl)
+Requires:	php-dirs >= 1.6
+Requires:	php-symfony-ServiceContracts >= 2.5
+Requires:	php-symfony-String >= 6.4
+Obsoletes:	php-symfony2-Console < 3
+Suggests:	php-symfony-EventDispatcher >= 6.4
+Suggests:	php-symfony-Process >= 6.4
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The Console component eases the creation of beautiful and testable
+command line interfaces.
+
+%description -l pl.UTF-8
+Komponent Console ułatwia tworzenie pięknych i testowalnych
+interfejsów linii poleceń.
+
+%prep
+%setup -q -n console-%{version}
+
+%build
+# Generate classmap autoloader (replaces phpab)
+php -r '
+$dir = $argv[1];
+$classes = [];
+$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS));
+foreach ($it as $file) {
+    if ($file->getExtension() !== "php") continue;
+    $path = $file->getPathname();
+    if (str_contains($path, "/Tests/")) continue;
+    $tokens = token_get_all(file_get_contents($path));
+    $ns = "";
+    for ($i = 0; $i < count($tokens); $i++) {
+        if (is_array($tokens[$i]) && $tokens[$i][0] === T_NAMESPACE) {
+            $ns = "";
+            $i++;
+            while (isset($tokens[$i]) && $tokens[$i] !== ";") {
+                if (is_array($tokens[$i])) $ns .= $tokens[$i][1];
+                $i++;
+            }
+            $ns = trim($ns);
+        }
+        if (is_array($tokens[$i]) && in_array($tokens[$i][0], [T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM])) {
+            $i++;
+            while (isset($tokens[$i]) && is_array($tokens[$i]) && $tokens[$i][0] === T_WHITESPACE) $i++;
+            if (isset($tokens[$i]) && is_array($tokens[$i]) && $tokens[$i][0] === T_STRING) {
+                $fqcn = $ns ? $ns . "\\\\" . $tokens[$i][1] : $tokens[$i][1];
+                $relPath = substr($path, strlen($dir) + 1);
+                $classes[$fqcn] = $relPath;
+            }
+        }
+    }
+}
+ksort($classes);
+$code = "<?php\n// @generated by rpm spec\n\$classes = [\n";
+foreach ($classes as $class => $path) {
+    $code .= "\t" . var_export($class, true) . " => __DIR__ . " . var_export("/" . $path, true) . ",\n";
+}
+$code .= "];\nspl_autoload_register(function (\$class) use (\$classes) {\n\tif (isset(\$classes[\$class])) {\n\t\trequire \$classes[\$class];\n\t}\n});\n";
+file_put_contents($dir . "/autoload.php", $code);
+echo count($classes) . " classes mapped\n";
+' .
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{php_data_dir}/Symfony/Component/%{package}
+cp -a *.php */ $RPM_BUILD_ROOT%{php_data_dir}/Symfony/Component/%{package}
+# CI helpers not needed at runtime
+rm -r $RPM_BUILD_ROOT%{php_data_dir}/Symfony/Component/%{package}/CI
+# Windows binary
+rm $RPM_BUILD_ROOT%{php_data_dir}/Symfony/Component/%{package}/Resources/bin/hiddeninput.exe
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG.md LICENSE README.md
+%dir %{php_data_dir}/Symfony/Component/Console
+%{php_data_dir}/Symfony/Component/Console/*.php
+%{php_data_dir}/Symfony/Component/Console/Attribute
+%{php_data_dir}/Symfony/Component/Console/Command
+%{php_data_dir}/Symfony/Component/Console/CommandLoader
+%{php_data_dir}/Symfony/Component/Console/Completion
+%{php_data_dir}/Symfony/Component/Console/DataCollector
+%{php_data_dir}/Symfony/Component/Console/Debug
+%{php_data_dir}/Symfony/Component/Console/DependencyInjection
+%{php_data_dir}/Symfony/Component/Console/Descriptor
+%{php_data_dir}/Symfony/Component/Console/Event
+%{php_data_dir}/Symfony/Component/Console/EventListener
+%{php_data_dir}/Symfony/Component/Console/Exception
+%{php_data_dir}/Symfony/Component/Console/Formatter
+%{php_data_dir}/Symfony/Component/Console/Helper
+%{php_data_dir}/Symfony/Component/Console/Input
+%{php_data_dir}/Symfony/Component/Console/Logger
+%{php_data_dir}/Symfony/Component/Console/Messenger
+%{php_data_dir}/Symfony/Component/Console/Output
+%{php_data_dir}/Symfony/Component/Console/Question
+%{php_data_dir}/Symfony/Component/Console/Resources
+%{php_data_dir}/Symfony/Component/Console/SignalRegistry
+%{php_data_dir}/Symfony/Component/Console/Style
+%{php_data_dir}/Symfony/Component/Console/Tester
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-symfony-Console.git/commitdiff/46e785a845aa1702e8b021d4bc520f78b7b8666f



More information about the pld-cvs-commit mailing list