diff --git a/dotzprofile b/dotzprofile new file mode 100644 index 0000000..9203f7e --- /dev/null +++ b/dotzprofile @@ -0,0 +1,12 @@ +# this file is installed as ~/.zprofile for newly created users + +# prepend ~/.local/bin and ~/bin to $PATH unless it is already there +if ! [[ "$PATH" =~ "$HOME/bin" ]] +then + PATH="$HOME/bin:$PATH" +fi +if ! [[ "$PATH" =~ "$HOME/.local/bin:" ]] +then + PATH="$HOME/.local/bin:$PATH" +fi +export PATH diff --git a/zprofile.rhs b/zprofile.rhs index 03d316f..5e21475 100644 --- a/zprofile.rhs +++ b/zprofile.rhs @@ -2,9 +2,6 @@ # /etc/zprofile and ~/.zprofile are run for login shells # -PATH="$PATH:$HOME/bin" -export PATH - _src_etc_profile() { # Make /etc/profile happier, and have possible ~/.zshenv options like diff --git a/zsh.spec b/zsh.spec index 61f7942..f2abe5b 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 7%{?dist} +Release: 8%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -11,6 +11,7 @@ Source3: zprofile.rhs Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +Source7: dotzprofile # complete file arguments after rpmbuild -r/-b/-t Patch1: 0001-zsh-5.8-comp-rpm.patch @@ -117,6 +118,7 @@ done mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zshrc +install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zprofile # This is just here to shut up rpmlint, and is very annoying. # Note that we can't chmod everything as then rpmlint will complain about @@ -161,6 +163,9 @@ fi %doc Doc/*.html %changelog +* Tue Jan 04 2022 Kamil Dudka - 5.8-8 +- prepend ~/.local/bin and ~/bin to $PATH for newly created users (#1900809) + * Thu Nov 25 2021 Debarshi Ray - 5.8-7 - Overwrite PROMPT only if it's set to the built-in default (#2026749)