summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-11-17 17:53:26 +0100
committerRemi Collet <fedora@famillecollet.com>2016-11-17 17:53:26 +0100
commitc6a3406f32bbc80e2e0ad389f5b837fb144cc4d3 (patch)
treed9539b5f44d17e3220af9b1eb51b309f385293c3
parentd51d132fd155657f2d2713624f3a905816d6d11c (diff)
composer: add profile script
-rw-r--r--composer.csh9
-rw-r--r--composer.sh11
-rw-r--r--composer.spec14
3 files changed, 33 insertions, 1 deletions
diff --git a/composer.csh b/composer.csh
new file mode 100644
index 0000000..b57b1d0
--- /dev/null
+++ b/composer.csh
@@ -0,0 +1,9 @@
+# Composer initialization script
+
+# Add path to commands installed using "composer global require ..."
+if ( ${euid} > 0 ) then
+ if ( "${path}" !~ *${HOME}/.composer/vendor/bin* ) then
+ set path = ( $path ${HOME}/.composer/vendor/bin )
+ endif
+endif
+
diff --git a/composer.sh b/composer.sh
new file mode 100644
index 0000000..c75753c
--- /dev/null
+++ b/composer.sh
@@ -0,0 +1,11 @@
+# Composer initialization script
+
+# Add path to commands installed using "composer global require ..."
+if [ "${EUID:-0}" != "0" ]; then
+ case :$PATH: in
+ *:${HOME}/.composer/vendor/bin:*) ;;
+ *) PATH=$PATH:${HOME}/.composer/vendor/bin ;;
+ esac
+ export PATH
+fi
+
diff --git a/composer.spec b/composer.spec
index f5ca51d..7bbe7d6 100644
--- a/composer.spec
+++ b/composer.spec
@@ -17,7 +17,7 @@
Name: composer
Version: 1.2.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Dependency Manager for PHP
Group: Development/Libraries
@@ -26,6 +26,9 @@ URL: https://getcomposer.org/
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{gh_short}.tar.gz
Source1: %{name}-autoload.php
Source2: %{name}-bootstrap.php
+# Profile scripts
+Source3: %{name}.sh
+Source4: %{name}.csh
# Use our autoloader, resources path, fix for tests
Patch0: %{name}-rpm.patch
@@ -186,6 +189,10 @@ if (version_compare(PluginInterface::PLUGIN_API_VERSION, "%{api_version}")) {
%install
rm -rf %{buildroot}
+: Profile scripts
+mkdir -p %{buildroot}%{_sysconfdir}/profile.d
+install -m 644 %{SOURCE3} %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/
+
: Library
mkdir -p %{buildroot}%{_datadir}/php
cp -pr src/* %{buildroot}%{_datadir}/php
@@ -245,12 +252,17 @@ rm -rf %{buildroot}
%license LICENSE
%doc *.md doc
%doc composer.json
+%config(noreplace) %{_sysconfdir}/profile.d/%{name}.*
%{_bindir}/%{name}
%{_datadir}/php/Composer
%{_datadir}/%{name}
%changelog
+* Thu Nov 17 2016 Remi Collet <remi@fedoraproject.org> - 1.2.2-2
+- add profile scripts so globally installed commands
+ will be found in default user path #1394577
+
* Thu Nov 3 2016 Remi Collet <remi@fedoraproject.org> - 1.2.2-1
- update to 1.2.2