]> git.pld-linux.org Git - packages/python-blockdiag.git/blob - python-blockdiag.spec
f2f8772d9b3ae298cdb690c216a4088b28adc9f2
[packages/python-blockdiag.git] / python-blockdiag.spec
1 # NOTE: for versions >= 2.0.0 (for python 3.5+) see python3-blockdiag.spec
2 #
3 # Conditional build:
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_with     python3 # CPython 3.x module (built from python3-blockdiag.spec)
7
8 %define         module  blockdiag
9 Summary:        Blockdiag generate block-diagram image file from spec-text file
10 Summary(pl.UTF-8):      Generowanie obrazków diagramów blokowych z opisu tekstowego
11 Name:           python-%{module}
12 # keep 1.x here for python2 support
13 Version:        1.5.4
14 Release:        2
15 License:        Apache v2.0
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.org/simple/blockdiag/
18 Source0:        https://files.pythonhosted.org/packages/source/b/blockdiag/%{module}-%{version}.tar.gz
19 # Source0-md5:  2de59ac957224c4f92ea3072aa1221bf
20 Patch0:         %{name}-tests.patch
21 URL:            http://blockdiag.com/en/blockdiag/index.html
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.6
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-ReportLab
27 BuildRequires:  python-docutils
28 BuildRequires:  python-funcparserlib
29 BuildRequires:  python-nose
30 BuildRequires:  python-pillow
31 BuildRequires:  python-webcolors
32 %if "%{py_ver}" < "2.7"
33 BuildRequires:  python-ordereddict
34 BuildRequires:  python-unittest2
35 %endif
36 %endif
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3-modules >= 1:3.2
40 BuildRequires:  python3-setuptools
41 %if %{with tests}
42 BuildRequires:  python3-ReportLab
43 BuildRequires:  python3-docutils
44 BuildRequires:  python3-funcparserlib
45 BuildRequires:  python3-nose
46 BuildRequires:  python3-nose_exclude
47 BuildRequires:  python3-pillow
48 BuildRequires:  python3-webcolors
49 %endif
50 %endif
51 BuildRequires:  rpmbuild(macros) >= 1.714
52 BuildRequires:  sed >= 4.0
53 Requires:       python-modules >= 1:2.6
54 BuildArch:      noarch
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %description
58 blockdiag generates block-diagram image file from spec-text file.
59
60 Features:
61 - Generate block-diagram from dot like text (basic feature).
62 - Multilingualization for node-label (UTF-8 only).
63
64 %description -l pl.UTF-8
65 blockdiag generuje pliki obrazów diagramów blokowych z tekstowych
66 plików opisu.
67
68 Funkcje:
69 - generowanie diagramów z tekstu w stylu dot (podstawowa funkcja).
70 - obsługa wielu języków dla etykiet węzłów (tylko UTF-8).
71
72 %package -n python3-%{module}
73 Summary:        Blockdiag generate block-diagram image file from spec-text file
74 Summary(pl.UTF-8):      Generowanie obrazków diagramów blokowych z opisu tekstowego
75 Group:          Libraries/Python
76 Requires:       python3-modules >= 1:3.2
77
78 %description -n python3-%{module}
79 blockdiag generates block-diagram image file from spec-text file.
80
81 Features:
82 - Generate block-diagram from dot like text (basic feature).
83 - Multilingualization for node-label (utf-8 only).
84
85 %description -n python3-%{module} -l pl.UTF-8
86 blockdiag generuje pliki obrazów diagramów blokowych z tekstowych
87 plików opisu.
88
89 Funkcje:
90 - generowanie diagramów z tekstu w stylu dot (podstawowa funkcja).
91 - obsługa wielu języków dla etykiet węzłów (tylko UTF-8).
92
93 %prep
94 %setup -q -n %{module}-%{version}
95 %patch0 -p1
96
97 %build
98 %if %{with python2}
99 %py_build
100
101 %if %{with tests}
102 # disable tests requiring network: test_command.TestBlockdiagApp.test_app_cleans_up_images, test_generate_diagram.test_generate, test_generate_diagram.ghostscript_not_found_test
103 PYTHONPATH=$(pwd)/src \
104 nosetests-%{py_ver} src/blockdiag/tests -e 'test_app_cleans_up_images|test_generate|ghostscript_not_found_test'
105 %endif
106 %endif
107
108 %if %{with python3}
109 %py3_build
110
111 %if %{with tests}
112 # disable tests requiring network: test_command.TestBlockdiagApp.test_app_cleans_up_images, test_generate_diagram.test_generate, test_generate_diagram.ghostscript_not_found_test
113 # test_setup_inline_svg_is_true_with_multibytes fails on utf-8 vs latin-1 inconsistency
114 PYTHONPATH=$(pwd)/src \
115 nosetests-%{py3_ver} src/blockdiag/tests -e 'test_app_cleans_up_images|test_generate|ghostscript_not_found_test|test_setup_inline_svg_is_true_with_multibytes'
116 %endif
117 %endif
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121
122 %if %{with python2}
123 %py_install
124
125 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/blockdiag/tests
126
127 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{blockdiag,blockdiag-2}
128 install -d $RPM_BUILD_ROOT%{_mandir}/man1
129 cp -p blockdiag.1 $RPM_BUILD_ROOT%{_mandir}/man1/blockdiag-2.1
130
131 %py_postclean
132 %endif
133
134 %if %{with python3}
135 %py3_install
136
137 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/blockdiag/tests
138
139 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{blockdiag,blockdiag-3}
140 ln -s blockdiag-3 $RPM_BUILD_ROOT%{_bindir}/blockdiag
141 install -d $RPM_BUILD_ROOT%{_mandir}/man1
142 cp -p blockdiag.1 $RPM_BUILD_ROOT%{_mandir}/man1/blockdiag-3.1
143 echo '.so blockdiag-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/blockdiag.1
144 %endif
145
146 %clean
147 rm -rf $RPM_BUILD_ROOT
148
149 %if %{with python2}
150 %files
151 %defattr(644,root,root,755)
152 %doc CHANGES.rst README.rst
153 %attr(755,root,root) %{_bindir}/blockdiag-2
154 %{py_sitescriptdir}/blockdiag
155 %{py_sitescriptdir}/blockdiag_sphinxhelper.py[co]
156 %{py_sitescriptdir}/%{module}-%{version}-*.egg-info
157 %{_mandir}/man1/blockdiag-2.1*
158 %endif
159
160 %if %{with python3}
161 %files -n python3-%{module}
162 %defattr(644,root,root,755)
163 %doc CHANGES.rst README.rst
164 %attr(755,root,root) %{_bindir}/blockdiag
165 %attr(755,root,root) %{_bindir}/blockdiag-3
166 %{py3_sitescriptdir}/blockdiag
167 %{py3_sitescriptdir}/blockdiag_sphinxhelper.py
168 %{py3_sitescriptdir}/__pycache__/blockdiag_sphinxhelper.cpython-*.py[co]
169 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
170 %{_mandir}/man1/blockdiag.1*
171 %{_mandir}/man1/blockdiag-3.1*
172 %endif
This page took 0.04197 seconds and 2 git commands to generate.