diff --git a/rootfiles.conf b/rootfiles.conf new file mode 100644 index 0000000..c0ba135 --- /dev/null +++ b/rootfiles.conf @@ -0,0 +1,2 @@ +# create initial /root directories shell content +C+ /root/ 644 root root - /usr/share/rootfiles/ diff --git a/rootfiles.spec b/rootfiles.spec index 47e83a9..aa9cc77 100644 --- a/rootfiles.spec +++ b/rootfiles.spec @@ -1,7 +1,7 @@ Summary: The basic required files for the root user's directory Name: rootfiles Version: 8.1 -Release: 31%{?dist} +Release: 32%{?dist} License: Public Domain # This is a Red Hat maintained package which is specific to @@ -12,8 +12,12 @@ Source1: dot-bash_profile Source2: dot-bash_logout Source3: dot-tcshrc Source4: dot-cshrc +Source5: rootfiles.conf + +%define ROOTFILES_DIR %{_datadir}/rootfiles BuildArch: noarch +BuildRequires: systemd-rpm-macros %description The rootfiles package contains basic required files that are placed @@ -24,23 +28,34 @@ users' home directories. %prep %install -mkdir -p $RPM_BUILD_ROOT/root +mkdir -p $RPM_BUILD_ROOT/%{ROOTFILES_DIR} +install -D -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT/%{_tmpfilesdir}/rootfiles.conf for file in %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} ; do f=`basename $file` - install -p -m 644 $file $RPM_BUILD_ROOT/root/${f/dot-/.} + install -p -m 644 $file $RPM_BUILD_ROOT/%{ROOTFILES_DIR}/${f/dot-/.} done %posttrans if [ $1 -eq 0 ] ; then #copy recursively the content, but do not overwrite the original files provided by rootfiles package - cp -ndr --preserve=ownership,timestamps /etc/skel/. /root/ || : + cp -ndr --preserve=ownership,timestamps /etc/skel/. %{ROOTFILES_DIR}/ || : fi %files -%config(noreplace) /root/.[A-Za-z]* +%dir %{ROOTFILES_DIR} +%{ROOTFILES_DIR}/.[A-Za-z]* +%{_tmpfilesdir}/rootfiles.conf +%ghost /root/.bash_logout +%ghost /root/.bash_profile +%ghost /root/.bashrc +%ghost /root/.cshrc +%ghost /root/.tcshrc %changelog +* Tue Jan 28 2025 David Tardon - 8.1-32 +- Use tmpfiles.d to create initial /root directory (RHEL-58760) + * Tue Aug 10 2021 Mohan Boddu - 8.1-31 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688