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