]> git.pld-linux.org Git - packages/i2c-tools.git/commitdiff
- new URLs, updated to 4.0
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 3 Dec 2017 19:07:52 +0000 (20:07 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 3 Dec 2017 19:07:52 +0000 (20:07 +0100)
- added libi2c-* packages and python3 module

i2c-tools.spec

index 2f785870c74fd1d1264de480d243e4e54434ac48..bb7747dc4618f623aa1e26d3c273aa3d3bbe7824 100644 (file)
@@ -1,26 +1,31 @@
 #
 # Conditional build:
-%bcond_without python  # Python smbus module
+%bcond_without python  # (any) Python smbus module
+%bcond_without python2 # CPython 2.x smbus module
+%bcond_without python3 # CPython 3.x smbus module
 #
 %include       /usr/lib/rpm/macros.perl
 Summary:       I2C tools for Linux
 Summary(en.UTF-8):     I²C tools for Linux
 Summary(pl.UTF-8):     Narzędzia I²C dla Linuksa
 Name:          i2c-tools
-Version:       3.1.2
-Release:       3
+Version:       4.0
+Release:       1
 License:       GPL v2+
 Group:         Applications/System
-# lm-sensors.org is dead (Jul 2017, since a few months);
-# now releases are available at https://www.kernel.org/pub/software/utils/i2c-tools/
-Source0:       http://dl.lm-sensors.org/i2c-tools/releases/%{name}-%{version}.tar.bz2
-# Source0-md5: 7104a1043d11a5e2c7b131614eb1b962
+Source0:       https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.xz
+# Source0-md5: f873c657d00bc00e9c47ed938c2cd770
 Patch0:                %{name}-python.patch
-URL:           http://www.lm-sensors.org/wiki/I2CTools
+URL:           https://i2c.wiki.kernel.org/index.php/I2C_Tools
 BuildRequires: perl-modules >= 1:5.6
-%{?with_python:BuildRequires:  python-devel >= 2}
+%if %{with python}
+%{?with_python2:BuildRequires: python-devel >= 2}
+%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
+%endif
 BuildRequires: rpm-perlprov >= 3.0.3-16
+BuildRequires: rpm-pythonprov >= 1.714
 Requires:      dev >= 2.9.0-13
+Requires:      libi2c = %{version}-%{release}
 Requires:      uname(release) >= 2.6.5
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -33,16 +38,65 @@ I²C tools for Linux.
 %description -l pl.UTF-8
 Narzędzia I²C dla Linuksa.
 
+%package -n libi2c
+Summary:       I2C/SMBus bus access library
+Summary(pl.UTF-8):     Biblioteka dostępu do szyny I2C/SMBus
+Group:         Libraries
+
+%description -n libi2c
+I2C/SMBus bus access library.
+
+%description -n libi2c -l pl.UTF-8
+Biblioteka dostępu do szyny I2C/SMBus.
+
+%package -n libi2c-devel
+Summary:       Header file for libi2c library
+Summary(pl.UTF-8):     Plik nagłówkowy biblioteki libi2c
+Group:         Development/Libraries
+Requires:      libi2c = %{version}-%{release}
+
+%description -n libi2c-devel
+Header file for libi2c library.
+
+%description -n libi2c-devel -l pl.UTF-8
+Plik nagłówkowy biblioteki libi2c.
+
+%package -n libi2c-static
+Summary:       Static libi2c library
+Summary(pl.UTF-8):     Statyczna biblioteka libi2c
+Group:         Development/Libraries
+Requires:      libi2c-devel = %{version}-%{release}
+
+%description -n libi2c-static
+Static libi2c library.
+
+%description -n libi2c-static -l pl.UTF-8
+Statyczna biblioteka libi2c.
+
 %package -n python-smbus
-Summary:       Python SMBus module
-Summary(pl.UTF-8):     Moduł Pythona SMBus
+Summary:       Python SMBus module
+Summary(pl.UTF-8):     Moduł Pythona SMBus
 Group:         Libraries/Python
+Requires:      libi2c = %{version}-%{release}
 
 %description -n python-smbus
-Python bindings for Linux SMBus access through i2c-dev.
+Python bindings for Linux SMBus access through i2c-dev.
 
 %description -n python-smbus -l pl.UTF-8
-Wiązania Pythona służące do dostępu do szyny SMBus spod Linuksa
+Wiązania Pythona 2 służące do dostępu do szyny SMBus spod Linuksa
+poprzez i2c-dev.
+
+%package -n python3-smbus
+Summary:       Python 3 SMBus module
+Summary(pl.UTF-8):     Moduł Pythona 3 SMBus
+Group:         Libraries/Python
+Requires:      libi2c = %{version}-%{release}
+
+%description -n python3-smbus
+Python 3 bindings for Linux SMBus access through i2c-dev.
+
+%description -n python3-smbus -l pl.UTF-8
+Wiązania Pythona 3 służące do dostępu do szyny SMBus spod Linuksa
 poprzez i2c-dev.
 
 %prep
@@ -55,33 +109,53 @@ poprzez i2c-dev.
 %{__make} \
        CC="%{__cc}" \
        CFLAGS="%{rpmcflags}" \
-       %{?with_python:EXTRA=py-smbus}
+       EXTRA="eeprog"
 
 %{__make} -C eepromer \
        CC="%{__cc}" \
        CFLAGS="%{rpmcflags} -I../include -Wall"
 
+%if %{with python}
+cd py-smbus
+%if %{with python2}
+%py_build
+%endif
+%if %{with python3}
+%py3_build
+%endif
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT \
-       %{?with_python:EXTRA=py-smbus} \
+       EXTRA="eeprog" \
        prefix=%{_prefix} \
        mandir=%{_mandir}
 
-install eepromer/{eeprog,eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
-cp -p eepromer/{eeprog,eeprom,eepromer}.8 $RPM_BUILD_ROOT%{_mandir}/man8
+install eepromer/{eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
+cp -p eepromer/{eeprom,eepromer}.8 $RPM_BUILD_ROOT%{_mandir}/man8
 
-# enhanced (more 2.4-compatible) private copy; public header already in llh
-%{__rm} $RPM_BUILD_ROOT%{_includedir}/linux/i2c-dev.h
+%if %{with python}
+cd py-smbus
+%if %{with python2}
+%py_install
+%endif
+%if %{with python3}
+%py3_install
+%endif
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post  -n libi2c -p /sbin/ldconfig
+%postun        -n libi2c -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
-%doc CHANGES README eepromer/README.ee*
+%doc CHANGES README eeprog/README.eeprog eepromer/README.ee*
 %attr(755,root,root) %{_bindir}/ddcmon
 %attr(755,root,root) %{_bindir}/decode-dimms
 %attr(755,root,root) %{_bindir}/decode-edid
@@ -93,6 +167,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_sbindir}/i2cdump
 %attr(755,root,root) %{_sbindir}/i2cget
 %attr(755,root,root) %{_sbindir}/i2cset
+%attr(755,root,root) %{_sbindir}/i2ctransfer
 %attr(755,root,root) %{_sbindir}/i2c-stub-from-dump
 %{_mandir}/man1/decode-dimms.1*
 %{_mandir}/man1/decode-vaio.1*
@@ -103,12 +178,36 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/i2cdump.8*
 %{_mandir}/man8/i2cget.8*
 %{_mandir}/man8/i2cset.8*
+%{_mandir}/man8/i2ctransfer.8*
 %{_mandir}/man8/i2c-stub-from-dump.8*
 
-%if %{with python}
+%files -n libi2c
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libi2c.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libi2c.so.0
+
+%files -n libi2c-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libi2c.so
+%dir %{_includedir}/i2c
+%{_includedir}/i2c/smbus.h
+
+%files -n libi2c-static
+%defattr(644,root,root,755)
+%{_libdir}/libi2c.a
+
+%if %{with python2}
 %files -n python-smbus
 %defattr(644,root,root,755)
 %doc py-smbus/README
 %attr(755,root,root) %{py_sitedir}/smbus.so
 %{py_sitedir}/smbus-1.1-py*.egg-info
 %endif
+
+%if %{with python3}
+%files -n python3-smbus
+%defattr(644,root,root,755)
+%doc py-smbus/README
+%attr(755,root,root) %{py3_sitedir}/smbus.cpython-*.so
+%{py3_sitedir}/smbus-1.1-py*.egg-info
+%endif
This page took 0.074906 seconds and 4 git commands to generate.