]> git.pld-linux.org Git - packages/python-markdown.git/blob - python-markdown.spec
d342b8d00b908a42e182434a4834c9e0b8096cf1
[packages/python-markdown.git] / python-markdown.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # python2 package
5 %bcond_without  python3 # python3 package
6
7 %define         module  markdown
8 Summary:        Markdown implementation in Python 2
9 Summary(pl.UTF-8):      Implementacja formatu Markdown w Pythonie 2
10 Name:           python-%{module}
11 Version:        2.6.11
12 Release:        1
13 License:        BSD
14 Group:          Development/Languages/Python
15 #Source0Download: https://pypi.python.org/simple/markdown/
16 Source0:        https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
17 # Source0-md5:  a67c1b2914f7d74eeede2ebe0fdae470
18 Patch0:         %{name}-yaml.patch
19 URL:            https://pythonhosted.org/Markdown/
20 BuildRequires:  python-devel
21 BuildRequires:  python-elementtree
22 %if %{with tests}
23 BuildRequires:  python-PyYAML
24 BuildRequires:  python-nose
25 %endif
26 BuildRequires:  rpm-pythonprov
27 BuildRequires:  rpmbuild(macros) >= 1.714
28 %if %{with python3}
29 BuildRequires:  python3-devel >= 1:3.2
30 %if %{with tests}
31 BuildRequires:  python3-PyYAML
32 BuildRequires:  python3-nose
33 %endif
34 %endif
35 Requires:       python-elementtree
36 Provides:       python-Markdown = %{version}-%{release}
37 Obsoletes:      python-Markdown = 2.2.1
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
42 This is a Python 2 implementation of John Gruber's Markdown. It is
43 almost completely compliant with the reference implementation, though
44 there are a few known issues.
45
46 %description -l pl.UTF-8
47 Ten pakiet zawiera implementację formatu Markdown Johna Grubera w
48 Pythonie 2. Jest prawie całkowicie zgodna z implementacją wzorcową,
49 choć jest kilka znanych problemów.
50
51 %package -n python3-markdown
52 Summary:        Markdown implementation in Python 3
53 Summary(pl.UTF-8):      Implementacja formatu Markdown w Pythonie 3
54 Group:          Development/Languages/Python
55
56 %description -n python3-markdown
57 This is a Python 3 implementation of John Gruber's Markdown. It is
58 almost completely compliant with the reference implementation, though
59 there are a few known issues.
60
61 %description -n python3-markdown -l pl.UTF-8
62 Ten pakiet zawiera implementację formatu Markdown Johna Grubera w
63 Pythonie 3. Jest prawie całkowicie zgodna z implementacją wzorcową,
64 choć jest kilka znanych problemów.
65
66 %prep
67 %setup -q -n Markdown-%{version}
68 %patch0 -p1
69
70 %build
71 %if %{with python2}
72 %py_build
73
74 %if %{with tests}
75 %{__python} ./run-tests.py
76 %endif
77 %endif
78
79 %if %{with python3}
80 %py3_build
81
82 %if %{with tests}
83 %{__python3} ./run-tests.py
84 %endif
85 %endif
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89
90 %if %{with python3}
91 %py3_install
92 # rename binary
93 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
94 %endif
95
96 %if %{with python2}
97 %py_install
98 %py_postclean
99 # rename binary
100 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
101 # 2.X binary is called by default for now
102 ln -s markdown_py-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
103 %endif
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %if %{with python2}
109 %files
110 %defattr(644,root,root,755)
111 %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
112 %attr(755,root,root) %{_bindir}/markdown_py
113 %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
114 %{py_sitescriptdir}/markdown
115 %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
116 %endif
117
118 %if %{with python3}
119 %files -n python3-markdown
120 %defattr(644,root,root,755)
121 %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
122 %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
123 %{py3_sitescriptdir}/markdown
124 %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info
125 %endif
This page took 0.055526 seconds and 2 git commands to generate.