add %{product_family}-rootfiles package that contains the basic .bash* config for root

This commit is contained in:
Yangyang Shen 2021-01-08 09:50:42 +08:00
parent c7c9800991
commit 876d93e834
6 changed files with 87 additions and 7 deletions

2
dot-bash_logout Normal file
View File

@ -0,0 +1,2 @@
# ~/.bash_logout

12
dot-bash_profile Normal file
View File

@ -0,0 +1,12 @@
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH

12
dot-bashrc Normal file
View File

@ -0,0 +1,12 @@
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

7
dot-cshrc Normal file
View File

@ -0,0 +1,7 @@
# .cshrc
# User specific aliases and functions
alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'

10
dot-tcshrc Normal file
View File

@ -0,0 +1,10 @@
# .tcshrc
# User specific aliases and functions
alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'
set prompt='[%n@%m %c]# '

View File

@ -5,7 +5,7 @@
%define dist_release_version 8
%define generic_version 20.03
%define generic_patch_level LTS
%define generic_release 37
%define generic_release 38
%define builtin_release_version 1.0
%define current_arch %{_arch}
@ -27,6 +27,12 @@ Source1: 85-display-manager.preset
Source2: 90-default.preset
Source3: 99-default-disable.preset
Source4: dot-bashrc
Source5: dot-bash_profile
Source6: dot-bash_logout
Source7: dot-tcshrc
Source8: dot-cshrc
BuildRequires: python
Requires: %{product_family}-repos
Obsoletes: yum-utils yum-utils-help yum-utils-plugins
@ -34,14 +40,22 @@ Obsoletes: yum-utils yum-utils-help yum-utils-plugins
%description
%{product_family} release files
%package -n openEuler-performance
%package -n %{product_family}-performance
Requires: coreutils systemd setup
Summary:performance script
%description -n openEuler-performance
Summary: performance script
%description -n %{product_family}-performance
performance script
%package -n %{product_family}-rootfiles
Summary: Basic required files for the root user's account
BuildArch: noarch
Conflicts: rootfiles
%description -n %{product_family}-rootfiles
The rootfiles package contains basic required files that are placed
in the root user's account. These files are basically the same as
those in /etc/skel, which are placed in regular users' home directories.
%prep
%setup -q -n generic-release-%{builtin_release_version}
@ -109,11 +123,23 @@ install -m 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system-preset/
install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/systemd/system-preset/
install -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/systemd/system-preset/
# set root's bash profile
mkdir -p %{buildroot}/root
install -p -m 644 %{SOURCE0} %{buildroot}/root/.bashrc
install -p -m 644 %{SOURCE1} %{buildroot}/root/.bash_profile
install -p -m 644 %{SOURCE2} %{buildroot}/root/.bash_logout
install -p -m 644 %{SOURCE3} %{buildroot}/root/.tcshrc
install -p -m 644 %{SOURCE4} %{buildroot}/root/.cshrc
%posttrans -n %{product_family}-rootfiles
if [ $1 -eq 0 ] ; then
cp -ndr --preserve=ownership,timestamps /etc/skel/. /root/ || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(0644,root,root,0755)
/etc/system-release
@ -131,11 +157,22 @@ rm -rf $RPM_BUILD_ROOT
/var/lib/supportinfo
/usr/share/eula/eula.*
%files -n openEuler-performance
%files -n %{product_family}-performance
%defattr(0644,root,root,0755)
/etc/profile.d/performance.sh
%files -n %{product_family}-rootfiles
%config(noreplace) /root/.bashrc
%config(noreplace) /root/.bash_profile
%config(noreplace) /root/.bash_logout
%config(noreplace) /root/.tcshrc
%config(noreplace) /root/.cshrc
%changelog
* Thu Jan 7 2020 shenyangyang <shenyangyang4@huawei.com> - 1.0-38
- add %{product_family}-rootfiles package that contains the basic
.bash* config for root user
* Mon May 18 2020 shenyangyang <shenyangyang4@huawei.com> - 1.0-37
- add equal sign in color.sh