Commits

yajo  committed 15f5d22

setup, contrib/tortoisehg.spec: Fix spec: Paths, macros and noarch.

The nautilus extension was not working because its installation folder was
obsolete after the resolution of Fedora's bug #509633 [1]. Fixing this also
means that now the RPM packages generated by tortoisehg.spec build in noarch,
which simplifies their maintenance.

Now the nautilus extension should work out of the box, finally fixing
TortoiseHg's issue #869 [2] and Fedora's bug #730049 [3].

While solving them, I detected more errors in the spec file, but they are
corrected here too. Now this spec should build flawlessly in Fedora 17.

Links:
[1] https://bugzilla.redhat.com/show_bug.cgi?id=509633
[2] https://bitbucket.org/tortoisehg/thg/issue/869/tortoisehg-nautilus-doesnt-work-at-all
[3] https://bugzilla.redhat.com/show_bug.cgi?id=730049

  • Participants
  • Parent commits 9635693

Comments (0)

Files changed (2)

File contrib/tortoisehg.spec

 URL:        http://tortoisehg.org
 Source0:    %{name}-%{version}.tar.gz
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-# This package should be noarch, but we can't do it because the nautilus
-# subpackage has to be arch-specific (because of lib64)
-# BuildArch:    noarch
+BuildArch:  noarch
 BuildRequires:  python, python-devel, gettext, python-sphinx
 BuildRequires:  PyQt4-devel
 Requires:   python >= 2.4, python-iniparse, mercurial >= 1.6
 %prep
 %setup -q
 
-# Fedora Nautilus python extensions lives in lib64 on x86_64 (https://bugzilla.redhat.com/show_bug.cgi?id=509633) ...
-%{__sed} -i "s,lib/nautilus,%{_lib}/nautilus,g" setup.py
-
 cat > tortoisehg/util/config.py << EOT
 bin_path     = "%{_bindir}"
 license_path = "%{_docdir}/%{name}-%{version}/COPYING.txt"
 %doc COPYING.txt doc/build/html/
 %{_bindir}/thg
 %{python_sitelib}/tortoisehg/
-%if "%{?pythonver}" > "2.4"
+%if "%{?python_version}" > "2.4"
 %{python_sitelib}/tortoisehg-*.egg-info
 %endif
 %{_datadir}/pixmaps/tortoisehg/
-%{_datadir}/pixmaps/%{name}_logo.svg
+%{_datadir}/pixmaps/thg_logo.svg
 %{_datadir}/applications/%{name}.desktop
 
 # /usr/share/zsh/site-functions/ is owned by zsh package which we don't want to
 
 %files nautilus
 %defattr(-,root,root,-)
-%{_libdir}/nautilus/extensions-2.0/python/nautilus-thg.py*
+%{_datadir}/nautilus-python/extensions/nautilus-thg.py*
 
 %changelog
     _data_files += [(os.path.join('share', root),
         [os.path.join(root, file_) for file_ in files])
         for root, dirs, files in os.walk('locale')]
-    _data_files += [('lib/nautilus/extensions-2.0/python',
+    _data_files += [('/usr/share/nautilus-python/extensions/',
                      ['contrib/nautilus-thg.py'])]
 
     # Create a config.py.  Distributions will need to supply their own