| 1 | ###The only customizable variables are prefix and kversion. |
|---|
| 2 | ###If you have used a custom tug in the vesrion of your |
|---|
| 3 | ###kernel rpm, you may need to adjust mversion as well. |
|---|
| 4 | |
|---|
| 5 | ###This package IS relocatable (change prefix to relocate). |
|---|
| 6 | |
|---|
| 7 | %define prefix /usr/local |
|---|
| 8 | |
|---|
| 9 | #Distribution vendors who would like to integrate the package should |
|---|
| 10 | #probably use: %define prefix /usr |
|---|
| 11 | |
|---|
| 12 | #WARNING!!! This package must be compiled for the the same kernel that will |
|---|
| 13 | #run on the target machine. This implies the same kernel version and the |
|---|
| 14 | #same kernel configuration. Thus, the binary packages can be provided by |
|---|
| 15 | #distribution vendors only for their stock distribution kernels. If you use |
|---|
| 16 | #a custom configured kernel, you must rebuild this package. To protect the |
|---|
| 17 | #innocent, we define kversion and make the resulting package dependable |
|---|
| 18 | #on the specific version of the kernel. |
|---|
| 19 | |
|---|
| 20 | #Define your kernel version here. |
|---|
| 21 | %define kversion 2.2.14 |
|---|
| 22 | %define mversion %{kversion} |
|---|
| 23 | |
|---|
| 24 | #Another example for the above: %define kversion 2.2.14-SMP |
|---|
| 25 | |
|---|
| 26 | %define name kernel-i2c |
|---|
| 27 | %define ver 2.5.0 |
|---|
| 28 | Summary: Updated i2c drivers |
|---|
| 29 | Name: %{name} |
|---|
| 30 | Version: %{ver} |
|---|
| 31 | Release: 1 |
|---|
| 32 | Group: Base/Kernel |
|---|
| 33 | |
|---|
| 34 | #Latest RedHat distributions define a different Group: Group: System Environment/Kernel |
|---|
| 35 | |
|---|
| 36 | Copyright: GPL |
|---|
| 37 | Source0: http://www.lm-sensors.nu/lm-sensors/archive/i2c-%{ver}.tar.gz |
|---|
| 38 | Buildroot: /var/tmp/%{name}-%{ver} |
|---|
| 39 | Docdir: %{prefix}/doc |
|---|
| 40 | Url: http://www.netroedge.com/~lm78/ |
|---|
| 41 | Requires: kernel = %{kversion} |
|---|
| 42 | #The new i2c code has been integrated into kernel 2.3.38 |
|---|
| 43 | Conflicts: kernel >= 2.3.38 |
|---|
| 44 | |
|---|
| 45 | #For officially distributed packages, please sign below |
|---|
| 46 | #Packager: Lm_sensors Group <lm78@stimpy.netroedge.com> |
|---|
| 47 | |
|---|
| 48 | %description |
|---|
| 49 | This package contains the new i2c code and several bus drivers (algorithm |
|---|
| 50 | and adapter drivers). The chip drivers are not included in this package. |
|---|
| 51 | Most of the chip and bus drivers as well as additional basic code |
|---|
| 52 | for SMBus emulation over i2c are included in the lm_sensors package. |
|---|
| 53 | This package is required if you want to install programs which use the new |
|---|
| 54 | i2c implementation. Lm_sensors and video4linux (latest versions of bttv |
|---|
| 55 | driver) require the new i2c code. |
|---|
| 56 | |
|---|
| 57 | %prep |
|---|
| 58 | %setup -n i2c-%{ver} |
|---|
| 59 | |
|---|
| 60 | %build |
|---|
| 61 | #even for non-SMP systems parallel make will build faster |
|---|
| 62 | make -j4 |
|---|
| 63 | |
|---|
| 64 | %install |
|---|
| 65 | rm -rf $RPM_BUILD_ROOT |
|---|
| 66 | make install DESTDIR=$RPM_BUILD_ROOT LINUX_INCLUDE_DIR=%{prefix}/include/linux |
|---|
| 67 | |
|---|
| 68 | %post |
|---|
| 69 | depmod -a || /bin/true |
|---|
| 70 | |
|---|
| 71 | %postun |
|---|
| 72 | depmod -a || /bin/true |
|---|
| 73 | |
|---|
| 74 | %files |
|---|
| 75 | %dir /lib/modules/%{mversion} |
|---|
| 76 | %dir /lib/modules/%{mversion}/misc |
|---|
| 77 | /lib/modules/%{mversion}/misc/* |
|---|
| 78 | %dir %{prefix}/include/linux |
|---|
| 79 | %{prefix}/include/linux/*.h |
|---|
| 80 | %doc doc/* IMPORTANT_CHANGES INSTALL README TODO |
|---|
| 81 | |
|---|
| 82 | %clean |
|---|
| 83 | rm -rf $RPM_BUILD_ROOT |
|---|
| 84 | rm -rf $RPM_BUILD_DIR/i2c-%{ver} |
|---|