fix units compatibility with Image Mode
Resolves: RHEL-106022
This commit is contained in:
parent
671bf23b6e
commit
c56f2c7018
31
units.spec
31
units.spec
@ -1,11 +1,13 @@
|
||||
Summary: A utility for converting amounts from one unit to another
|
||||
Name: units
|
||||
Version: 2.22
|
||||
Release: 10%{?dist}
|
||||
Release: 11%{?dist}
|
||||
Source: https://ftp.gnu.org/gnu/units/%{name}-%{version}.tar.gz
|
||||
Source1: units.tmpfiles.conf
|
||||
URL: https://www.gnu.org/software/units/units.html
|
||||
License: GPL-3.0-or-later
|
||||
BuildRequires: bison
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
BuildRequires: ncurses-devel
|
||||
@ -32,14 +34,32 @@ well as conversions such as Fahrenheit to Celsius.
|
||||
%install
|
||||
%make_install
|
||||
|
||||
# replace an absolute symlink by a relative symlink
|
||||
ln -fsv ../../..%{_sharedstatedir}/units/currency.units %{buildroot}%{_datadir}/units
|
||||
# Copy dynamic files to defaults directory as templates for tmpfiles.d
|
||||
mkdir -p %{buildroot}%{_datadir}/units/defaults
|
||||
cp -p %{buildroot}%{_sharedstatedir}/units/currency.units %{buildroot}%{_datadir}/units/defaults/
|
||||
|
||||
# Remove /var/lib/units from buildroot - now managed by tmpfiles.d
|
||||
rm -rf %{buildroot}%{_sharedstatedir}/units
|
||||
|
||||
# Replace absolute symlinks by relative symlinks
|
||||
ln -fsv ../../../var/lib/units/currency.units %{buildroot}%{_datadir}/units/currency.units
|
||||
|
||||
# Install tmpfiles.d configuration for Image Mode support
|
||||
install -m0644 -D %{SOURCE1} %{buildroot}%{_tmpfilesdir}/units.conf
|
||||
|
||||
gzip %{buildroot}%{_infodir}/units.info
|
||||
|
||||
# provide a man page for units_cur as a symlink to units.1
|
||||
ln -s units.1 %{buildroot}%{_mandir}/man1/units_cur.1
|
||||
|
||||
%post
|
||||
%tmpfiles_create units.conf
|
||||
|
||||
%postun
|
||||
if [ $1 -eq 0 ]; then
|
||||
systemd-tmpfiles --purge %{_tmpfilesdir}/units.conf 2>/dev/null || :
|
||||
fi
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
@ -48,11 +68,14 @@ make check
|
||||
%{_bindir}/units
|
||||
%{_bindir}/units_cur
|
||||
%{_datadir}/units
|
||||
%{_sharedstatedir}/units
|
||||
%{_tmpfilesdir}/units.conf
|
||||
%{_infodir}/*
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%changelog
|
||||
* Tue Apr 21 2026 Jan Macku <jamacku@redhat.com> - 2.27-2
|
||||
- fix units compatibility with Image Mode
|
||||
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.22-10
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
2
units.tmpfiles.conf
Normal file
2
units.tmpfiles.conf
Normal file
@ -0,0 +1,2 @@
|
||||
d /var/lib/units 0755 root root - -
|
||||
C /var/lib/units/currency.units 0644 root root - /usr/share/units/defaults/currency.units
|
||||
Loading…
Reference in New Issue
Block a user