]> git.pld-linux.org Git - packages/i2c-tools.git/blob - i2c-tools.spec
rebuild with python 3.10
[packages/i2c-tools.git] / i2c-tools.spec
1 #
2 # Conditional build:
3 %bcond_without  python  # (any) Python smbus module
4 %bcond_without  python2 # CPython 2.x smbus module
5 %bcond_without  python3 # CPython 3.x smbus module
6 #
7 Summary:        I2C tools for Linux
8 Summary(en.UTF-8):      I²C tools for Linux
9 Summary(pl.UTF-8):      Narzędzia I²C dla Linuksa
10 Name:           i2c-tools
11 Version:        4.3
12 Release:        2
13 License:        GPL v2+
14 Group:          Applications/System
15 Source0:        https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.xz
16 # Source0-md5:  0c42800f746e064dc40a4dad44ed8a33
17 Patch0:         %{name}-python.patch
18 URL:            https://i2c.wiki.kernel.org/index.php/I2C_Tools
19 BuildRequires:  perl-modules >= 1:5.6
20 %if %{with python}
21 %{?with_python2:BuildRequires:  python-devel >= 2}
22 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
23 %endif
24 BuildRequires:  rpm-perlprov >= 3.0.3-16
25 BuildRequires:  rpm-pythonprov >= 1.714
26 BuildRequires:  tar >= 1:1.22
27 BuildRequires:  xz
28 Requires:       dev >= 2.9.0-13
29 Requires:       libi2c = %{version}-%{release}
30 Requires:       uname(release) >= 2.6.5
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 I2C tools for Linux.
35
36 %description -l en.UTF-8
37 I²C tools for Linux.
38
39 %description -l pl.UTF-8
40 Narzędzia I²C dla Linuksa.
41
42 %package -n libi2c
43 Summary:        I2C/SMBus bus access library
44 Summary(pl.UTF-8):      Biblioteka dostępu do szyny I2C/SMBus
45 Group:          Libraries
46
47 %description -n libi2c
48 I2C/SMBus bus access library.
49
50 %description -n libi2c -l pl.UTF-8
51 Biblioteka dostępu do szyny I2C/SMBus.
52
53 %package -n libi2c-devel
54 Summary:        Header file for libi2c library
55 Summary(pl.UTF-8):      Plik nagłówkowy biblioteki libi2c
56 Group:          Development/Libraries
57 Requires:       libi2c = %{version}-%{release}
58
59 %description -n libi2c-devel
60 Header file for libi2c library.
61
62 %description -n libi2c-devel -l pl.UTF-8
63 Plik nagłówkowy biblioteki libi2c.
64
65 %package -n libi2c-static
66 Summary:        Static libi2c library
67 Summary(pl.UTF-8):      Statyczna biblioteka libi2c
68 Group:          Development/Libraries
69 Requires:       libi2c-devel = %{version}-%{release}
70
71 %description -n libi2c-static
72 Static libi2c library.
73
74 %description -n libi2c-static -l pl.UTF-8
75 Statyczna biblioteka libi2c.
76
77 %package -n python-smbus
78 Summary:        Python 2 SMBus module
79 Summary(pl.UTF-8):      Moduł Pythona 2 SMBus
80 Group:          Libraries/Python
81 Requires:       libi2c = %{version}-%{release}
82
83 %description -n python-smbus
84 Python 2 bindings for Linux SMBus access through i2c-dev.
85
86 %description -n python-smbus -l pl.UTF-8
87 Wiązania Pythona 2 służące do dostępu do szyny SMBus spod Linuksa
88 poprzez i2c-dev.
89
90 %package -n python3-smbus
91 Summary:        Python 3 SMBus module
92 Summary(pl.UTF-8):      Moduł Pythona 3 SMBus
93 Group:          Libraries/Python
94 Requires:       libi2c = %{version}-%{release}
95
96 %description -n python3-smbus
97 Python 3 bindings for Linux SMBus access through i2c-dev.
98
99 %description -n python3-smbus -l pl.UTF-8
100 Wiązania Pythona 3 służące do dostępu do szyny SMBus spod Linuksa
101 poprzez i2c-dev.
102
103 %prep
104 %setup -q
105 %patch0 -p1
106
107 %build
108 %{__make} -j1 \
109         CC="%{__cc}" \
110         CFLAGS="%{rpmcflags}" \
111         EXTRA="eeprog"
112
113 %if %{with python}
114 cd py-smbus
115 %if %{with python2}
116 %py_build
117 %endif
118 %if %{with python3}
119 %py3_build
120 %endif
121 %endif
122
123 %install
124 rm -rf $RPM_BUILD_ROOT
125
126 %{__make} install \
127         DESTDIR=$RPM_BUILD_ROOT \
128         EXTRA="eeprog" \
129         PREFIX=%{_prefix} \
130         libdir=%{_libdir}
131
132 %if %{with python}
133 cd py-smbus
134 %if %{with python2}
135 %py_install
136 %endif
137 %if %{with python3}
138 %py3_install
139 %endif
140 %endif
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %post   -n libi2c -p /sbin/ldconfig
146 %postun -n libi2c -p /sbin/ldconfig
147
148 %files
149 %defattr(644,root,root,755)
150 %doc CHANGES README eeprog/README.eeprog
151 %attr(755,root,root) %{_bindir}/ddcmon
152 %attr(755,root,root) %{_bindir}/decode-dimms
153 %attr(755,root,root) %{_bindir}/decode-edid
154 %attr(755,root,root) %{_bindir}/decode-vaio
155 %attr(755,root,root) %{_sbindir}/eeprog
156 %attr(755,root,root) %{_sbindir}/i2cdetect
157 %attr(755,root,root) %{_sbindir}/i2cdump
158 %attr(755,root,root) %{_sbindir}/i2cget
159 %attr(755,root,root) %{_sbindir}/i2cset
160 %attr(755,root,root) %{_sbindir}/i2ctransfer
161 %attr(755,root,root) %{_sbindir}/i2c-stub-from-dump
162 %{_mandir}/man1/decode-dimms.1*
163 %{_mandir}/man1/decode-vaio.1*
164 %{_mandir}/man8/i2cdetect.8*
165 %{_mandir}/man8/eeprog.8*
166 %{_mandir}/man8/i2cdump.8*
167 %{_mandir}/man8/i2cget.8*
168 %{_mandir}/man8/i2cset.8*
169 %{_mandir}/man8/i2ctransfer.8*
170 %{_mandir}/man8/i2c-stub-from-dump.8*
171
172 %files -n libi2c
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{_libdir}/libi2c.so.*.*.*
175 %attr(755,root,root) %ghost %{_libdir}/libi2c.so.0
176
177 %files -n libi2c-devel
178 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_libdir}/libi2c.so
180 %dir %{_includedir}/i2c
181 %{_includedir}/i2c/smbus.h
182 %{_mandir}/man3/libi2c.3*
183
184 %files -n libi2c-static
185 %defattr(644,root,root,755)
186 %{_libdir}/libi2c.a
187
188 %if %{with python2}
189 %files -n python-smbus
190 %defattr(644,root,root,755)
191 %doc py-smbus/README
192 %attr(755,root,root) %{py_sitedir}/smbus.so
193 %{py_sitedir}/smbus-1.1-py*.egg-info
194 %endif
195
196 %if %{with python3}
197 %files -n python3-smbus
198 %defattr(644,root,root,755)
199 %doc py-smbus/README
200 %attr(755,root,root) %{py3_sitedir}/smbus.cpython-*.so
201 %{py3_sitedir}/smbus-1.1-py*.egg-info
202 %endif
This page took 0.238201 seconds and 3 git commands to generate.