]> git.pld-linux.org Git - packages/python-pygments.git/blob - python-pygments.spec
- version 1.4.1,
[packages/python-pygments.git] / python-pygments.spec
1 %bcond_without  python2
2 %bcond_without  python3
3 %define module  pygments
4 #
5 Summary:        Generic syntax highlighter
6 Name:           python-%{module}
7 Version:        1.4
8 Release:        1
9 License:        BSD
10 Group:          Development/Languages/Python
11 Source0:        http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
12 # Source0-md5:  d77ac8c93a7fb27545f2522abe9cc462
13 URL:            http://pygments.org/
14 %if %{with python2}
15 BuildRequires:  python
16 BuildRequires:  python-devel
17 BuildRequires:  python-modules
18 %endif
19 %if %{with python3}
20 BuildRequires:  python3
21 BuildRequires:  python3-2to3
22 BuildRequires:  python3-devel
23 BuildRequires:  python3-distribute
24 BuildRequires:  python3-modules
25 %endif
26 BuildRequires:  rpm-pythonprov
27 %pyrequires_eq  python-modules
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 Pygments is a generic syntax highlighter for general use in all kinds
33 of software such as forum systems, wikis or other applications that
34 need to prettify source code. Highlights are
35 - a wide range of common languages and markup formats is supported
36 - special attention is paid to details that increase highlighting
37   quality
38 - support for new languages and formats are added easily; most
39   languages use a simple regex-based lexing mechanism
40 - a number of output formats is available, among them HTML, RTF, LaTeX
41   and ANSI sequences
42 - it is usable as a command-line tool and as a library
43 - ... and it highlights even Brainf*ck!
44
45 %package -n python3-%{module}
46 Summary:        Generic syntax highlighter
47 Group:          Development/Languages/Python
48
49 %description -n python3-%{module}
50 Pygments is a generic syntax highlighter for general use in all kinds
51 of software such as forum systems, wikis or other applications that
52 need to prettify source code. Highlights are
53 - a wide range of common languages and markup formats is supported
54 - special attention is paid to details that increase highlighting
55   quality
56 - support for new languages and formats are added easily; most
57   languages use a simple regex-based lexing mechanism
58 - a number of output formats is available, among them HTML, RTF, LaTeX
59   and ANSI sequences
60 - it is usable as a command-line tool and as a library
61 - ... and it highlights even Brainf*ck!
62
63 %prep
64 %setup -q -n Pygments-%{version}
65
66 %build
67 %if %{with python2}
68 %{__python} setup.py build -b build-2
69 %endif
70
71 %if %{with python3}
72 %{__python3} setup.py build -b build-3
73 %endif
74
75 %install
76 rm -rf $RPM_BUILD_ROOT
77
78 %if %{with python2}
79 %{__python} setup.py \
80         build -b build-2 \
81         install \
82         --optimize=2 \
83         --root=$RPM_BUILD_ROOT
84
85 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
86
87 %py_postclean
88 %endif
89
90 %if %{with python3}
91 %{__python3} setup.py \
92         build -b build-3 \
93         install \
94         --optimize=2 \
95         --root=$RPM_BUILD_ROOT
96
97 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
98
99 %py3_postclean
100 %endif
101
102 ln -s pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %files
109 %defattr(644,root,root,755)
110 %doc PKG-INFO TODO AUTHORS
111 %attr(755,root,root) %{_bindir}/pygmentize
112 %attr(755,root,root) %{_bindir}/pygmentize-2
113 %{py_sitescriptdir}/%{module}
114 %{py_sitescriptdir}/*.egg-info
115 %endif
116
117 %if %{with python3}
118 %files -n python3-%{module}
119 %defattr(644,root,root,755)
120 %doc PKG-INFO TODO AUTHORS
121 %attr(755,root,root) %{_bindir}/pygmentize-3
122 %{py3_sitescriptdir}/%{module}
123 %{py3_sitescriptdir}/*.egg-info
124 %endif
This page took 0.145382 seconds and 4 git commands to generate.