commit fe3f0eedd458bd540c2da4efb3f6d39edba9ddc2b26240f7f5c11790cf3165e7 Author: Adrian Schröter Date: Tue Dec 24 17:22:45 2024 +0100 Sync from SUSE:SLFO:Main libpulp-load-default revision fb2d44a6215a03877a742ea6df0363d3 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/libpulp-load-default.changes b/libpulp-load-default.changes new file mode 100644 index 0000000..c1a6df4 --- /dev/null +++ b/libpulp-load-default.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Fri Mar 31 22:19:28 UTC 2023 - Giuliano Belinassi + +- Initial package. +- Enable libpulp on all processes (jsc#PED-3867). diff --git a/libpulp-load-default.spec b/libpulp-load-default.spec new file mode 100644 index 0000000..8a526aa --- /dev/null +++ b/libpulp-load-default.spec @@ -0,0 +1,76 @@ +# +# spec file for package libpulp-load-default +# +# Copyright (c) 2023 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +Name: libpulp-load-default +Version: 0.1 +Release: 0 +Summary: Enable ULP on all processes +License: MIT +# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines" +BuildRequires: coreutils + +Requires: libpulp0 +Requires: coreutils + +BuildArch: noarch + +%global debug_package %{nil} + +%define ld_so_conf /etc/ld.so.preload +%define addline /usr/lib64/libpulp.so.0 + +%define skip_if_buildenv \ + if test -e /.buildenv; then \ + exit 0; \ + fi; + +%prep + +%description +This package adds libpulp.so into /etc/ld.so.preload to add livepatching capabilities into all processes in the system. + +%build + +%install + +%post + +%{skip_if_buildenv} + +# Create file if doesn't exist. +if [ ! -f "%{ld_so_conf}" ]; then + touch "%{ld_so_conf}" +fi + +# Add instance of libpulp if not already present. +grep -qxF '%{addline}' %{ld_so_conf} || echo '%{addline}' >> %{ld_so_conf} + +%postun + +%{skip_if_buildenv} + +# Delete all instances of libpulp in the ld_so_conf. +sed -i '\#%{addline}#d' %{ld_so_conf} + +# Remove file if it is now empty. +if [ ! -s "%{ld_so_conf}" ]; then + rm -f "%{ld_so_conf}" +fi + +%files + +%changelog