]>
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} | |
429ee303 AM |
10 | Version: 1.3.4 |
11 | Release: 1 | |
17a79f18 AM |
12 | License: GPL v2 |
13 | Group: Libraries/Python | |
429ee303 AM |
14 | Source0: https://bitbucket.org/nikratio/python-llfuse/downloads/%{module}-%{version}.tar.bz2 |
15 | # Source0-md5: 43a123c46d5438f15cd6bcafa16a0094 | |
16 | Patch0: build.patch | |
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 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-distribute | |
429ee303 | 24 | BuildRequires: python-contextlib2 |
17a79f18 AM |
25 | %endif |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel | |
28 | BuildRequires: python3-distribute | |
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} | |
429ee303 | 57 | %patch0 -p1 |
17a79f18 AM |
58 | |
59 | %build | |
60 | %if %{with python2} | |
3c47d7d9 | 61 | %py_build %{?with_tests:test} |
17a79f18 AM |
62 | %endif |
63 | ||
64 | %if %{with python3} | |
3c47d7d9 | 65 | %py3_build %{?with_tests:test} |
17a79f18 AM |
66 | %endif |
67 | ||
68 | %if %{with doc} | |
69 | cd docs | |
70 | %{__make} -j1 html | |
71 | rm -rf _build/html/_sources | |
72 | %endif | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %if %{with python2} | |
3c47d7d9 | 78 | %py_install |
17a79f18 AM |
79 | |
80 | %py_postclean | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
3c47d7d9 | 84 | %py3_install |
17a79f18 AM |
85 | %endif |
86 | ||
87 | # in case there are examples provided | |
88 | %if %{with python2} | |
89 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
90 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
91 | %endif | |
92 | %if %{with python3} | |
93 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
94 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
95 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
96 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
97 | %endif | |
98 | ||
99 | %clean | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %files | |
104 | %defattr(644,root,root,755) | |
429ee303 AM |
105 | %doc Changes.rst |
106 | %attr(755,root,root) %{py_sitedir}/%{module}.so | |
17a79f18 AM |
107 | %if "%{py_ver}" > "2.4" |
108 | %{py_sitedir}/llfuse-*.egg-info | |
109 | %endif | |
110 | %{_examplesdir}/%{name}-%{version} | |
111 | %endif | |
112 | ||
113 | %if %{with python3} | |
114 | %files -n python3-%{module} | |
115 | %defattr(644,root,root,755) | |
429ee303 AM |
116 | %doc Changes.rst |
117 | %attr(755,root,root) %{py3_sitedir}/%{module}.*.so | |
17a79f18 AM |
118 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info |
119 | %{_examplesdir}/python3-%{module}-%{version} | |
120 | %endif | |
121 | ||
122 | %if %{with doc} | |
123 | %files apidocs | |
124 | %defattr(644,root,root,755) | |
125 | %doc docs/_build/html/* | |
126 | %endif |