Accepting request 897451 from home:gmbr3:Active

- Change to using systemd-sysusers

OBS-URL: https://build.opensuse.org/request/show/897451
OBS-URL: https://build.opensuse.org/package/show/Base:System/libstoragemgmt?expand=0&rev=79
This commit is contained in:
Martin Pluskal 2021-06-07 06:36:37 +00:00 committed by Git OBS Bridge
parent b392276ea9
commit 871cc40f67
3 changed files with 16 additions and 9 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jun 4 13:35:57 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Change to using systemd-sysusers
-------------------------------------------------------------------
Tue May 18 16:17:53 UTC 2021 - Michael Vetter <mvetter@suse.com>

View File

@ -33,6 +33,7 @@ License: GPL-2.0-or-later AND LGPL-2.1-or-later
Group: Development/Libraries/C and C++
URL: https://github.com/libstorage/libstoragemgmt
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
Source1: system-user-libstoragemgmt.conf
Patch1: move_to_run.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -45,6 +46,8 @@ BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
BuildRequires: sysuser-tools
%sysusers_requires
%systemd_requires
%if 0%{python3}
BuildRequires: python3-devel
@ -274,6 +277,7 @@ sed -i '/^#!\/usr\/bin/s|env python|python|' ${pyfiles[@]}
head -vn 1 ${pyfiles[@]}
%make_build
%sysusers_generate_pre %{SOURCE1} libstoragemgmt
%install
%make_install
@ -292,6 +296,9 @@ install -m 644 tools/udev/90-scsi-ua.rules \
install -m 755 tools/udev/scan-scsi-target \
%{buildroot}%{_prefix}/lib/udev/scan-scsi-target
mkdir -p %{buildroot}%{_sysusersdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/
# find all duplicates
%fdupes -s %{buildroot}%{python_sitelib}
%fdupes -s %{buildroot}%{python_sitearch}
@ -305,15 +312,7 @@ then
fi
%endif
%pre
if [ $1 -eq 1 ]; then
# New install
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d %{_rundir}/lsm -s /sbin/nologin \
-c "daemon account for libstoragemgmt" %{name}
fi
%pre -f libstoragemgmt.pre
%service_add_pre %{name}.service
%post -n %{libname} -p /sbin/ldconfig
@ -432,6 +431,7 @@ fi
%{_bindir}/simc_lsmplugin
%{_mandir}/man1/simc_lsmplugin.1%{?ext_man}
%{_unitdir}/libstoragemgmt.service
%{_sysusersdir}/system-user-libstoragemgmt.conf
%{_tmpfilesdir}/%{name}.conf
%dir %{_sysconfdir}/lsm
%{_datadir}/bash-completion/completions/lsmcli

View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u libstoragemgmt - "daemon account for libstoragemgmt" /run/lsm -