From 054a658539eb2910867b76706d8b0059982fe8d0 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Sep 26 2018 20:39:04 +0000 Subject: Add ~/.dotnet/tools to $PATH to make it easier to use dotnet tools --- diff --git a/dotnet.sh b/dotnet.sh new file mode 100644 index 0000000..718d895 --- /dev/null +++ b/dotnet.sh @@ -0,0 +1,7 @@ + +# Add dotnet tools directory to PATH +DOTNET_TOOLS_PATH="$HOME/.dotnet/tools" +case "$PATH" in + *"$DOTNET_TOOLS_PATH"* ) true ;; + * ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;; +esac diff --git a/dotnet.spec b/dotnet.spec index 6fb1dc6..b27a36d 100644 --- a/dotnet.spec +++ b/dotnet.spec @@ -23,7 +23,7 @@ Name: dotnet Version: %{sdk_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: .NET Core CLI tools and runtime License: MIT and ASL 2.0 and BSD URL: https://github.com/dotnet/ @@ -37,6 +37,7 @@ URL: https://github.com/dotnet/ Source0: https://omajid.fedorapeople.org/dotnet/dotnet-%{runtime_version}.tar.gz Source1: check-debug-symbols.py +Source2: dotnet.sh Patch1: corefx-optflags-support.patch @@ -177,6 +178,10 @@ find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.targets' -exec chmod -x {} find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.dll' -exec chmod -x {} \; find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.pubxml' -exec chmod -x {} \; +# Add ~/.dotnet/tools to $PATH for all users +install -dm 0755 %{buildroot}%{_sysconfdir}/profile.d/ +install %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/ + install -dm 755 %{buildroot}/%{_datadir}/bash-completion/completions # dynamic completion needs the file to be named the same as the base command install src/cli/scripts/register-completions.bash %{buildroot}/%{_datadir}/bash-completion/completions/dotnet @@ -211,6 +216,7 @@ echo "Testing build results for debug symbols..." %license %{_libdir}/%{name}/LICENSE.txt %license %{_libdir}/%{name}/ThirdPartyNotices.txt %doc %{_mandir}/man1/dotnet*.1.gz +%{_sysconfdir}/profile.d/dotnet.sh %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/dotnet @@ -228,6 +234,9 @@ echo "Testing build results for debug symbols..." %{_libdir}/%{name}/sdk/%{sdk_version} %changelog +* Wed Sep 26 2018 Omair Majid - 2.1.402-2 +- Add ~/.dotnet/tools to $PATH to make it easier to use dotnet tools + * Thu Sep 13 2018 Omair Majid - 2.1.402-1 - Update to .NET Core Runtime 2.1.4 and SDK 2.1.402