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