]> git.pld-linux.org Git - packages/python-markdown.git/blob - python-markdown.spec
- add Conflicts to handle default script move
[packages/python-markdown.git] / python-markdown.spec
1 #
2 # Conditional build:
3 %bcond_with     doc     # documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # python2 package
6 %bcond_without  python3 # python3 package
7
8 %define         module  markdown
9 Summary:        Markdown implementation in Python 2
10 Summary(pl.UTF-8):      Implementacja formatu Markdown w Pythonie 2
11 Name:           python-%{module}
12 Version:        3.1.1
13 Release:        1
14 License:        BSD
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/markdown/
17 Source0:        https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
18 # Source0-md5:  d84732ecc65b3a1bff693d9d4c24277f
19 URL:            https://pypi.org/project/markdown/
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.7
22 BuildRequires:  python-setuptools >= 36
23 %if %{with tests}
24 BuildRequires:  python-PyYAML
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-devel >= 1:3.5
29 BuildRequires:  python3-setuptools >= 36
30 %if %{with tests}
31 BuildRequires:  python3-PyYAML
32 %endif
33 %endif
34 BuildRequires:  rpm-pythonprov
35 BuildRequires:  rpmbuild(macros) >= 1.714
36 Provides:       python-Markdown = %{version}-%{release}
37 Obsoletes:      python-Markdown < 2.3
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 Conflicts:      python-markdown < 3
56
57 %description -n python3-markdown
58 This is a Python 3 implementation of John Gruber's Markdown. It is
59 almost completely compliant with the reference implementation, though
60 there are a few known issues.
61
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
67 %prep
68 %setup -q -n Markdown-%{version}
69
70 %build
71 %if %{with python2}
72 %py_build
73
74 %if %{with tests}
75 %{__python} -m unittest discover tests
76 %endif
77 %endif
78
79 %if %{with python3}
80 %py3_build
81
82 %if %{with tests}
83 %{__python3} -m unittest discover tests
84 %endif
85 %endif
86
87 %if %{with doc}
88 mkdocs
89 mkdocs_nature
90 %endif
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94
95 %if %{with python2}
96 %py_install
97
98 %py_postclean
99 # rename binary
100 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
101 %endif
102
103 %if %{with python3}
104 %py3_install
105 # rename binary
106 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
107 # default binary
108 ln -s markdown_py-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
109 %endif
110
111 %clean
112 rm -rf $RPM_BUILD_ROOT
113
114 %if %{with python2}
115 %files
116 %defattr(644,root,root,755)
117 %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
118 %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
119 %{py_sitescriptdir}/markdown
120 %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
121 %endif
122
123 %if %{with python3}
124 %files -n python3-markdown
125 %defattr(644,root,root,755)
126 %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
127 %attr(755,root,root) %{_bindir}/markdown_py
128 %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
129 %{py3_sitescriptdir}/markdown
130 %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info
131 %endif
This page took 0.200357 seconds and 3 git commands to generate.