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