Blob Blame Raw
Name:               key-mon
Version:            1.16
Release:            13%{?dist}
Summary:            A screen cast utility that displays your keyboard and mouse status
License:            ASL 2.0
URL:                http://code.google.com/p/key-mon/
Source0:            https://pypi.python.org/packages/source/k/key-mon/key-mon-%{version}.zip
BuildArch:          noarch
BuildRequires:      python2-devel
BuildRequires:      desktop-file-utils
Requires:           pygtk2
Requires:           python2-xlib
Requires:           librsvg2

%description
Key-mon is useful for teaching since it shows the current status of your
keyboard and mouse and you use them in another application.  No longer do
you need to say 'Now I'm pressing the Ctrl-D key', your students can just
see the keystroke for themselves.

%prep
%setup -q
rm src/keymon/themes/clear/config~

#remove hashbang python line from library python files
for lib in src/keymon/*.py; do
 sed '1{\@^#!/usr/bin/python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done

#make key-mon explicitly call python2
#sed '1d' src/key-mon > src/key-mon.bak
#echo "#!%{__python2}" > src/key-mon
#cat src/key-mon.bak >> src/key-mon
#rm src/key-mon.bak

%build
%{__python2} setup.py build

%install
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications icons/%{name}.desktop
#manually install the manpage
install -d -m 0755 %{buildroot}%{_mandir}/man1
install -m 0644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

# 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 Chris Roberts <croberts@croberts.org -->
<!--
BugReportURL: https://code.google.com/p/key-mon/issues/detail?id=135
SentUpstream: 2014-09-17
-->
<application>
  <id type="desktop">key-mon.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <summary>Show live keyboard and mouse status for teaching and screencasts</summary>
  <description>
    <p>
      Key-mon is a Utility to show live keyboard and mouse status for teaching and screencasts.
      This tool will show the keyboard when doing a screen recording including:
      different key combinations, mouse wheel scrolling, support for 3 button mice,
      and touch tablet support.
    </p>
  </description>
  <url type="homepage">http://code.google.com/p/key-mon/</url>
  <screenshots>
    <screenshot type="default">http://key-mon.googlecode.com/hg/docs/2x-no-mouse-meta.png</screenshot>
  <!--<screenshot type="default">http://projectname/screenshot.png</screenshot>-->
  <!--<screenshot type="default">http://projectname/screenshot.png</screenshot>-->
  </screenshots>
</application>
EOF

%files
%{_mandir}/man1/%{name}.1*
%doc README.rst COPYING
%{_bindir}/%{name}
%{_datadir}/pixmaps/%{name}.xpm
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{python2_sitelib}/keymon/
%{python2_sitelib}/key_mon-%{version}*

%changelog
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

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

* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.16-10
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

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

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

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

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

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

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

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

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

* Fri Dec 06 2013  Ryan Lerch <ryanlerch@fedoraproject.org> 1.16-1
- initial package for Fedora