#
# spec file for package python-Pygments
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           python-Pygments
Version:        2.0.2
Release:        1.3
Url:            http://pygments.org
Summary:        Pygments is a syntax highlighting package written in Python
License:        BSD-2-Clause
Group:          Development/Languages/Python
Source:         http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  python-nose
BuildRequires:  python-setuptools
Requires:       python-setuptools
Provides:       python-pygments = %{version}
Obsoletes:      python-pygments < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
Pygments is a syntax highlighting package written in Python.

It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Highlights are:

 * a wide range of common languages and markup formats is supported
 * special attention is paid to details, increasing quality by a fair amount
 * support for new languages and formats are added easily
 * a number of output formats, presently HTML, LaTeX, RTF, SVG, all image
   formats that PIL supports and ANSI sequences
 * it is usable as a command-line tool and as a library
 * ... and it highlights even Brainfuck!

%prep
%setup -q -n Pygments-%{version}
# Remove non-oss licensed files, see bnc# 760344
rm tests/examplefiles/{Sorting,test}.mod

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1

%check
nosetests

%files
%defattr(-,root,root,-)
%doc LICENSE AUTHORS CHANGES TODO
%{_bindir}/pygmentize
%{_mandir}/man1/pygmentize.1*
%{python_sitelib}/pygments/
%{python_sitelib}/Pygments-%{version}-py%{py_ver}.egg-info/

