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