]> git.pld-linux.org Git - packages/python-llfuse.git/blob - python-llfuse.spec
6c866b9e5ff6fc680d3cd8ffed40276bb617705e
[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:        0.40
11 Release:        1
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/
17 BuildRequires:  libfuse-devel >= 2.8.0
18 BuildRequires:  rpm-pythonprov
19 %if %{with python2}
20 BuildRequires:  python-devel
21 BuildRequires:  python-distribute
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-devel
25 BuildRequires:  python3-distribute
26 BuildRequires:  python3-modules
27 %endif
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 Python bindings for the low level FUSE API.
32
33 %package -n python3-%{module}
34 Summary:        Python bindings for the low level FUSE API
35 Group:          Libraries/Python
36
37 %description -n python3-%{module}
38 Python bindings for the low level FUSE API.
39
40 %package apidocs
41 Summary:        %{module} API documentation
42 Summary(pl.UTF-8):      Dokumentacja API %{module}
43 Group:          Documentation
44
45 %description apidocs
46 API documentation for %{module}.
47
48 %description apidocs -l pl.UTF-8
49 Dokumentacja API %{module}.
50
51 %prep
52 %setup -q -n %{module}-%{version}
53
54 %build
55 %if %{with python2}
56 CC="%{__cc}" \
57 CFLAGS="%{rpmcflags}" \
58 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
59 %endif
60
61 %if %{with python3}
62 CC="%{__cc}" \
63 CFLAGS="%{rpmcflags}" \
64 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
65 %endif
66
67 %if %{with doc}
68 cd docs
69 %{__make} -j1 html
70 rm -rf _build/html/_sources
71 %endif
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75
76 %if %{with python2}
77 %{__python} setup.py \
78         build --build-base build-2 \
79         install --skip-build \
80         --optimize=2 \
81         --root=$RPM_BUILD_ROOT
82
83 %py_postclean
84 %endif
85
86 %if %{with python3}
87 %{__python3} setup.py \
88         build --build-base build-3 \
89         install --skip-build \
90         --optimize=2 \
91         --root=$RPM_BUILD_ROOT
92 %endif
93
94 # in case there are examples provided
95 %if %{with python2}
96 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
97 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
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}
102 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
103         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
104 %endif
105
106 %clean
107 rm -rf $RPM_BUILD_ROOT
108
109 %if %{with python2}
110 %files
111 %defattr(644,root,root,755)
112 %doc Changes.txt
113 %dir %{py_sitedir}/llfuse
114 %{py_sitedir}/llfuse/*.py[co]
115 %attr(755,root,root) %{py_sitedir}/llfuse/*.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.txt
126 %dir %{py3_sitedir}/%{module}
127 %{py3_sitedir}/%{module}/*.py*
128 %{py3_sitedir}/%{module}/__pycache__
129 %attr(755,root,root) %{py3_sitedir}/%{module}/capi*.so
130 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
131 %{_examplesdir}/python3-%{module}-%{version}
132 %endif
133
134 %if %{with doc}
135 %files apidocs
136 %defattr(644,root,root,755)
137 %doc docs/_build/html/*
138 %endif
This page took 0.059039 seconds and 2 git commands to generate.