Issuese packaging tortoisehg in rpm
Created originally on Bitbucket by kiilerix (Mads Kiilerich)
I have packaged tortoisehg in an rpm for Fedora.
TortoiseHg is made to run from a source folder anywhere. When it is packaged as an rpm we know exactly where the files are, but they are not organized like in the source folder.
The following hacks worked around the issues for me. Do you have any ideas what you or I could do to reduce the number of hacks/patches?
Are you aware of other places where path manipulation is used and might require attention?
{{{ #!sh
Don't put hardcoded path in sys.path; the python modules has been installed globally
sed -i 's,~/tools/tortoisehg-dev,/usr/lib/python2.5/site-packages,g' contrib/hgtk contrib/nautilus-thg.py
Don't use THG_ICON_PATH; we know where the icons are and it doesn't
sed -i 's|os.environ.get('''THG_ICON_PATH''', None)|'''/usr/share/pixmaps/tortoisehg/icons'''|g' hggtk/shlib.py
COPYING.txt is not installed under prog_root. It is a data file - but we just use it from docs.
sed -i 's|os.path.join(prog_root, "COPYING.txt")|'''/usr/share/doc/tortoisehg-0.7.3/COPYING.txt'''|g' hggtk/about.py
setup.py installs hgproc in /usr/bin (it should probably be /usr/lib/tortoisehg ...)
sed -i 's|os.path.join(thgpath, '''hgproc.py''')|'''/usr/bin/hgproc.py'''|g' contrib/nautilus-thg.py
We know where the icons are ...
sed -i 's|os.path.join(thgpath, '''icons''', '''tortoise''')|'''/usr/share/pixmaps/tortoisehg/icons'''|g' contrib/nautilus-thg.py }}}