summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drush-issue2065.patch15
-rw-r--r--drush.spec388
2 files changed, 403 insertions, 0 deletions
diff --git a/drush-issue2065.patch b/drush-issue2065.patch
new file mode 100644
index 0000000..de8cebf
--- /dev/null
+++ b/drush-issue2065.patch
@@ -0,0 +1,15 @@
+diff --git a/includes/startup.inc b/includes/startup.inc
+index 693fede..fedccbf 100644
+--- a/includes/startup.inc
++++ b/includes/startup.inc
+@@ -326,8 +326,8 @@ function drush_startup($argv) {
+ }
+ }
+
+- // Always use pcntl_exec if it exists.
+- $use_pcntl_exec = function_exists("pcntl_exec");
++ // https://github.com/drush-ops/drush/issues/2065
++ $use_pcntl_exec = FALSE;
+
+ // If we have posix_getppid, then pass in the shell pid so
+ // that 'site-set' et. al. can work correctly.
diff --git a/drush.spec b/drush.spec
new file mode 100644
index 0000000..af9ae0a
--- /dev/null
+++ b/drush.spec
@@ -0,0 +1,388 @@
+#
+# Fedora spec file for drush
+#
+# Copyright (c) 2015-2017 Shawn Iwinski <shawn@iwin.ski>
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please preserve changelog entries
+#
+
+%global github_owner drush-ops
+%global github_name drush
+%global github_version 8.1.10
+%global github_commit 2192496b80aa9cdb0581a2d308623f950f747e94
+
+%global composer_vendor drush
+%global composer_project drush
+
+# "php": ">=5.4.5"
+%global php_min_ver 5.4.5
+# "consolidation/annotated-command": "~2"
+%global consolidation_annotated_command_min_ver 2
+%global consolidation_annotated_command_max_ver 3
+# "consolidation/output-formatters": "~3"
+%global consolidation_output_formatters_min_ver 3
+%global consolidation_output_formatters_max_ver 4
+# "pear/console_table": "~1.3.0"
+%global pear_console_table_min_ver 1.3.0
+%global pear_console_table_max_ver 2.0
+# "phpdocumentor/reflection-docblock": "^2.0"
+%global phpdocumentor_reflection_docblock_min_ver 2.0
+%global phpdocumentor_reflection_docblock_max_ver 3.0
+# "psr/log": "~1.0"
+# NOTE: Min version not 1.0 because autoloader required
+%global psr_log_min_ver 1.0.1
+%global psr_log_max_ver 2.0
+# "psy/psysh": "~0.6"
+%global psysh_min_ver 0.6
+%global psysh_max_ver 1.0
+# "symfony/console": "~2.7"
+# "symfony/event-dispatcher": "~2.7"
+# "symfony/finder": "~2.7"
+# "symfony/process": "2.7.*"
+# "symfony/var-dumper": "~2.7"
+# "symfony/yaml": "~2.3"
+# NOTE: Min version not 2.7.0 because autoloader required
+%global symfony_min_ver 2.7.1
+%global symfony_max_ver 3.0
+# "webmozart/path-util": "~2"
+%global webmozart_path_util_min_ver 2
+%global webmozart_path_util_max_ver 3
+
+%global drush_dir %{_datadir}/drush
+%global pear_channel pear.drush.org
+%global pear_name drush
+
+%global git_min_ver 1.7
+
+# Build using "--with tests" to enable tests
+# TODO: Figure out test issues and enable by default
+%global with_tests 0%{?_with_tests:1}
+
+%{!?phpdir: %global phpdir %{_datadir}/php}
+
+Name: %{composer_project}
+Version: %{github_version}
+Release: 3%{?github_release}%{?dist}
+Summary: Command line shell and scripting interface for Drupal
+
+Group: Development/Libraries
+License: GPLv2+
+URL: http://www.drush.org/
+Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+
+# error importing function definition for `BASH_FUNC_scl'
+# https://github.com/drush-ops/drush/issues/2065
+Patch0: %{name}-issue2065.patch
+
+BuildArch: noarch
+# %%{pear_phpdir} macro
+BuildRequires: php-pear
+%if %{with_tests}
+BuildRequires: git >= %{git_min_ver}
+BuildRequires: patch
+BuildRequires: php-cli
+# composer.json
+BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(consolidation/annotated-command) < %{consolidation_annotated_command_max_ver}
+BuildRequires: php-composer(consolidation/annotated-command) >= %{consolidation_annotated_command_min_ver}
+BuildRequires: php-composer(consolidation/output-formatters) < %{consolidation_output_formatters_max_ver}
+BuildRequires: php-composer(consolidation/output-formatters) >= %{consolidation_output_formatters_min_ver}
+BuildRequires: php-composer(pear/console_table) < %{pear_console_table_max_ver}
+BuildRequires: php-composer(pear/console_table) >= %{pear_console_table_min_ver}
+BuildRequires: php-composer(phpdocumentor/reflection-docblock) < %{phpdocumentor_reflection_docblock_max_ver}
+BuildRequires: php-composer(phpdocumentor/reflection-docblock) >= %{phpdocumentor_reflection_docblock_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}
+BuildRequires: php-composer(psy/psysh) < %{psysh_min_ver}
+BuildRequires: php-composer(psy/psysh) >= %{psysh_min_ver}
+BuildRequires: php-composer(symfony/console) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver}
+BuildRequires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver}
+BuildRequires: php-composer(symfony/finder) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/finder) >= %{symfony_min_ver}
+BuildRequires: php-composer(symfony/process) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/process) >= %{symfony_min_ver}
+BuildRequires: php-composer(symfony/var-dumper) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/var-dumper) >= %{symfony_min_ver}
+BuildRequires: php-composer(symfony/yaml) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/yaml) >= %{symfony_min_ver}
+BuildRequires: php-composer(webmozart/path-util) < %{webmozart_path_util_max_ver}
+BuildRequires: php-composer(webmozart/path-util) >= %{webmozart_path_util_min_ver}
+# phpcompatinfo (computed from version 8.1.10)
+BuildRequires: php-ctype
+BuildRequires: php-date
+BuildRequires: php-fileinfo
+BuildRequires: php-filter
+BuildRequires: php-hash
+BuildRequires: php-iconv
+BuildRequires: php-json
+BuildRequires: php-pcntl
+BuildRequires: php-pcre
+BuildRequires: php-posix
+BuildRequires: php-reflection
+BuildRequires: php-simplexml
+BuildRequires: php-spl
+## Autoloader
+BuildRequires: php-composer(fedora/autoloader)
+%endif
+
+Requires: git >= %{git_min_ver}
+Requires: patch
+Requires: php-cli
+# composer.json
+Requires: php(language) >= %{php_min_ver}
+Requires: php-composer(consolidation/annotated-command) < %{consolidation_annotated_command_max_ver}
+Requires: php-composer(consolidation/annotated-command) >= %{consolidation_annotated_command_min_ver}
+Requires: php-composer(consolidation/output-formatters) < %{consolidation_output_formatters_max_ver}
+Requires: php-composer(consolidation/output-formatters) >= %{consolidation_output_formatters_min_ver}
+Requires: php-composer(pear/console_table) >= %{pear_console_table_min_ver}
+Requires: php-composer(phpdocumentor/reflection-docblock) < %{phpdocumentor_reflection_docblock_max_ver}
+Requires: php-composer(phpdocumentor/reflection-docblock) >= %{phpdocumentor_reflection_docblock_min_ver}
+Requires: php-composer(phpunit/phpunit)
+Requires: php-composer(psr/log) < %{psr_log_max_ver}
+Requires: php-composer(psr/log) >= %{psr_log_min_ver}
+Requires: php-composer(psy/psysh) < %{psysh_max_ver}
+Requires: php-composer(psy/psysh) >= %{psysh_min_ver}
+Requires: php-composer(symfony/console) < %{symfony_max_ver}
+Requires: php-composer(symfony/console) >= %{symfony_min_ver}
+Requires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver}
+Requires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver}
+Requires: php-composer(symfony/finder) < %{symfony_max_ver}
+Requires: php-composer(symfony/finder) >= %{symfony_min_ver}
+Requires: php-composer(symfony/var-dumper) < %{symfony_max_ver}
+Requires: php-composer(symfony/var-dumper) >= %{symfony_min_ver}
+Requires: php-composer(symfony/yaml) < %{symfony_max_ver}
+Requires: php-composer(symfony/yaml) >= %{symfony_min_ver}
+Requires: php-composer(webmozart/path-util) < %{webmozart_path_util_max_ver}
+Requires: php-composer(webmozart/path-util) >= %{webmozart_path_util_min_ver}
+# phpcompatinfo (computed from version 8.1.10)
+Requires: php-ctype
+Requires: php-date
+Requires: php-fileinfo
+Requires: php-filter
+Requires: php-hash
+Requires: php-iconv
+Requires: php-json
+Requires: php-pcre
+Requires: php-posix
+Requires: php-reflection
+Requires: php-simplexml
+Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
+
+# Weak dependencies
+%if 0%{?fedora} >= 21
+## composer.json: suggest
+#Suggests: php-composer(drush/config-extra)
+Suggests: php-pcntl
+## phpcompatinfo
+Suggests: php-pecl(apcu)
+Suggests: php-pecl(Xdebug)
+Suggests: php-pecl(xhprof)
+%endif
+
+Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
+
+Obsoletes: php-drush-drush < %{version}-%{release}
+Provides: php-drush-drush = %{version}-%{release}
+Obsoletes: drupal6-drush < %{version}-%{release}
+Provides: drupal6-drush = %{version}-%{release}
+Obsoletes: drupal7-drush < %{version}-%{release}
+Provides: drupal7-drush = %{version}-%{release}
+Provides: drupal8-drush = %{version}-%{release}
+Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
+# This pkg was the only one in this channel so the channel is no longer needed
+Obsoletes: php-channel-drush
+
+%description
+Drush is a command line shell and Unix scripting interface for Drupal. If you
+are unfamiliar with shell scripting, reviewing the documentation for your shell
+(e.g. man bash) or reading an online tutorial (e.g. search for "bash tutorial")
+will help you get the most out of Drush.
+
+Drush core ships with lots of useful commands for interacting with code like
+modules/themes/profiles. Similarly, it runs update.php, executes sql queries
+and DB migrations, and misc utilities like run cron or clear cache.
+
+
+%prep
+%setup -qn %{github_name}-%{github_commit}
+
+: Fix "error importing function definition for 'BASH_FUNC_scl'"
+: https://github.com/drush-ops/drush/issues/2065
+%patch0 -p1
+
+: Remove unneeded stuff
+rm -rf drush.bat misc/windrush_build
+
+: W: wrong-file-end-of-line-encoding /usr/share/doc/drush/examples/sandwich.txt
+sed -i 's/\r$//' examples/sandwich.txt
+
+
+%build
+: Create autoloader
+cat <<'AUTOLOAD' | tee autoload.php
+<?php
+/**
+ * Autoloader for %{name} and its' dependencies
+ * (created by %{name}-%{version}-%{release}).
+ */
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('Drush\\', __DIR__.'/lib/Drush');
+
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/Consolidation/AnnotatedCommand/autoload.php',
+ '%{phpdir}/Consolidation/OutputFormatters/autoload.php',
+ [
+ '%{phpdir}/phpDocumentor/Reflection/DocBlock2/autoload.php',
+ '%{phpdir}/phpDocumentor/Reflection/DocBlock/autoload.php',
+ ],
+ '%{phpdir}/Psr/Log/autoload.php',
+ '%{phpdir}/Psy/autoload.php',
+ '%{phpdir}/Symfony/Component/Console/autoload.php',
+ '%{phpdir}/Symfony/Component/EventDispatcher/autoload.php',
+ '%{phpdir}/Symfony/Component/Finder/autoload.php',
+ '%{phpdir}/Symfony/Component/VarDumper/autoload.php',
+ '%{phpdir}/Symfony/Component/Yaml/autoload.php',
+ '%{phpdir}/Webmozart/PathUtil/autoload.php',
+]);
+
+\Fedora\Autoloader\Autoload::addPsr0('Console_', '%{pear_phpdir}');
+AUTOLOAD
+
+: Mock Composer autoloader
+mkdir vendor
+ln -s ../autoload.php vendor/autoload.php
+
+
+%install
+mkdir -p %{buildroot}%{drush_dir}
+cp -pr * %{buildroot}%{drush_dir}/
+
+: Bin
+mkdir -p %{buildroot}%{_bindir}
+ln -s %{drush_dir}/drush %{buildroot}%{_bindir}/drush
+
+: Completion
+mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
+install -pm 0644 drush.complete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/
+
+
+%check
+%if %{with_tests}
+: Create tests bootstrap
+cat <<'AUTOLOAD' | tee tests-autoload.php
+<?php
+require_once '%{buildroot}%{drush_dir}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Unish\\', __DIR__.'/tests');
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/Symfony/Component/Process/autoload.php',
+]);
+AUTOLOAD
+
+: Update bootstrap.inc to use generated bootstrap
+sed 's#vendor/autoload\.php#tests-autoload.php#' -i tests/bootstrap.inc
+
+: Skip specific tests
+pushd tests
+ #rm -f \
+ # pmDownloadTest.php \
+ # siteSshTest.php \
+ # sql*Test.php
+popd
+
+UNISH_DRUSH=%{buildroot}%{drush_dir}/drush \
+ %{_bindir}/phpunit --verbose --configuration tests
+%else
+: Tests skipped
+: Build using "--with tests" to enable tests
+%endif
+
+
+%files
+%{!?_licensedir:%global license %%doc}
+# %%license
+# See https://github.com/drush-ops/drush/pull/319
+%doc *.md
+%doc composer.json
+%doc docs
+%doc examples
+%doc mkdocs.yml
+%{_bindir}/drush
+%{drush_dir}
+%exclude %{drush_dir}/*.md
+%exclude %{drush_dir}/box.json.dist
+%exclude %{drush_dir}/composer.json
+%exclude %{drush_dir}/docs
+%exclude %{drush_dir}/drush.complete.sh
+%exclude %{drush_dir}/examples
+%exclude %{drush_dir}/mkdocs.yml
+%exclude %{drush_dir}/tests
+%exclude %{drush_dir}/unish.sh
+%{_sysconfdir}/bash_completion.d/drush.complete.sh
+
+
+%changelog
+* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.1.10-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Tue Mar 28 2017 Shawn Iwinski <shawn@iwin.ski> - 8.1.10-2
+- Add max versions to BuildRequires
+- Prepare for php-phpdocumentor-reflection-docblock =>
+ php-phpdocumentor-reflection-docblock2 dependency rename
+
+* Tue Feb 28 2017 Shawn Iwinski <shawn@iwin.ski> - 8.1.10-1
+- Update to 8.1.10 (RHBZ #1426457)
+
+* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.1.9-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Sun Jan 15 2017 Shawn Iwinski <shawn@iwin.ski> - 8.1.9-1
+- Update to 8.1.9 (RHBZ #1413321)
+
+* Tue Dec 20 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.8-3
+- Add missing php-composer(fedora/autoloader) dependency (RHBZ #1406416)
+
+* Sat Dec 03 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.8-2
+- Fix autoloader
+
+* Sat Dec 03 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.8-1
+- Update to 8.1.8 (RHBZ #1400079)
+- Switch autoloader from php-composer(symfony/class-loader) to
+ php-composer(fedora/autoloader)
+
+* Wed Nov 02 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.7-2
+- Remove %%{_sysconfdir}/bash_completion.d directory ownership (RHBZ #1375595)
+- Add php-cli build dependency
+
+* Tue Nov 01 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.7-1
+- Update to 8.1.7 (RHBZ #1388273)
+
+* Fri Aug 19 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.3-3
+- Add patch to fix "error importing function definition for `BASH_FUNC_scl'"
+
+* Wed Aug 10 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.3-2
+- Increase "consolidation/annotated-command" max version
+
+* Tue Aug 09 2016 Shawn Iwinski <shawn@iwin.ski> - 8.1.3-1
+- Update to 8.1.3 (RHBZ #1357097)
+
+* Mon Jun 27 2016 Shawn Iwinski <shawn@iwin.ski> - 6.7.0-3
+- EPEL6 requires "php-pear-Console-Table" instead of "php-composer(pear/console_table)"
+
+* Sat Jun 18 2016 Shawn Iwinski <shawn@iwin.ski> - 6.7.0-2
+- Add missing "php-composer(pear/console_table)" dependency (RHBZ #1347826)
+
+* Fri May 06 2016 Shawn Iwinski <shawn@iwin.ski> - 6.7.0-1
+- Update to 6.7.0
+
+* Sun Jul 19 2015 Shawn Iwinski <shawn@iwin.ski> - 6.6.0-1
+- Initial package obsoleting php-drush-drush