4.16.1 install broken while building rpm packages.
Version 4.16.1 installs two files with DESTDIR (%buildroot) path while building rpm packages. The python install script adds the value of %buildroot at some point to catfishconfig.py and org.xfce.Catfish.desktop. ``` + case "${QA_CHECK_RPATHS:-}" in + /usr/lib/rpm/check-buildroot /tmp/jbarrios_rpm_buildroot/catfish-4.16.1-1.x86_64/usr/lib/python3.6/site-packages/catfish_lib/catfishconfig.py:__catfish_data_directory__ = '/tmp/jbarrios_rpm_buildroot/catfish-4.16.1-1.x86_64/usr/share/catfish' /tmp/jbarrios_rpm_buildroot/catfish-4.16.1-1.x86_64/usr/share/applications/org.xfce.Catfish.desktop:Exec=/tmp/jbarrios_rpm_buildroot/catfish-4.16.1-1.x86_64/usr/bin/catfish %f Found '/tmp/jbarrios_rpm_buildroot/catfish-4.16.1-1.x86_64' in installed files; aborting error: Bad exit status from /tmp/jbarrios_rpm_tmppath/rpm-tmp.Esnz3Z (%install) ``` The output states rpmbuild found the value of %buildroot inside catfishconfig.py and org.xfce.Catfish.desktop and therefore exits with error. This does not happen with catfish 4.16.0. Reverting the changes made for pip support to setup.py fixes the issue. ``` diff -Naur catfish-4.16.1.orig/setup.py catfish-4.16.1/setup.py --- catfish-4.16.1.orig/setup.py 2021-07-20 05:04:29.457409600 -0500 +++ catfish-4.16.1/setup.py 2021-07-20 18:35:22.324434725 -0500 @@ -21,7 +21,6 @@ import shutil import sys import subprocess -import site __version__ = '4.16.1' __url__ = 'https://docs.xfce.org/apps/catfish/start' @@ -187,8 +186,6 @@ (self.distribution.get_name(), self.distribution.get_version()))) - using_pip = os.path.basename(os.path.dirname(__file__)).startswith('pip-') - if not self.prefix: self.prefix = '' # pylint: disable=W0201 @@ -199,19 +196,6 @@ data_dir = os.path.join(self.prefix, 'share', 'catfish', '') script_path = os.path.join(self.prefix, 'bin') - - if using_pip: - target_data = os.path.relpath(self.install_data) + os.sep - target_pkgdata = os.path.join(site.getuserbase(), 'share', 'catfish') - target_scripts = os.path.join(site.getuserbase(), 'bin') - - # Use absolute paths - target_data = os.path.realpath(target_data) - target_pkgdata = os.path.realpath(target_pkgdata) - target_scripts = os.path.realpath(target_scripts) - - data_dir = target_pkgdata - script_path = target_scripts else: # --user install self.root = '' # pylint: disable=W0201 ``` To be honest, I think most of the users will install catfish from distribution packages instead of pip. Another workaroud is to leave setup.py as is and manually remove the %buildroot path (in my case '/tmp/jbarrios_rpm_buildroot/catfish-4.16.1-1.al.x86_64') from /usr/lib/python3.6/site-packages/catfish_lib/catfishconfig.py and /usr/share/applications/org.xfce.Catfish.desktop.
issue