Sync from SUSE:SLFO:Main libalternatives revision 7c6bd732492ea09757cf8de285d3ad4c

This commit is contained in:
Adrian Schröter 2024-05-03 14:31:42 +02:00
commit 90b95dabd8
6 changed files with 251 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

13
_service Normal file
View File

@ -0,0 +1,13 @@
<services>
<service name="tar_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/openSUSE/libalternatives.git</param>
<param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@.%h</param>
<param name="revision">a5431e9</param>
<param name="changesgenerate">enable</param>
</service>
<service mode="manual" name="recompress">
<param name="file">*.tar</param>
<param name="compression">zstd</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/openSUSE/libalternatives.git</param>
<param name="changesrevision">a5431e9a38d1cb89ed12a2e409713f9c5388713f</param></service></servicedata>

BIN
libalternatives-v1.2+30.a5431e9.tar.zst (Stored with Git LFS) Normal file

Binary file not shown.

71
libalternatives.changes Normal file
View File

@ -0,0 +1,71 @@
-------------------------------------------------------------------
Tue Apr 25 10:21:11 UTC 2023 - bogdan.lezhepekov@suse.com
- Update to version v1.2+30.a5431e9: (bsc#1191692)
* Change license to less restrictive Apache 2.0
* doc: fixing a few typos
* Adds option to display target executable only
* Makefiles and cmake: rework for reproducible build
* Improve Makefile
* libalts_exec_default: fix memory leak on error condition
* libalts_write_binary_configured_priority_to_file: fix memory leak
* saveConfigData(): fix file descriptor leak in while loop error case
* loadConfigData(): use goto exit label to prevent file descriptor leaks
* libalts_load_available_binaries: use goto err: label to fix leaks
* loadAlternativeForBinary: goto-assisted error handling to avoid leaks
* checkGroupConsistencies(): explicitly ignore unused `flags`
* lib: refactor error handling of findAltConfig()
* utils: fix possible memory leaks on error conditions
* docs: fix some typos and grammar
* Update README.md
* lib: generally open[at] with O_CLOEXEC
* Fix logic in options parser
* Add basic Makefile for buidling without cmake
* Added description for options=KeepArgv0
* cmake: Express the dependency on CUnit correctly for building tests
* cmake: Build and install CMake and PkgConfig files
* cmake: Fix setup of shared linker flags
* config.h: Fix the version to match the current latest tag
-------------------------------------------------------------------
Mon Nov 14 10:26:50 UTC 2022 - dmueller@suse.com
- switch to a manual service rather than a buildtime tar service
which introduces a bootstrap cycle between python and tar_scm
-------------------------------------------------------------------
Tue Sep 14 09:12:40 UTC 2021 - adam.majer@suse.de
- Update to version v1.2+3.b848aad:
* tests: fix array overrun in unit tests
-------------------------------------------------------------------
Tue Sep 14 08:35:43 UTC 2021 - Jan Engelhardt <jengelh@inai.de>
- Use noun phrase for the summary; fix grammar in description.
-------------------------------------------------------------------
Mon Sep 13 21:29:01 UTC 2021 - adam.majer@suse.de
- Update to version v1.2:
* Add config option=KeepArgv0 to keep original argument during
exec() call
-------------------------------------------------------------------
Mon Jun 21 22:00:23 UTC 2021 - adam.majer@suse.de
- Update to version v1.1:
* docs: Add broken manpage
* tests: unit tests configs
* tests: fix memory leak during tests
* list_binaries: initialize pointer that is later used in free
* libalts_exec_default() sets errno on not found
-------------------------------------------------------------------
Wed Jun 09 16:50:09 UTC 2021 - adam.majer@suse.de
- Version v1.0.0:
* Prefix symbols with libalts_ to avoid symbol clashes
* Add symbol visibility and versioning
* Decamelize public symbols and rename

137
libalternatives.spec Normal file
View File

@ -0,0 +1,137 @@
#
# spec file for package libalternatives
#
# 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
# 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/
#
%define sover 1
Name: libalternatives
Version: 1.2+30.a5431e9
Release: 0
Summary: Helper for executing preferred application based on user preferences
License: Apache-2.0
URL: https://github.com/openSUSE/libalternatives
Source0: libalternatives-v%{version}.tar.zst
BuildRequires: cmake > 3.8
BuildRequires: cunit-devel
BuildRequires: gcc
BuildRequires: zstd
%description
libalternatives is a helper that executes an application based on
preferences of a user, system admin or package maintainer, in this
order of preference. This is accomplished with only the help of
config files and without the need to maintain system symlinks states.
%package -n alts
Summary: Helper for executing preferred application based on user preferences
License: Apache-2.0
%description -n alts
This package contains a default helper and configuration application utility
for libalternatives. libalternatives is a helper that executes an application
based on preferences of a user, system admin or package maintainer, in this
order of preference. This is accomplished with only the help of config files
and without the need to maintain system symlinks states.
%package devel
Summary: Development headers for libalternatives
License: Apache-2.0
Requires: libalternatives%sover = %version
%description devel
This package contains development headers and library for libalternatives.
%package -n libalternatives%sover
Summary: Runtime for libalternatives
License: Apache-2.0
%description -n libalternatives%sover
This package contains the core logic and the runtime library for
libalternatives. libalternatives is a helper that executes an application based
on preferences of a user, system admin or package maintainer, in this order of
preference. This is accomplished with only the help of config files and
without the need to maintain system symlinks states.
%package unit-test-helper
Summary: Verification helper for libalternatives
License: Apache-2.0
Requires: alts = %version
BuildArch: noarch
%description unit-test-helper
This is a testing-only installation that may be used to verify that successful
integration with manual pages.
%prep
%autosetup -n libalternatives-v%version
%build
%cmake
%cmake_build
%install
%cmake_install
mkdir -p -m 0755 %buildroot/%_datadir/libalternatives
mkdir -p -m 0755 %buildroot/%_datadir/libalternatives/libalternatives-unit-test-helper
cat > %buildroot/%_datadir/libalternatives/libalternatives-unit-test-helper/10.conf <<EOF
binary=/usr/bin/true
man=true.1
EOF
cat > %buildroot/%_bindir/libalternatives-unit-test-helper.sh <<EOF
#!/bin/bash
(diff <(man libalternatives-unit-test-helper 2> /dev/null) <(man true) >> /dev/null && echo "Everything seems OK && exit")
echo "It seems `man` doesn't display the proper manpage for libalternatives system."
echo "You should see the manpage for true(1) when running"
echo " man libalternatives-unit-test-helper"
exit 1
EOF
chmod 755 %buildroot/%_bindir/libalternatives-unit-test-helper.sh
%check
%ctest
%post -n libalternatives%sover -p /sbin/ldconfig
%postun -n libalternatives%sover -p /sbin/ldconfig
%files -n alts
%license COPYING
%doc README.md
%_bindir/alts
%_mandir/man1/alts.1.*
%files devel
%_includedir/libalternatives.h
%{_libdir}/libalternatives.so
%{_libdir}/cmake/libalternatives
%{_libdir}/pkgconfig/libalternatives.pc
%files -n libalternatives%sover
%dir %_datadir/libalternatives
%{_libdir}/libalternatives.so.%sover
%{_libdir}/libalternatives.so.%sover.*
%files unit-test-helper
%dir %_datadir/libalternatives
%dir %_datadir/libalternatives/libalternatives-unit-test-helper
%_datadir/libalternatives/libalternatives-unit-test-helper/10.conf
%_bindir/libalternatives-unit-test-helper.sh
%changelog