Blob Blame History Raw
Name:           hgview
Version:        1.7.1
Release:        6%{?dist}
Summary:        Mercurial interactive Qt based history viewer

License:        GPLv2+
URL:            http://www.logilab.org/project/hgview
Source0:        http://download.logilab.org/pub/%{name}/%{name}-%{version}.tar.gz
# http://www.logilab.org/ticket/112566
Source1:        %{name}.png
# http://www.logilab.org/ticket/103668
Patch1:         hgview-man-path.patch

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  PyQt4-devel
BuildRequires:  asciidoc
BuildRequires:  xmlto
BuildRequires:  mercurial
BuildRequires:  desktop-file-utils

Requires:       %{name}-common = %{version}-%{release}
Requires:       python-docutils
Requires:       PyQt4
Requires:       qscintilla-python

%description
hgview is a simple tool aiming at visually navigating Mercurial repository
history. It has been written with efficiency in mind, both in terms
of computational efficiency and user experience efficiency.

This main package provides a Qt based GUI. A curses based UI is also available.


%package -n %{name}-curses
Summary:        Mercurial interactive curses based history viewer
Requires:       %{name}-common = %{version}-%{release}
Requires:       python-urwid, python-pygments, python-inotify

%description -n %{name}-curses
hgview is a simple tool aiming at visually navigating Mercurial repository
history. It has been written with efficiency in mind, both in terms
of computational efficiency and user experience efficiency.

This package provides a curses based UI. A Qt based GUI is also available.


%package -n %{name}-common
Summary:        Common files for the hgview Mercurial interactive history viewer
Requires:       mercurial

%description -n %{name}-common
hgview is a simple tool aiming at visually navigating Mercurial repository
history. It has been written with efficiency in mind, both in terms
of computational efficiency and user experience efficiency.

This package provides common files for the Qt and curses based UIs.


%prep
%setup -q
%patch1


%build
%{__python} setup.py build


%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

# Mercurial do not have a noarch hgext directory - storing the extension in
# hgviewlib seems like the least bad option.
mv $RPM_BUILD_ROOT%{python_sitelib}/hgext/hgview.py* $RPM_BUILD_ROOT%{python_sitelib}/hgviewlib/

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/
cat > $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/hgview.rc << EOT
[extensions]
# Enable hgview extension to be able to invoke hgview as 'hg hgview' or 'hg qv'.
#hgview = %{python_sitelib}/hgviewlib/hgview.py

[hgview]
# hgview will by default use the qt interface if available - set interface to
# curses for console mode.
#interface = qt
#interface = curses
EOT

# http://www.logilab.org/ticket/112566
cat > %{name}.desktop << EOT
[Desktop Entry]
Type=Application
Name=hgview
GenericName=Version Control GUI
Comment=GUI application for using Mercurial
Icon=hgview
Exec=hgview -I qt
Categories=Development;RevisionControl;
EOT
desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications %{name}.desktop

install -m 644 -D -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png


%files
%{python_sitelib}/hgviewlib/qt4/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%files -n %{name}-curses
%{python_sitelib}/hgviewlib/curses/

%files -n %{name}-common
%doc COPYING README
%{_mandir}/man1/%{name}.1.*
%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/hgview.rc
%{_bindir}/%{name}
%{python_sitelib}/%{name}-*.egg-info
%dir %{python_sitelib}/hgviewlib/
%{python_sitelib}/hgviewlib/*.py*
%{python_sitelib}/hgviewlib/hgpatches


%changelog
* Sun Sep 01 2013 Mads Kiilerich <mads@kiilerich.com> - 1.7.1-6
- First official Fedora package

* Sat Jun 22 2013 Mads Kiilerich <mads@kiilerich.com> - 1.7.1-5
- Don't assume there is a noarch hgext directory - just use hgviewlib.

* Wed Jun 12 2013 Mads Kiilerich <mads@kiilerich.com> - 1.7.1-4
- Update python dependency to python2-devel
- Preserve timestamp of pixmap png

* Sun Jun 09 2013 Mads Kiilerich <mads@kiilerich.com> - 1.7.1-3
- Move duplicate files to -common package

* Wed Jun 05 2013 Mads Kiilerich <mads@kiilerich.com> - 1.7.1-2
- Relax the requirements to Mercurial version
- Use explicit path to hg extension to make it work on 64 bit

* Sat Mar 09 2013 Mads Kiilerich <mads@kiilerich.com> - 1.7.1-1
- hgview-1.7.1

* Sat Nov 24 2012 Mads Kiilerich <mads@kiilerich.com> - 1.7.0-1
- hgview-1.7.0

* Mon Nov 05 2012 Mads Kiilerich <mads@kiilerich.com> - 1.6.2-2
- claim support for Mercurial 2.4.x

* Sat Aug 25 2012 Mads Kiilerich <mads@kiilerich.com> - 1.6.2-1
- hgview-1.6.2

* Thu Feb 16 2012 Mads Kiilerich <mads@kiilerich.com> - 1.5.0-1
- hgview-1.5.0
- make qt and curses support optional

* Thu Nov 03 2011 Mads Kiilerich <mads@kiilerich.com> - 1.4.0-2
- Update package description
- Update spec to the new curses UI introduced in 1.4.0
- Install Mercurial configuration template, nothing enabled by default
- Drop docs ChangeLog (outdated) and README (no relevant information for package users)
- Don't set python_sitelib and don't clean $RPM_BUILD_ROOT

* Fri Oct 07 2011 Mads Kiilerich <mads@kiilerich.com> - 1.4.0-1
- hgview-1.4.0

* Sat Sep 10 2011 Mads Kiilerich <mads@kiilerich.com> - 1.3.0-2
- Minor tweaks to requirements and use of macros, based on comments from Volker
  Fröhlich

* Thu Sep 08 2011 Mads Kiilerich <mads@kiilerich.com> - 1.3.0-1
- Initial package for Fedora