]> git.pld-linux.org Git - packages/python-markdown.git/blame - python-markdown.spec
- python 3.5 rebuild
[packages/python-markdown.git] / python-markdown.spec
CommitLineData
4e2d3523
ER
1# TODO
2# - check py3 tests, are they ran?
4e2d3523
ER
3
4# Conditional build:
5%bcond_without tests # do not perform "make test"
6%bcond_without py3 # do not build python3 package
7
4ceaf0fc 8%define module markdown
4e2d3523 9Summary: Markdown implementation in Python
4ceaf0fc 10Name: python-%{module}
4e2d3523 11Version: 2.2.1
b09bd961 12Release: 4
a974dd9e
AF
13License: BSD
14Group: Development/Languages/Python
4ceaf0fc 15Source0: http://pypi.python.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
4e2d3523 16# Source0-md5: 9e002c8051fb346cae75060f3302048a
4ceaf0fc 17URL: http://packages.python.org/Markdown/
4e2d3523
ER
18BuildRequires: python-devel
19BuildRequires: python-elementtree
20BuildRequires: python-nose
a974dd9e
AF
21BuildRequires: rpm-pythonprov
22BuildRequires: rpmbuild(macros) >= 1.219
4e2d3523
ER
23%if %{with py3}
24BuildRequires: python3-devel
25BuildRequires: python3-nose
26# for converting before running the tests:
27BuildRequires: python-2to3
28%endif
29Requires: python-elementtree
4ceaf0fc
ER
30Provides: python-Markdown = %{version}-%{release}
31Obsoletes: python-Markdown = 2.2.1
a974dd9e
AF
32BuildArch: noarch
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
8ae41e2f 36This is a Python implementation of John Gruber's Markdown. It is
4e2d3523
ER
37almost completely compliant with the reference implementation, though
38there are a few known issues.
39
40%package -n python3-markdown
41Summary: Markdown implementation in Python
42Group: Development/Languages/Python
43
44%description -n python3-markdown
45This is a Python implementation of John Gruber's Markdown. It is
46almost completely compliant with the reference implementation, though
47there are a few known issues.
a974dd9e
AF
48
49%prep
4e2d3523
ER
50# install does not support --build-base. so create two different trees
51%setup -qc
4ceaf0fc 52mv Markdown-%{version} py2
4e2d3523
ER
53cd py2
54
55# remove shebangs
56find markdown -type f -name '*.py' -exec sed -i -e '/^#!/{1D}' {} ';'
57
58# fix line-ending
59sed -i 's/\r//' docs/release-2.2.0.txt
60
61cd ..
62cp -a py2 py3
a974dd9e
AF
63
64%build
4e2d3523 65cd py2
a974dd9e
AF
66%{__python} setup.py build
67
4e2d3523
ER
68%if %{with py3}
69cd ../py3
70%{__python3} setup.py build
71%endif
72
73%if %{with tests}
74cd ../py2
75./run-tests.py
76
77%if %{with py3}
78cd ../py3
792to3 -d -w -n markdown tests run-tests.py > /dev/null
80# FIXME: run-tests.py shebang points to python2, is that correct?
81./run-tests.py
82%endif
83%endif
84
a974dd9e
AF
85%install
86rm -rf $RPM_BUILD_ROOT
4e2d3523
ER
87# somewhy --build-base not supported in install
88cd py2
a974dd9e
AF
89%{__python} setup.py install \
90 --optimize=2 \
4e2d3523
ER
91 --skip-build \
92 --root $RPM_BUILD_ROOT
a974dd9e
AF
93
94%py_postclean
95
4e2d3523
ER
96# rename binary
97mv $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
98
99%if %{with py3}
100cd ../py3
101%{__python3} setup.py install \
102 --optimize=2 \
103 --skip-build \
104 --root $RPM_BUILD_ROOT
105
106# rename binary
107mv $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
108%endif
109
110# 2.X binary is called by default for now
111ln -s markdown_py-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
112
a974dd9e
AF
113%clean
114rm -rf $RPM_BUILD_ROOT
115
116%files
117%defattr(644,root,root,755)
4e2d3523 118%doc py2/docs/*
8ae41e2f 119%attr(755,root,root) %{_bindir}/markdown_py
4e2d3523 120%attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
a974dd9e 121%{py_sitescriptdir}/markdown
4e2d3523
ER
122%{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
123
124%if %{with py3}
125%files -n python3-markdown
126%defattr(644,root,root,755)
127%doc py3/docs/*
128%attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
129%{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info
130%{py3_sitescriptdir}/markdown
a974dd9e 131%endif
This page took 0.064362 seconds and 4 git commands to generate.