I have a .spec
file to install a rpm. I have the following snippet in post install (%post scriplet)
%post -n %{package_name}
# Enable the service at boot time
%if %{?suse_version:1}0
/usr/lib/lsb/install_initd %{_initrddir}/%{package_name}
%else
chkconfig --add %{package_name}
%endi
During zypper install package_name
it fails at the post installation phase with the following error:
/var/tmp/rpm-tmp.Z5R29N: line 2: /usr/lib/1sb/install _initd: No such file or directory
warning: %post (package_name.sles15.x86_64) scriptlet failed, exit status 127
I am a novice in .spec files for rpm but this scriplet failed because /usr/lib/lsb/
directory doesn't exists in SLES 15 SP4
My Questions are:
- What is this scriplet exactly doing?
- Where to get this
/lsb/
package from so that I can create this path in SLES 15 SP4? I check that SLES 15 SP4 pre-installed with lsb-xxx package but they are not working here ? - Do I need to do case checks here for sles 15 SP4 inside this scriplet? like:
%if 0%{?sle_version} == 150400 && 0%{?is_opensuse}
// do somthing
%endif