added pretrans and posttrans scripts to fix upgrade from dir to symlink [release 2.45-2mamba;Sun Jun 15 2025]

This commit is contained in:
2025-06-17 15:05:07 +02:00
parent 5b7e264a1f
commit 43e96004fb

View File

@ -1,6 +1,6 @@
Name: xkeyboard-config
Version: 2.45
Release: 1mamba
Release: 2mamba
Summary: X Keyboard Configuration Database
Group: System/X11
Vendor: openmamba
@ -29,8 +29,6 @@ Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
The non-arch keyboard configuration database for X Window. The goal is to provide the consistent, well-structured, frequently released open source of X keyboard configuration data for X Window System implementations (free, open source and commercial). The project is targeted to XKB-based systems.
This package contains static libraries and header files needed for development.
#% debug_package
%prep
%setup -q
@ -48,10 +46,38 @@ This package contains static libraries and header files needed for development.
%find_lang %{name} --all-name
%pre
# fix upgrade from xkbdata
[ -d %{_datadir}/X11/xkb/symbols/pc ] && \
mv %{_datadir}/X11/xkb/symbols/pc /usr/share/X11/xkb/symbols/pc.rpmsave
%pretrans -p <lua>
-- Define the path to directory being replaced below.
-- DO NOT add a trailing slash at the end.
paths = {"%{_datadir}/X11/xkb"}
for _,path in pairs(paths)
do
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
end
%posttrans
if [ ! -L /lib -a ! -e /lib/firmware ]; then
# make /lib/firmware symlink to /usr/lib/firmware
ln -s ../usr/lib/firmware /lib/firmware
fi
paths="\
%{_datadir}/X11/xkb"
for path in $paths; do
[ -e "${path}.rpmmoved" ] && \
rm -rf "${path}.rpmmoved"
done
:
%clean
@ -73,6 +99,9 @@ This package contains static libraries and header files needed for development.
%doc ChangeLog.md README.md
%changelog
* Sun Jun 15 2025 Silvan Calarco <silvan.calarco@mambasoft.it> 2.45-2mamba
- added pretrans and posttrans scripts to fix upgrade from dir to symlink
* Mon Jun 09 2025 Automatic Build System <autodist@openmamba.org> 2.45-1mamba
- automatic version update by autodist