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