commit 90b95dabd877f9ead79d973502686df8b37b0bee088d728b40d6453e2156bc78 Author: Adrian Schröter Date: Fri May 3 14:31:42 2024 +0200 Sync from SUSE:SLFO:Main libalternatives revision 7c6bd732492ea09757cf8de285d3ad4c diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/_service b/_service new file mode 100644 index 0000000..671e475 --- /dev/null +++ b/_service @@ -0,0 +1,13 @@ + + + git + https://github.com/openSUSE/libalternatives.git + @PARENT_TAG@+@TAG_OFFSET@.%h + a5431e9 + enable + + + *.tar + zstd + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..877806b --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/openSUSE/libalternatives.git + a5431e9a38d1cb89ed12a2e409713f9c5388713f \ No newline at end of file diff --git a/libalternatives-v1.2+30.a5431e9.tar.zst b/libalternatives-v1.2+30.a5431e9.tar.zst new file mode 100644 index 0000000..ed489eb --- /dev/null +++ b/libalternatives-v1.2+30.a5431e9.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:921ca454f85769de7b14a06d9b0ebc81ecaffc8f29b29f7e3aee7ff35b49aa60 +size 34516 diff --git a/libalternatives.changes b/libalternatives.changes new file mode 100644 index 0000000..15f3080 --- /dev/null +++ b/libalternatives.changes @@ -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 + +- 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 + diff --git a/libalternatives.spec b/libalternatives.spec new file mode 100644 index 0000000..8ea9523 --- /dev/null +++ b/libalternatives.spec @@ -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 < %buildroot/%_bindir/libalternatives-unit-test-helper.sh < /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