2012-09-07 08:53:00 +02:00
|
|
|
#
|
|
|
|
# spec file for package update-alternatives
|
|
|
|
#
|
2023-05-16 16:23:21 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2012-09-07 08:53:00 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-01-14 16:25:08 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-09-07 08:53:00 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: update-alternatives
|
2024-01-01 03:23:32 +01:00
|
|
|
Version: 1.22.2
|
2012-09-07 08:53:00 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Maintain symbolic links determining default commands
|
2018-06-28 13:05:57 +02:00
|
|
|
License: GPL-2.0-or-later
|
2012-09-07 08:53:00 +02:00
|
|
|
Group: System/Management
|
2022-02-21 12:30:06 +01:00
|
|
|
URL: https://tracker.debian.org/pkg/dpkg/
|
|
|
|
Source0: https://ftp.debian.org/debian/pool/main/d/dpkg/dpkg_%{version}.tar.xz
|
2012-09-07 08:53:00 +02:00
|
|
|
Source3: sensible-editor
|
2015-03-01 12:01:24 +01:00
|
|
|
Patch0: update-alternatives-suse.patch
|
2021-02-03 16:49:49 +01:00
|
|
|
Patch1: update-alternatives-slavetomaster.patch
|
2023-07-20 13:36:36 +02:00
|
|
|
Patch2: openssl.patch
|
2016-09-07 14:46:37 +02:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
|
|
|
BuildRequires: libtool
|
2012-09-07 08:53:00 +02:00
|
|
|
BuildRequires: ncurses-devel
|
2023-07-20 13:36:36 +02:00
|
|
|
BuildRequires: openssl-devel
|
2023-07-20 13:39:28 +02:00
|
|
|
BuildRequires: perl >= 5.28.1
|
2016-09-07 14:46:37 +02:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
Provides: alternatives = %{version}
|
2012-09-07 08:53:00 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
update-alternatives creates, removes, maintains and displays
|
|
|
|
information about the symbolic links comprising the alternatives
|
|
|
|
system. It is possible for several programs fulfilling the same or
|
|
|
|
similar functions to be installed on a single system at the same time.
|
|
|
|
For example, many systems have several text editors installed at once.
|
|
|
|
This gives choice to the users of a system, allowing each to use a
|
|
|
|
different editor, if desired, but makes it difficult for a program to
|
|
|
|
make a good choice of editor to invoke if the user has not specified a
|
|
|
|
particular preference.
|
|
|
|
|
|
|
|
%prep
|
2021-02-03 16:49:49 +01:00
|
|
|
%autosetup -p1 -n dpkg-%{version}
|
2012-09-07 08:53:00 +02:00
|
|
|
|
|
|
|
%build
|
2019-08-02 09:32:33 +02:00
|
|
|
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
2016-09-07 14:46:37 +02:00
|
|
|
autoreconf -fvi
|
2015-04-01 14:58:11 +02:00
|
|
|
%configure \
|
2017-11-20 13:45:54 +01:00
|
|
|
--disable-silent-rules \
|
|
|
|
--with-admindir=%{_localstatedir}/lib
|
2012-09-07 08:53:00 +02:00
|
|
|
|
|
|
|
make -C lib/compat %{?_smp_mflags}
|
|
|
|
make -C utils/ %{?_smp_mflags}
|
2017-03-27 14:39:18 +02:00
|
|
|
make -C man/ %{?_smp_mflags}
|
2012-09-07 08:53:00 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
install -d -m 0755 %{buildroot}/%{_sbindir}/
|
2015-06-05 09:44:43 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_mandir}/man1/
|
2012-09-07 08:53:00 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_sysconfdir}/alternatives
|
2017-11-20 13:45:54 +01:00
|
|
|
install -d -m 0755 %{buildroot}%{_localstatedir}/lib/alternatives
|
2017-11-08 17:27:49 +01:00
|
|
|
install -d -m 0755 %{buildroot}/%{_localstatedir}/log
|
2012-09-07 08:53:00 +02:00
|
|
|
|
2017-11-08 07:57:40 +01:00
|
|
|
install -pm 0755 utils/%{name} %{buildroot}/%{_sbindir}
|
2016-05-13 14:04:06 +02:00
|
|
|
ln -s %{name} %{buildroot}/%{_sbindir}/alternatives
|
2017-11-08 07:57:40 +01:00
|
|
|
install -pm 0644 man/%{name}.1 %{buildroot}/%{_mandir}/man1/
|
2012-09-07 08:53:00 +02:00
|
|
|
|
2019-03-13 11:05:44 +01:00
|
|
|
%post -p <lua>
|
|
|
|
-- Migrate to new location
|
|
|
|
if posix.access('var/lib/rpm/alternatives', 'x') then
|
|
|
|
print("migrating update alternatives database to new location")
|
|
|
|
-- We proceed even if no alternatives directory exists, such situation
|
|
|
|
-- occurs in buildroot environment
|
2019-04-02 23:28:24 +02:00
|
|
|
new_location='%{_localstatedir}/lib/alternatives/'
|
2019-03-13 11:05:44 +01:00
|
|
|
for i,old_file in pairs(posix.dir("var/lib/rpm/alternatives/")) do
|
|
|
|
print(old_file.."\n")
|
|
|
|
new_file = string.gsub(old_file, "(.*/)(.*)", new_location .. "%2")
|
|
|
|
print(new_file.."\n")
|
|
|
|
os.rename(old_file, new_file)
|
|
|
|
end
|
|
|
|
posix.rmdir('var/lib/rpm/alternatives')
|
|
|
|
end
|
|
|
|
-- touch file
|
2019-04-02 23:28:24 +02:00
|
|
|
io.open('%{_localstatedir}/log/alternatives.log', "w"):close()
|
2012-09-07 08:53:00 +02:00
|
|
|
|
|
|
|
%files
|
2019-01-14 16:25:08 +01:00
|
|
|
%license COPYING
|
2012-09-07 08:53:00 +02:00
|
|
|
%dir %{_sysconfdir}/alternatives
|
2017-11-20 13:45:54 +01:00
|
|
|
%dir %{_localstatedir}/lib/alternatives
|
2016-05-13 14:04:06 +02:00
|
|
|
%{_sbindir}/alternatives
|
2012-09-07 08:53:00 +02:00
|
|
|
%{_sbindir}/update-alternatives
|
2017-03-27 14:39:18 +02:00
|
|
|
%{_mandir}/man1/update-alternatives.1%{ext_man}
|
2016-04-06 14:10:40 +02:00
|
|
|
%ghost %{_localstatedir}/log/alternatives.log
|
2012-09-07 08:53:00 +02:00
|
|
|
|
|
|
|
%changelog
|