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