]>
Commit | Line | Data |
---|---|---|
17a79f18 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module llfuse | |
8 | Summary: Python bindings for the low level FUSE API | |
9 | Name: python-%{module} | |
10 | Version: 0.40 | |
04c17168 | 11 | Release: 6 |
17a79f18 AM |
12 | License: GPL v2 |
13 | Group: Libraries/Python | |
14 | Source0: https://python-llfuse.googlecode.com/files/llfuse-%{version}.tar.bz2 | |
15 | # Source0-md5: bd8d07ddb6061ab03816e636efa37b5b | |
16 | URL: https://code.google.com/p/python-llfuse/ | |
97c8ab9e | 17 | BuildRequires: rpmbuild(macros) >= 1.710 |
17a79f18 AM |
18 | BuildRequires: libfuse-devel >= 2.8.0 |
19 | BuildRequires: rpm-pythonprov | |
20 | %if %{with python2} | |
21 | BuildRequires: python-devel | |
22 | BuildRequires: python-distribute | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-devel | |
26 | BuildRequires: python3-distribute | |
27 | BuildRequires: python3-modules | |
28 | %endif | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Python bindings for the low level FUSE API. | |
33 | ||
34 | %package -n python3-%{module} | |
35 | Summary: Python bindings for the low level FUSE API | |
36 | Group: Libraries/Python | |
37 | ||
38 | %description -n python3-%{module} | |
39 | Python bindings for the low level FUSE API. | |
40 | ||
41 | %package apidocs | |
42 | Summary: %{module} API documentation | |
43 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
44 | Group: Documentation | |
45 | ||
46 | %description apidocs | |
47 | API documentation for %{module}. | |
48 | ||
49 | %description apidocs -l pl.UTF-8 | |
50 | Dokumentacja API %{module}. | |
51 | ||
52 | %prep | |
53 | %setup -q -n %{module}-%{version} | |
54 | ||
55 | %build | |
56 | %if %{with python2} | |
3c47d7d9 | 57 | %py_build %{?with_tests:test} |
17a79f18 AM |
58 | %endif |
59 | ||
60 | %if %{with python3} | |
3c47d7d9 | 61 | %py3_build %{?with_tests:test} |
17a79f18 AM |
62 | %endif |
63 | ||
64 | %if %{with doc} | |
65 | cd docs | |
66 | %{__make} -j1 html | |
67 | rm -rf _build/html/_sources | |
68 | %endif | |
69 | ||
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %if %{with python2} | |
3c47d7d9 | 74 | %py_install |
17a79f18 AM |
75 | |
76 | %py_postclean | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
3c47d7d9 | 80 | %py3_install |
17a79f18 AM |
81 | %endif |
82 | ||
83 | # in case there are examples provided | |
84 | %if %{with python2} | |
85 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
86 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
87 | %endif | |
88 | %if %{with python3} | |
89 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
90 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
91 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
92 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
93 | %endif | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc Changes.txt | |
102 | %dir %{py_sitedir}/llfuse | |
103 | %{py_sitedir}/llfuse/*.py[co] | |
104 | %attr(755,root,root) %{py_sitedir}/llfuse/*.so | |
105 | %if "%{py_ver}" > "2.4" | |
106 | %{py_sitedir}/llfuse-*.egg-info | |
107 | %endif | |
108 | %{_examplesdir}/%{name}-%{version} | |
109 | %endif | |
110 | ||
111 | %if %{with python3} | |
112 | %files -n python3-%{module} | |
113 | %defattr(644,root,root,755) | |
114 | %doc Changes.txt | |
115 | %dir %{py3_sitedir}/%{module} | |
116 | %{py3_sitedir}/%{module}/*.py* | |
117 | %{py3_sitedir}/%{module}/__pycache__ | |
118 | %attr(755,root,root) %{py3_sitedir}/%{module}/capi*.so | |
119 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
120 | %{_examplesdir}/python3-%{module}-%{version} | |
121 | %endif | |
122 | ||
123 | %if %{with doc} | |
124 | %files apidocs | |
125 | %defattr(644,root,root,755) | |
126 | %doc docs/_build/html/* | |
127 | %endif |