diff --git a/libservicelog.changes b/libservicelog.changes index d8f17c1..6ce3a4c 100644 --- a/libservicelog.changes +++ b/libservicelog.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Oct 26 15:11:01 UTC 2023 - Michal Suchanek + +- Use sysuser-tools package instead of creating the group (bsc#1216613) + ------------------------------------------------------------------- Thu Jul 15 18:57:56 UTC 2021 - Jan Engelhardt @@ -9,7 +14,7 @@ Thu Jul 15 18:57:56 UTC 2021 - Jan Engelhardt Thu Jul 15 15:54:56 UTC 2021 - Michal Suchanek - Update to version 1.1.19 (jsc#SLE-18189) - - Fix segfault on servicelog_open() failure + - Fix segfault on servicelog_open() failure - New project location ------------------------------------------------------------------- diff --git a/libservicelog.spec b/libservicelog.spec index 4b927cd..e16e092 100644 --- a/libservicelog.spec +++ b/libservicelog.spec @@ -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 </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 diff --git a/system-group-service.conf b/system-group-service.conf new file mode 100644 index 0000000..9b50f53 --- /dev/null +++ b/system-group-service.conf @@ -0,0 +1,3 @@ +# Type Name ID GECOS [HOME] +# Access to certain kernel and userspace facilities +g service - -