From 4899eb0238cc1632e02b568e175c7aef8731f2ee Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 13 May 2025 14:29:38 +0000 Subject: [PATCH] import UBI rootfiles-8.1-34.el9 --- .rootfiles.metadata | 0 SOURCES/rootfiles.conf | 6 ++++++ SPECS/rootfiles.spec | 38 +++++++++++++++++++++++++++++++------- 3 files changed, 37 insertions(+), 7 deletions(-) delete mode 100644 .rootfiles.metadata create mode 100644 SOURCES/rootfiles.conf diff --git a/.rootfiles.metadata b/.rootfiles.metadata deleted file mode 100644 index e69de29..0000000 diff --git a/SOURCES/rootfiles.conf b/SOURCES/rootfiles.conf new file mode 100644 index 0000000..d4da612 --- /dev/null +++ b/SOURCES/rootfiles.conf @@ -0,0 +1,6 @@ +# create initial /root directories shell content +C /root/.bash_logout 644 root root - /usr/share/rootfiles/.bash_logout +C /root/.bash_profile 644 root root - /usr/share/rootfiles/.bash_profile +C /root/.bashrc 644 root root - /usr/share/rootfiles/.bashrc +C /root/.cshrc 644 root root - /usr/share/rootfiles/.cshrc +C /root/.tcshrc 644 root root - /usr/share/rootfiles/.tcshrc diff --git a/SPECS/rootfiles.spec b/SPECS/rootfiles.spec index 47e83a9..fd1b973 100644 --- a/SPECS/rootfiles.spec +++ b/SPECS/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: 34%{?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,43 @@ 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 +#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/ || : -fi + # NOTE: This has been broken by the conversion to tmpfiles. I see only one way to make it + # work: to synthetize a tmpfiles entry for each of these additional files/dirs. That seems like + # a lot of effort to continue supporting a feature for which there's likely not a high demand... + # 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 +* Wed Feb 12 2025 Martin Osvald - 8.1-34 +- Comment out empty if clause to prevent shell error (RHEL-58760) + +* Thu Jan 30 2025 David Tardon - 8.1-33 +- Fix tmpfiles rules (RHEL-58760) + +* 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