]>
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 | ||
8cc64e1f | 7 | %define module llfuse |
17a79f18 AM |
8 | Summary: Python bindings for the low level FUSE API |
9 | Name: python-%{module} | |
510394b2 | 10 | Version: 1.3.6 |
4ed66399 | 11 | Release: 6 |
17a79f18 AM |
12 | License: GPL v2 |
13 | Group: Libraries/Python | |
510394b2 AM |
14 | Source0: https://pypi.debian.net/llfuse/%{module}-%{version}.tar.bz2 |
15 | # Source0-md5: 4996674fa327c6c93174c1f71961ac6c | |
16 | Patch0: x32.patch | |
429ee303 | 17 | URL: https://github.com/python-llfuse/python-llfuse |
97c8ab9e | 18 | BuildRequires: rpmbuild(macros) >= 1.710 |
17a79f18 AM |
19 | BuildRequires: libfuse-devel >= 2.8.0 |
20 | BuildRequires: rpm-pythonprov | |
55c19750 | 21 | BuildRequires: python-Cython |
17a79f18 AM |
22 | %if %{with python2} |
23 | BuildRequires: python-devel | |
24 | BuildRequires: python-distribute | |
429ee303 | 25 | BuildRequires: python-contextlib2 |
17a79f18 AM |
26 | %endif |
27 | %if %{with python3} | |
28 | BuildRequires: python3-devel | |
429ee303 | 29 | BuildRequires: python3-contextlib2 |
17a79f18 AM |
30 | BuildRequires: python3-modules |
31 | %endif | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | Python bindings for the low level FUSE API. | |
36 | ||
37 | %package -n python3-%{module} | |
38 | Summary: Python bindings for the low level FUSE API | |
39 | Group: Libraries/Python | |
40 | ||
41 | %description -n python3-%{module} | |
42 | Python bindings for the low level FUSE API. | |
43 | ||
44 | %package apidocs | |
45 | Summary: %{module} API documentation | |
46 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
47 | Group: Documentation | |
48 | ||
49 | %description apidocs | |
50 | API documentation for %{module}. | |
51 | ||
52 | %description apidocs -l pl.UTF-8 | |
53 | Dokumentacja API %{module}. | |
54 | ||
55 | %prep | |
56 | %setup -q -n %{module}-%{version} | |
55c19750 | 57 | %ifarch x32 |
510394b2 | 58 | %patch0 -p1 |
55c19750 | 59 | %endif |
17a79f18 AM |
60 | |
61 | %build | |
55c19750 JR |
62 | ./setup.py build_cython |
63 | ||
17a79f18 | 64 | %if %{with python2} |
3c47d7d9 | 65 | %py_build %{?with_tests:test} |
17a79f18 AM |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
3c47d7d9 | 69 | %py3_build %{?with_tests:test} |
17a79f18 AM |
70 | %endif |
71 | ||
72 | %if %{with doc} | |
73 | cd docs | |
74 | %{__make} -j1 html | |
75 | rm -rf _build/html/_sources | |
76 | %endif | |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
3c47d7d9 | 82 | %py_install |
17a79f18 AM |
83 | |
84 | %py_postclean | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
3c47d7d9 | 88 | %py3_install |
17a79f18 AM |
89 | %endif |
90 | ||
91 | # in case there are examples provided | |
92 | %if %{with python2} | |
93 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
94 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
e9a88037 JR |
95 | |
96 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python}\1,' \ | |
97 | $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py | |
17a79f18 AM |
98 | %endif |
99 | %if %{with python3} | |
100 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
101 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
e9a88037 JR |
102 | |
103 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \ | |
104 | $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py | |
17a79f18 AM |
105 | %endif |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %if %{with python2} | |
111 | %files | |
112 | %defattr(644,root,root,755) | |
429ee303 AM |
113 | %doc Changes.rst |
114 | %attr(755,root,root) %{py_sitedir}/%{module}.so | |
17a79f18 AM |
115 | %if "%{py_ver}" > "2.4" |
116 | %{py_sitedir}/llfuse-*.egg-info | |
117 | %endif | |
118 | %{_examplesdir}/%{name}-%{version} | |
119 | %endif | |
120 | ||
121 | %if %{with python3} | |
122 | %files -n python3-%{module} | |
123 | %defattr(644,root,root,755) | |
429ee303 AM |
124 | %doc Changes.rst |
125 | %attr(755,root,root) %{py3_sitedir}/%{module}.*.so | |
17a79f18 AM |
126 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info |
127 | %{_examplesdir}/python3-%{module}-%{version} | |
128 | %endif | |
129 | ||
130 | %if %{with doc} | |
131 | %files apidocs | |
132 | %defattr(644,root,root,755) | |
133 | %doc docs/_build/html/* | |
134 | %endif |