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