File tpp.spec of Package tpp

#
# spec file for package tpp
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           tpp
Version:        1.3.1
Release:        0
Summary:        A ncurses-based presentation tool
License:        GPL-2.0-only
URL:            http://www.ngolde.de/tpp.html
Source0:        http://www.ngolde.de/download/%{name}-%{version}.tar.gz
Patch0:         hardcoded_keys.patch
Patch1:         15-optional-exec.patch
BuildRequires:  emacs
BuildRequires:  emacs-nox
BuildRequires:  emacs-x11
Requires:       ruby(abi) >= 1.8
Requires:       ruby-ncurses
BuildArch:      noarch

%description
tpp stands for text presentation program and is a ncurses-based presentation
tool. The presentation can be written with your favorite editor in a simple
description format and then shown on any text terminal that is supported by
ncurses - ranging from an old VT100 to the Linux framebuffer to an xterm.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
pushd examples
for tppfile in *.tpp; do
  iconv -f ISO-8859-1 -t UTF-8 -o $tppfile.new $tppfile && \
  touch -r $tppfile $tppfile.new && \
  mv $tppfile.new $tppfile
done
popd

%build
emacs --batch --eval '(byte-compile-file "contrib/tpp-mode.el")'

%install
install -d -m 755 %{buildroot}%{_bindir}
install -p tpp.rb %{buildroot}%{_bindir}/tpp
install -d -m 755 %{buildroot}/%{_datadir}/emacs/site-lisp
install -p -m 644 contrib/tpp-mode* %{buildroot}/%{_datadir}/emacs/site-lisp
install -d -m 755 %{buildroot}%{_datadir}/vim/vimfiles/syntax
install -p -m 644 contrib/tpp.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax
install -d -m 755 %{buildroot}%{_mandir}/man1/
install -p -m 644 doc/tpp.1 %{buildroot}%{_mandir}/man1/tpp.1

%files
%{_bindir}/tpp
%{_mandir}/man1/tpp.1%{?ext_man}

%{_datadir}/emacs/site-lisp/tpp-mode*
%doc DESIGN
%doc CHANGES
%license COPYING
%doc README
%doc THANKS
%doc examples/
%{_datadir}/vim/
%{_datadir}/vim/vimfiles/
%{_datadir}/vim/vimfiles/syntax/tpp.vim

%changelog
openSUSE Build Service is sponsored by