scstadmin.spec: Install unit into %{_unitdir} and package it

Fixes: https://github.com/SCST-project/scst/issues/323
This commit is contained in:
Gleb Chesnokov
2025-11-05 10:57:39 +03:00
parent 6c73cc8d2f
commit 492b6ccbea
2 changed files with 16 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ INITDIR := $(shell if [ -f /etc/slackware-version ]; then \
else \
echo /etc/init.d; \
fi)
SYSTEMD_UNITDIR ?= /lib/systemd/system
ECHO_INSTALL_FN = \
if [ -n "$(DESTDIR)" ]; then \
@@ -112,9 +113,9 @@ install install_vendor:
fi
# Install systemd service file
if [ -d systemd ]; then \
install -d $(DESTDIR)/lib/systemd/system; \
install -d $(DESTDIR)$(SYSTEMD_UNITDIR); \
install -m 644 systemd/scst.service \
$(DESTDIR)/lib/systemd/system/scst.service; \
$(DESTDIR)$(SYSTEMD_UNITDIR)/scst.service; \
fi
for s in iscsi-scst qla2x00t; do \
{ $(call REMOVE_FN,$$s); } >/dev/null 2>&1; \

View File

@@ -17,6 +17,8 @@ Source: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: yes
Requires: psmisc, coreutils
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%description
A tool for configuring SCST via the SCST sysfs interface. Allows to save,
@@ -56,7 +58,7 @@ export PREFIX=%{_prefix} DESTDIR=%{buildroot} MANDIR=%{buildroot}%{_mandir}
%{make}
%install
export PREFIX=%{_prefix} DESTDIR=%{buildroot} MANDIR=%{buildroot}%{_mandir} SBINDIR=%{_sbindir}
export PREFIX=%{_prefix} DESTDIR=%{buildroot} MANDIR=%{buildroot}%{_mandir} SBINDIR=%{_sbindir} SYSTEMD_UNITDIR=%{_unitdir}
%{make} install_vendor
%scstadmin_perl_process_packlist
rm -rf %{buildroot}/var/adm/perl-modules/scst
@@ -71,10 +73,20 @@ rm -f /usr/local/man/man3/SCST::SCST.3pm*
rm -f /usr/local/man/man5/scst.5*
rm -f /usr/local/man/man5/scst.conf.5*
%post
%systemd_post scst.service
%preun
%systemd_preun scst.service
%postun
%systemd_postun scst.service
%files
%defattr(-,root,root,0755)
%config(noreplace) /etc/default/scst
/etc/init.d/scst
%{_unitdir}/scst.service
%{_sbindir}/scstadmin
%{perl_vendorlib}/SCST
%{perl_vendorarch}/auto/SCST_SCST