Blob Blame History Raw
Name:           hgview
Version:        1.9.0
Release:        8%{?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:       python2-docutils
Requires:       PyQt4
Requires:       python2-qscintilla

%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:       python2-urwid, python2-pygments, python2-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
%{__python2} setup.py build


%install
%{__python2} 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%{python2_sitelib}/hgext/hgview.py* $RPM_BUILD_ROOT%{python2_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 = %{python2_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

# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <richard@hughsie.com> -->
<!--
BugReportURL: https://www.logilab.org/ticket/265434
SentUpstream: 2014-09-18
-->
<application>
  <id type="desktop">hgview.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <name>HgView</name>
  <summary>Graphical tree viewer for Mecurial repositories</summary>
  <description>
    <p>
     HgView is a tool to visually navigate the tree and history of a Mecurial repository.
     HgView has a wide range of features for browsing and interacting with a Mecurial
     repository graphically, including:
    <ul>
      <li>Key-based navigation of the revisions history of a repository</li>
      <li>Automatic refresh of the revision graph when the repository is modified</li>
      <li>Display of the current working directory as a special node in the graph</li>
    </ul>
    </p>
  </description>
  <url type="homepage">http://www.logilab.org/project/hgview</url>
  <screenshots>
    <screenshot type="default">https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/hgview/a.png</screenshot>
  </screenshots>
  <!-- FIXME: change this to an upstream email address for spec updates
  <updatecontact>someone_who_cares@upstream_project.org</updatecontact>
   -->
</application>
EOF

rm $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/examples/description.css


%files
%{python2_sitelib}/hgviewlib/qt4/
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

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

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


%changelog
* Mon Jul 16 2018 Mads Kiilerich <mads@kiilerich.com> - 1.9.0-8
- Clarify python2 dependency - fix build failure

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Mads Kiilerich <mads@kiilerich.com> - 1.9.0-1
- hgview 1.9.0

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Mar 26 2015 Richard Hughes <rhughes@redhat.com> - 1.8.2-2
- Add an AppData file for the software center

* Sun Aug 31 2014 Mads Kiilerich <mads@kiilerich.com> - 1.8.2-1
- hgview 1.8.2

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri May 23 2014 Mads Kiilerich <mads@kiilerich.com> - 1.8.1-1
- hgview 1.8.1

* Sat Feb 08 2014 Mads Kiilerich <mads@kiilerich.com> - 1.8.0-1
- hgview 1.8.0

* 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