Files
perl-Text-VimColor/perl-Text-VimColor.spec
2025-08-12 18:18:09 +02:00

134 lines
4.3 KiB
RPMSpec

# vim: set ts=4 sw=4 et:
#
# spec file for package perl-Text-VimColor
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/
#
%define cpan_name Text-VimColor
Name: perl-Text-VimColor
Version: 0.29
Release: 0
%define cpan_name Text-VimColor
Summary: Syntax highlight text using Vim
License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/R/RW/RWSTAUNER/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(File::ShareDir)
BuildRequires: perl(File::ShareDir::Install) >= 0.06
BuildRequires: perl(Path::Class) >= 0.04
BuildRequires: perl(Test::File::ShareDir::Dist)
BuildRequires: perl(Test::More) >= 0.88
Requires: perl(File::ShareDir)
Requires: perl(Path::Class) >= 0.04
Recommends: perl(Term::ANSIColor) >= 3
%{perl_requires}
# MANUAL BEGIN
BuildRequires: vim >= 6
BuildRequires: vim-data
Requires: vim >= 6
Recommends: vim-data >= 6
BuildRequires: perl(Test::File::ShareDir::Dist)
# MANUAL END
%description
This module tries to markup text files according to their syntax. It can be
used to produce web pages with pretty-printed colorful source code samples.
It can produce output in the following formats:
* HTML
Valid XHTML 1.0, with the exact coloring and style left to a CSS stylesheet
* XML
Pieces of text are marked with XML elements in a simple vocabulary, which
can be converted to other formats, for example, using XSLT
* Perl array
A simple Perl data structure, so that Perl code can be used to turn it into
whatever is needed
* ANSI Escape Sequences
A string marked with Term::ANSIColor suitable for printing to a terminal.
This module works by running the Vim text editor and getting it to apply
its excellent syntax highlighting (aka 'font-locking') to an input file,
and mark pieces of text according to whether it thinks they are comments,
keywords, strings, etc. The Perl code then reads back this markup and
converts it to the desired output format.
This is an object-oriented module. To use it, create an object with the new
function (as shown in SYNOPSIS) and then call methods to get the markup
out.
Note that this package only contains the Perl modules. To use Text::VimColor
from the command-line, install the additional package "text-vimcolor".
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%package -n text-vimcolor
Summary: Syntax Color Text in HTML or XML using Vim
Group: Development/Tools/Doc Generators
Requires: %{name} = %{version}-%{release}
%description -n text-vimcolor
The text-vimcolor command-line program tries to markup text files according to
their syntax. It can be used to produce web pages with pretty-printed
colourful source code samples.
%files
%defattr(-,root,root)
%doc Changes corpus README share
%license LICENSE
%dir %{perl_vendorlib}/Text
%{perl_vendorlib}/Text/VimColor.pm
%dir %{perl_vendorarch}/auto/Text
%{perl_vendorarch}/auto/Text/VimColor
%doc %{perl_man3dir}/Text::VimColor.%{perl_man3ext}*
%dir %{perl_vendorlib}/auto/share
%dir %{perl_vendorlib}/auto/share/dist
%{perl_vendorlib}/auto/share/dist/Text-VimColor
%files -n text-vimcolor
%defattr(-,root,root)
%{_bindir}/text-vimcolor
%doc %{_mandir}/man1/text-vimcolor.1*
%changelog