File insserv-compat.spec of Package insserv-compat

#
# spec file for package insserv-compat
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
# icecream 0


Name:           insserv-compat
Summary:        Simple insserv replacement for systemd only systems
License:        MIT
Group:          System/Base
Version:        0.1
Release:        0
URL:            https://build.opensuse.org/package/show/home%3Aarachnos/%{name}
Source:         insserv.pl
Source1:        init-functions
Source2:        insserv.conf
Source3:        rc.splash
Source4:        rc.status
Source5:        chkconfig
Source6:        chkconfig.8
Source7:        %{name}-rpmlintrc-leap15
Source8:        %{name}-rpmlintrc-tw
Source9:        %{name}.changes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Obsoletes:      insserv <= 1.16.0
Provides:       insserv = 1.16.1-1
Requires:       perl(Getopt::Long)
Requires:       sysvinit-tools

%description
insserv is used enable System V init scripts. This package only
contains a stub implemenation for use on systemd only systems.

%prep
%setup -q -c -T
%if 0%{?suse_version} >= 1550
cp -p %{SOURCE8} %{_sourcedir}/%{name}-rpmlintrc
%else
cp -p %{SOURCE7} %{_sourcedir}/%{name}-rpmlintrc
%endif

%build
pod2man -s 8 -c 'The openSUSE boot concept' -r "" -u %SOURCE0 insserv.8

%install
for i in /sbin %{_bindir} %{_sbindir} /usr/lib/lsb /lib/lsb %{_mandir}/man8 %{_sysconfdir}; do
	install -d -m 755 %{buildroot}$i
done
install -m755 %{SOURCE0} %{buildroot}%{_sbindir}/insserv
install -m755 %{SOURCE1} %{buildroot}%{?usrmerged:/usr}/lib/lsb/init-functions
%if 0%{?suse_version} < 1550
install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/insserv.conf
%endif
%if 0%{?suse_version} >= 1550
install -m755 %{SOURCE3} %{buildroot}%{_sysconfdir}/
install -m755 %{SOURCE4} %{buildroot}%{_sysconfdir}/
install -m755 %{SOURCE5} %{buildroot}%{_bindir}/
install -m644 %{SOURCE6} %{buildroot}%{_mandir}/man8
%endif
install -m644 insserv.8 %{buildroot}%{_mandir}/man8
%if !0%{?usrmerged}
ln -s ../usr/sbin/insserv  %{buildroot}/sbin/insserv
%endif
%if 0%{?suse_version} >= 1550
ln -s ..%{!?usrmerged:/usr}/bin/chkconfig %{buildroot}%{?usrmerged:/usr}/sbin/chkconfig
%endif
ln -s ../../sbin/insserv  %{buildroot}/usr/lib/lsb/install_initd
ln -s ../../sbin/insserv  %{buildroot}/usr/lib/lsb/remove_initd
mkdir -p %{buildroot}/etc/init.d/{boot.d,rc0.d,rc1.d,rc2.d,rc3.d,rc4.d,rc5.d,rc6.d,rcS.d}
ln -s init.d %{buildroot}/etc/rc.d

%if 0%{?suse_version} < 1550
%clean
rm -rf %{buildroot}
%endif

%files
%defattr(-,root,root)
%if 0%{?suse_version} < 1550
%config %{_sysconfdir}/insserv.conf
%endif
%dir %attr(0755,root,root) /etc/init.d
%dir %attr(0755,root,root) /etc/init.d/boot.d
%dir %attr(0755,root,root) /etc/init.d/rc0.d
%dir %attr(0755,root,root) /etc/init.d/rc1.d
%dir %attr(0755,root,root) /etc/init.d/rc2.d
%dir %attr(0755,root,root) /etc/init.d/rc3.d
%dir %attr(0755,root,root) /etc/init.d/rc4.d
%dir %attr(0755,root,root) /etc/init.d/rc5.d
%dir %attr(0755,root,root) /etc/init.d/rc6.d
%dir %attr(0755,root,root) /etc/init.d/rcS.d
%if 0%{?suse_version} >= 1550
%config /etc/rc.splash
%config /etc/rc.status
%endif
/etc/rc.d
%if 0%{?suse_version} >= 1550
%{_bindir}/chkconfig
%endif
%{_sbindir}/insserv
%if 0%{?suse_version} >= 1550
%{?usrmerged:/usr}/sbin/chkconfig
%endif
%if !0%{?usrmerged}
/sbin/insserv
%dir /lib/lsb
%endif
%{?usrmerged:/usr}/lib/lsb/init-functions
%dir /usr/lib/lsb
/usr/lib/lsb/install_initd
/usr/lib/lsb/remove_initd
%if 0%{?suse_version} >= 1550
%{_mandir}/man8/chkconfig.8*
%endif
%{_mandir}/man8/insserv.8*

%changelog
openSUSE Build Service is sponsored by