]>
Commit | Line | Data |
---|---|---|
4e2d3523 ER |
1 | # TODO |
2 | # - check py3 tests, are they ran? | |
f8804a58 | 3 | # |
4e2d3523 ER |
4 | # Conditional build: |
5 | %bcond_without tests # do not perform "make test" | |
f8804a58 | 6 | %bcond_without python3 # do not build python3 package |
4e2d3523 | 7 | |
4ceaf0fc | 8 | %define module markdown |
f8804a58 JB |
9 | Summary: Markdown implementation in Python 2 |
10 | Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 2 | |
4ceaf0fc | 11 | Name: python-%{module} |
f8804a58 JB |
12 | Version: 2.6.7 |
13 | Release: 1 | |
a974dd9e AF |
14 | License: BSD |
15 | Group: Development/Languages/Python | |
f8804a58 JB |
16 | #Source0Download: https://pypi.python.org/simple/markdown/ |
17 | Source0: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz | |
18 | # Source0-md5: a06f1c5d462b32e0e8da014e9eebb0d9 | |
19 | URL: https://pythonhosted.org/Markdown/ | |
4e2d3523 ER |
20 | BuildRequires: python-devel |
21 | BuildRequires: python-elementtree | |
f8804a58 JB |
22 | %if %{with tests} |
23 | BuildRequires: python-PyYAML | |
4e2d3523 | 24 | BuildRequires: python-nose |
f8804a58 | 25 | %endif |
a974dd9e | 26 | BuildRequires: rpm-pythonprov |
f8804a58 JB |
27 | BuildRequires: rpmbuild(macros) >= 1.714 |
28 | BuildRequires: sed >= 4.0 | |
29 | %if %{with python3} | |
30 | BuildRequires: python3-devel >= 1:3.2 | |
31 | %if %{with tests} | |
32 | BuildRequires: python3-PyYAML | |
4e2d3523 | 33 | BuildRequires: python3-nose |
f8804a58 | 34 | %endif |
4e2d3523 ER |
35 | %endif |
36 | Requires: python-elementtree | |
4ceaf0fc ER |
37 | Provides: python-Markdown = %{version}-%{release} |
38 | Obsoletes: python-Markdown = 2.2.1 | |
a974dd9e AF |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
f8804a58 | 43 | This is a Python 2 implementation of John Gruber's Markdown. It is |
4e2d3523 ER |
44 | almost completely compliant with the reference implementation, though |
45 | there are a few known issues. | |
46 | ||
f8804a58 JB |
47 | %description -l pl.UTF-8 |
48 | Ten pakiet zawiera implementację formatu Markdown Johna Grubera w | |
49 | Pythonie 2. Jest prawie całkowicie zgodna z implementacją wzorcową, | |
50 | choć jest kilka znanych problemów. | |
51 | ||
4e2d3523 | 52 | %package -n python3-markdown |
f8804a58 JB |
53 | Summary: Markdown implementation in Python 3 |
54 | Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 3 | |
4e2d3523 ER |
55 | Group: Development/Languages/Python |
56 | ||
57 | %description -n python3-markdown | |
f8804a58 | 58 | This is a Python 3 implementation of John Gruber's Markdown. It is |
4e2d3523 ER |
59 | almost completely compliant with the reference implementation, though |
60 | there are a few known issues. | |
a974dd9e | 61 | |
f8804a58 JB |
62 | %description -n python3-markdown -l pl.UTF-8 |
63 | Ten pakiet zawiera implementację formatu Markdown Johna Grubera w | |
64 | Pythonie 3. Jest prawie całkowicie zgodna z implementacją wzorcową, | |
65 | choć jest kilka znanych problemów. | |
66 | ||
a974dd9e | 67 | %prep |
4e2d3523 ER |
68 | # install does not support --build-base. so create two different trees |
69 | %setup -qc | |
f8804a58 | 70 | %{__mv} Markdown-%{version} py2 |
4e2d3523 ER |
71 | cd py2 |
72 | ||
73 | # remove shebangs | |
74 | find markdown -type f -name '*.py' -exec sed -i -e '/^#!/{1D}' {} ';' | |
75 | ||
76 | # fix line-ending | |
f8804a58 | 77 | %undos docs/release-2.2.0.txt |
4e2d3523 ER |
78 | |
79 | cd .. | |
80 | cp -a py2 py3 | |
a974dd9e AF |
81 | |
82 | %build | |
4e2d3523 | 83 | cd py2 |
d44221e5 | 84 | %py_build |
a974dd9e | 85 | |
f8804a58 | 86 | %if %{with python3} |
4e2d3523 | 87 | cd ../py3 |
d44221e5 | 88 | %py3_build |
4e2d3523 ER |
89 | %endif |
90 | ||
91 | %if %{with tests} | |
92 | cd ../py2 | |
f8804a58 | 93 | %{__python} ./run-tests.py |
4e2d3523 | 94 | |
f8804a58 | 95 | %if %{with python3} |
4e2d3523 | 96 | cd ../py3 |
f8804a58 | 97 | %{__python3} ./run-tests.py |
4e2d3523 ER |
98 | %endif |
99 | %endif | |
100 | ||
a974dd9e AF |
101 | %install |
102 | rm -rf $RPM_BUILD_ROOT | |
4e2d3523 ER |
103 | # somewhy --build-base not supported in install |
104 | cd py2 | |
f8804a58 | 105 | %py_install |
a974dd9e AF |
106 | |
107 | %py_postclean | |
108 | ||
4e2d3523 | 109 | # rename binary |
f8804a58 | 110 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}} |
4e2d3523 | 111 | |
f8804a58 | 112 | %if %{with python3} |
4e2d3523 | 113 | cd ../py3 |
f8804a58 | 114 | %py3_install |
4e2d3523 ER |
115 | |
116 | # rename binary | |
f8804a58 | 117 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}} |
4e2d3523 ER |
118 | %endif |
119 | ||
120 | # 2.X binary is called by default for now | |
121 | ln -s markdown_py-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py | |
122 | ||
a974dd9e AF |
123 | %clean |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %files | |
127 | %defattr(644,root,root,755) | |
f8804a58 | 128 | %doc py2/{LICENSE.md,README.md} py2/docs/* |
8ae41e2f | 129 | %attr(755,root,root) %{_bindir}/markdown_py |
4e2d3523 | 130 | %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver} |
a974dd9e | 131 | %{py_sitescriptdir}/markdown |
4e2d3523 ER |
132 | %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info |
133 | ||
f8804a58 | 134 | %if %{with python3} |
4e2d3523 ER |
135 | %files -n python3-markdown |
136 | %defattr(644,root,root,755) | |
f8804a58 | 137 | %doc py3/{LICENSE.md,README.md} py3/docs/* |
4e2d3523 | 138 | %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver} |
4e2d3523 | 139 | %{py3_sitescriptdir}/markdown |
f8804a58 | 140 | %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info |
a974dd9e | 141 | %endif |