]> git.pld-linux.org Git - packages/python-llfuse.git/blob - python-llfuse.spec
23c470bdddc7f307c709997a1d5702cb2f330a94
[packages/python-llfuse.git] / python-llfuse.spec
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:        1.3.6
11 Release:        1
12 License:        GPL v2
13 Group:          Libraries/Python
14 Source0:        https://pypi.debian.net/llfuse/%{module}-%{version}.tar.bz2
15 # Source0-md5:  4996674fa327c6c93174c1f71961ac6c
16 Patch0:         x32.patch
17 URL:            https://github.com/python-llfuse/python-llfuse
18 BuildRequires:  rpmbuild(macros) >= 1.710
19 BuildRequires:  libfuse-devel >= 2.8.0
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  python-Cython
22 %if %{with python2}
23 BuildRequires:  python-devel
24 BuildRequires:  python-distribute
25 BuildRequires:  python-contextlib2
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-devel
29 BuildRequires:  python3-distribute
30 BuildRequires:  python3-contextlib2
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}
58 %ifarch x32
59 %patch0 -p1
60 %endif
61
62 %build
63 ./setup.py build_cython
64
65 %if %{with python2}
66 %py_build %{?with_tests:test}
67 %endif
68
69 %if %{with python3}
70 %py3_build %{?with_tests:test}
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}
83 %py_install
84
85 %py_postclean
86 %endif
87
88 %if %{with python3}
89 %py3_install
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}
96
97 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python}\1,' \
98       $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
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}
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
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %files
113 %defattr(644,root,root,755)
114 %doc Changes.rst
115 %attr(755,root,root) %{py_sitedir}/%{module}.so
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)
125 %doc Changes.rst
126 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
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
This page took 0.073687 seconds and 2 git commands to generate.