%changelog
* Wed Mar 11 2015 tbehrens@suse.com
- Update to version 2.0.2:
  * Fix Python tracebacks getting duplicated in the console lexer
  * Backquote-delimited identifiers are now recognized in F#
  * Fix an encoding issue when using pygmentize with the -o option.
  * Default lexer encoding is now “guess”
  * Major update to Swift lexer.
  * Multiple fixes to lexer guessing in conflicting cases
  * Simplified regexes and builtin lists.
  * Dropped Python 2.4 and 2.5 compatibility
  * Lexers added:
    APL (#969)
    Agda and Literate Agda (PR#203)
    Alloy (PR#355)
    AmbientTalk
    BlitzBasic (PR#197)
    ChaiScript (PR#24)
    Chapel (PR#256)
    Cirru (PR#275)
    Clay (PR#184)
    ColdFusion CFC (PR#283)
    Cryptol and Literate Cryptol (PR#344)
    Cypher (PR#257)
    Docker config files
    EBNF (PR#193)
    Eiffel (PR#273)
    GAP (PR#311)
    Golo (PR#309)
    Handlebars (PR#186)
    Hy (PR#238)
    Idris and Literate Idris (PR#210)
    Igor Pro (PR#172)
    Inform 6/7 (PR#281)
    Intel objdump (PR#279)
    Isabelle (PR#386)
    Jasmin (PR#349)
    JSON-LD (PR#289)
    Kal (PR#233)
    Lean (PR#399)
    LSL (PR#296)
    Limbo (PR#291)
    Liquid (#977)
    MQL (PR#285)
    MaskJS (PR#280)
    Mozilla preprocessors
    Mathematica (PR#245)
    NesC (PR#166)
    Nit (PR#375)
    Nix (PR#267)
    Pan
    Pawn (PR#211)
    Perl 6 (PR#181)
    Pig (PR#304)
    Pike (PR#237)
    QBasic (PR#182)
    Red (PR#341)
    ResourceBundle (#1038)
    Rexx (PR#199)
    Rql (PR#251)
    Rsl
    SPARQL (PR#78)
    Slim (PR#366)
    Swift (PR#371)
    Swig (PR#168)
    TADS 3 (PR#407)
    Todo.txt todo lists
    Twig (PR#404)
  * Added a helper to “optimize” regular expressions
  * New styles: “xcode” and “igor”
  * The command-line “pygmentize” tool now tries a little harder
  * Added “inencoding” option for lexers to override “encoding”
  * Added line-by-line “streaming” mode for pygmentize with the “-s” option
  * Added an “envname” option to the LaTeX formatter to select a replacement
  * Updated the Makefile lexer to yield a little more useful highlighting.
  * Lexer aliases passed to get_lexer_by_name() are now case-insensitive.
  * File name matching in lexers and formatters will now use a regex cache for speed
  * Pygments will now recognize “vim” modelines when guessing the lexer
  * Major restructure of the pygments.lexers module namespace.
  * The NameHighlightFilter now works with any Name.* token type (#790).
  * Python 3 lexer: add new exceptions from PEP 3151.
  * Opa lexer: add new keywords (PR#170).
  * Julia lexer: add keywords and underscore-separated number literals
  * Lasso lexer: fix method highlighting, update builtins
  * Objective C/C++ lexers: allow “@” prefixing any expression (#871).
  * Ruby lexer: fix lexing of Name::Space tokens (#860) and of symbols in hashes
  * Stan lexer: update for version 2.4.0 of the language
  * JavaScript lexer: add the “yield” keyword (PR#196).
  * HTTP lexer: support for PATCH method (PR#190).
  * Koka lexer: update to newest language spec (PR#201).
  * Haxe lexer: rewrite and support for Haxe 3 (PR#174).
  * Prolog lexer: add different kinds of numeric literals
  * F# lexer: rewrite with newest spec for F# 3.0 (#842), fix a bug with dotted chains
  * Kotlin lexer: general update (PR#271).
  * Rebol lexer: fix comment detection and analyse_text (PR#261).
  * LLVM lexer: update keywords to v3.4 (PR#258).
  * PHP lexer: add new keywords and binary literals (PR#222).
  * external/markdown-processor.py updated to newest python-markdown
  * CSS lexer: some highlighting order fixes (PR#231).
  * Ceylon lexer: fix parsing of nested multiline comments (#915).
  * C family lexers: fix parsing of indented preprocessor directives
  * Rust lexer: update to 0.9 language version (PR#270, PR#388).
  * Elixir lexer: update to 0.15 language version (PR#392).
  * Fix swallowing incomplete tracebacks in Python console lexer
* Mon Apr  7 2014 dmueller@suse.com
- add LICENSE to doc section
* Thu Oct 24 2013 speilicke@suse.com
- Require python-setuptools instead of distribute (upstreams merged)
* Fri May  3 2013 toddrme2178@gmail.com
- Update to version 1.6:
  - Lexers added
  - Fix unquoted HTML attribute lexing in Opa .
  - The HTML formatter now supports linking to tags using CTags files, when the
    python-ctags package is installed .
  - The HTML formatter now has a "linespans" option that wraps every line in a
    <span> tag with a specific id .
  - When deriving a lexer from another lexer with token definitions, definitions
    for states not in the child lexer are now inherited.  If you override a state
    in the child lexer, an "inherit" keyword has been added to insert the base
    state at that position .
  - The C family lexers now inherit token definitions from a common base class,
    removing code duplication .
  - Use "colorama" on Windows for console color output .
  - Fix Template Haskell highlighting .
  - Fix some S/R lexer errors .
  - Fix a bug in the Prolog lexer with names that start with 'is' .
  - Rewrite Dylan lexer, add Dylan LID lexer .
  - Add a Java quickstart document .
  - Add a "external/autopygmentize" file that can be used as .lessfilter .
* Thu May  3 2012 toddrme2178@gmail.com
- Removed files with non-oss license, see bnc#760344
- Cleanups in python 2 and python 3 spec files
* Mon Apr 30 2012 toddrme2178@gmail.com
- Fix building python 3 package on openSUSE 11.4 x86_64
* Mon Mar 12 2012 saschpe@gmx.de
- Update to version 1.5:
  - Fix Python 3 terminal highlighting with pygmentize
  - In the LaTeX formatter, escape special &, < and > chars
  - In the LaTeX formatter, fix display problems for styles with token
    background colors
  - Enhancements to the Squid conf lexer
  - Several fixes to the reStructuredText lexer
  - Recognize methods in the ObjC lexer
  - Fix Lua "class" highlighting: it does not have classes
  - Fix degenerate regex in Scala lexer  and highlighting bugs
  - Fix number pattern order in Ocaml lexer
  - Fix generic type highlighting in ActionScript 3
  - Fixes to the Clojure lexer
  - Fix degenerate regex in Nemerle lexer
  - Fix infinite looping in CoffeeScript lexer
  - Fix crashes and analysis with ObjectiveC lexer
  - Add some Fortran 2003 keywords.
  - Fix Boo string regexes
  - Add "rrt" style
  - Fix infinite looping in Darcs Patch lexer.
  - Lots of misc fixes to character-eating bugs and ordering problems in many
    different lexers.
* Tue Jan 24 2012 bwiedemann@suse.com
- fix Obsoletes
* Fri Sep 23 2011 saschpe@suse.de
- Disable tests again, breaks i586 build
* Thu Sep 22 2011 saschpe@suse.de
- Fixed license to BSD-2-Clause
* Sun Sep 11 2011 saschpe@gmx.de
- Change license to BSD-3-Clause (SPDX style)
- Removed %%clean section (has sane default)
- Added python-distribute requirement
* Sun Jul  3 2011 saschpe@gmx.de
- Renamed to 'python-Pygments', obsoletes 'python-pygments'
* Mon Feb 21 2011 nix@opensuse.org
- Update to version 1.4
- Compress the tarball with bz2
* Tue Sep 14 2010 coolo@novell.com
- correct email addresses
* Fri Jun 18 2010 coolo@novell.com
- update to 1.3.1 (1.4 is too late, but is known to fix
  http://dev.pocoo.org/projects/pygments/ticket/507 )
* Fri Feb 12 2010 bitdealer@opensuse.org
- Updated to 1.2.2
* Fri Oct  9 2009 bitdealer@opensuse.org
- Updated to 1.1.1
* Tue Dec  9 2008 cfarrell1980@gmail.com
- Updated to version 1.0
* Thu Jun 21 2007 judas_iscariote@shorewall.net
- Initial package version.