https://bugzilla.redhat.com/show_bug.cgi?id=1893327
--- Comment #11 from Robert-André Mauchin 🐧 zebob.m@gmail.com --- (In reply to code@luigifab.fr from comment #10)
Hi, I work on the next release and I need to do a strange thing during installation.
One of the installed file must be modified depending on Pango package version. For pango >= 1.44, I need to replace bottom="3" by bottom="4".
I did that:
%post currentver=`rpm -q --queryformat="%{RPMTAG_VERSION}" pango` requiredver=1.44 if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then sed -i 's/<border name="title_border" left="2" right="2" top="4" bottom="3"/<border name="title_border" left="2" right="2" top="4" bottom="4"/g' %{_datadir}/themes/human-theme/metacity-1/metacity-theme-1.xml else sed -i 's/<border name="title_border" left="2" right="2" top="4" bottom="4"/<border name="title_border" left="2" right="2" top="4" bottom="3"/g' %{_datadir}/themes/human-theme/metacity-1/metacity-theme-1.xml fi
rpmlint says:
human-theme-gtk.noarch: W: percent-in-%post human-theme-gtk.noarch: W: dangerous-command-in-%post rpm
It is good? Thanks
What happens when Pango is updated after the package is installed? This wouldn't work. Also all Pango on stable Fedora versions are at least 1.44 (https://src.fedoraproject.org/rpms/pango), so I don't know why this change is required? I'd just change metacity-theme-1.xml with a patch.