Accepting request 1120760 from home:michals

- Use sysuser-tools package instead of creating the group (bsc#1216613)

  - Fix segfault on servicelog_open() failure

OBS-URL: https://build.opensuse.org/request/show/1120760
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libservicelog?expand=0&rev=43
This commit is contained in:
Michal Suchanek 2023-10-27 09:08:12 +00:00 committed by Git OBS Bridge
parent e3c7b362cf
commit 98db5359fe
3 changed files with 47 additions and 18 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Oct 26 15:11:01 UTC 2023 - Michal Suchanek <msuchanek@suse.com>
- Use sysuser-tools package instead of creating the group (bsc#1216613)
-------------------------------------------------------------------
Thu Jul 15 18:57:56 UTC 2021 - Jan Engelhardt <jengelh@inai.de>
@ -9,7 +14,7 @@ Thu Jul 15 18:57:56 UTC 2021 - Jan Engelhardt <jengelh@inai.de>
Thu Jul 15 15:54:56 UTC 2021 - Michal Suchanek <msuchanek@suse.com>
- Update to version 1.1.19 (jsc#SLE-18189)
- Fix segfault on servicelog_open() failure
- Fix segfault on servicelog_open() failure
- New project location
-------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
#
# spec file for package libservicelog
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,28 +16,37 @@
#
Name: libservicelog
%define lname libservicelog-1_1-1
%if 0%{?suse_version} < 1500
%global system_user_pkg 0
%else
%global system_user_pkg 1
%endif
Name: libservicelog
Version: 1.1.19
Release: 0
Summary: Servicelog Database and Library
License: LGPL-2.0-or-later
Group: Development/Libraries/C and C++
URL: https://github.com/power-ras/libservicelog/
#Git-Clone: https://github.com/power-ras/libservicelog.git
#Git-Web: https://github.com/power-ras/libservicelog/
Source0: https://github.com/power-ras/libservicelog/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: baselibs.conf
Source2: libservicelog-rpmlintrc
Requires(pre): %{_sbindir}/groupadd
Source3: system-group-service.conf
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: librtas-devel
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: pkgconfig
BuildRequires: sqlite3-devel
ExclusiveArch: ppc ppc64 ppc64le
%if %{system_user_pkg}
Requires(pre): sysuser-tools
%else
Requires(pre): %{_sbindir}/groupadd
%endif
%description
The libservicelog package contains a library to create and maintain a
@ -46,12 +55,12 @@ allows for the logging of serviceable and informational events, and for
the logging of service procedures that have been performed upon the
system.
%package -n %lname
%package -n %{lname}
Summary: Servicelog Database and Library
Group: System/Libraries
Requires: %name
Requires: %{name}
%description -n %lname
%description -n %{lname}
The libservicelog package contains a library to create and maintain a
database for storing events related to system service. This database
allows for the logging of serviceable and informational events, and for
@ -61,7 +70,7 @@ system.
%package devel
Summary: Development files for libservicelog
Group: Development/Libraries/C and C++
Requires: %lname = %version
Requires: %{lname} = %{version}
Requires: glibc-devel
Requires: sqlite3-devel
@ -75,24 +84,36 @@ Header files for building with libservicelog.
autoreconf -fiv
%configure --disable-static
make %{?_smp_mflags}
%if %{system_user_pkg}
%sysusers_generate_pre %{SOURCE3} libservicelog system-group-service.conf
%else
cat > libservicelog.pre <<EOF
getent group service >/dev/null || %{_sbindir}/groupadd -r service
EOF
%endif
%install
%make_install
rm -f %{buildroot}/%{_libdir}/*.la
find %{buildroot} -type f -name "*.la" -delete -print
%if %{system_user_pkg}
install -m 0644 -D -t %{buildroot}%{_sysusersdir}/ %{SOURCE3}
%endif
%pre
getent group service >/dev/null || %{_sbindir}/groupadd -r service
%pre -f libservicelog.pre
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files
%license COPYING
%doc AUTHORS
%attr( 754, root, service ) %dir /var/lib/servicelog
%attr( 644, root, service ) /var/lib/servicelog/servicelog.db
%attr( 754, root, service ) %dir %{_localstatedir}/lib/servicelog
%attr( 644, root, service ) %{_localstatedir}/lib/servicelog/servicelog.db
%if %{system_user_pkg}
%{_sysusersdir}/system-group-service.conf
%endif
%files -n %lname
%files -n %{lname}
%{_libdir}/lib*.so.*
%files devel

View File

@ -0,0 +1,3 @@
# Type Name ID GECOS [HOME]
# Access to certain kernel and userspace facilities
g service - -