source: projects/specs/trunk/i/iscsitarget/iscsitarget-kmp.spec @ 524

Revision 524, 2.0 KB checked in by daisuke, 13 years ago (diff)

add iscsitarget-kmp.spec

Line 
1%define kmod_name ##KMOD_NAME##
2%define kmod_ver  ##KMOD_VER##
3
4%define kversion %(uname -r)
5%define kver    %(uname -r | sed -e 's/-/_/g')
6%define kflavor %(uname -r | sed -e 's/.*vl.//')
7%if "%kflavor" == ""
8%undefine kflavor
9%endif
10
11Name: kmod-%{kmod_name}%{?kflavor:-%{kflavor}}-source
12Version: %(echo %{kmod_ver} | sed -e 's/-.*//g')
13Release: %(echo %{kmod_ver} | sed -e 's/.*-//g')
14License: ##LICENSE##
15Group: System Environment/Kernel
16Summary: source of %{kmod_name} kernel module
17
18Source: %{kmod_name}-%{kmod_ver}.tar.bz2
19
20BuildRequires: dkms >= 2.0.21.1-2vl5
21
22BuildRoot: %{_tmppath}/%{name}-%{version}-root
23
24
25%description
26source of %{kmod_name} kernel module
27
28
29%package -n kmod-%{kmod_name}%{?kflavor:-%{kflavor}}
30Version: %(echo %{kmod_ver} | sed -e 's/-.*//g')_%{kver}
31Release: %(echo %{kmod_ver} | sed -e 's/.*-//g')
32Requires: kernel = %{kversion}
33Group: System Environment/Kernel
34Summary: prebuilt %{kmod_name} module for kernel %{version}%{?kflavor:-%{kflavor}}
35
36%description -n kmod-%{kmod_name}%{?kflavor:-%{kflavor}}
37source of prebuilt %{kmod_name} module for kernel %{version}%{?kflavor:-%{kflavor}}
38
39
40%prep
41%setup -q -n %{kmod_name}-%{kmod_ver}
42
43
44%build
45
46
47%install
48rm -rf %{buildroot}
49
50mkdir -p %{buildroot}/var/lib/dkms
51mkdir -p %{buildroot}/lib/modules/%{kversion}
52
53dkms add              -m %{kmod_name} -v %{kmod_ver} -c dkms.conf \
54        --dkmstree %{buildroot}/var/lib/dkms
55dkms build            -m %{kmod_name} -v %{kmod_ver} -c dkms.conf \
56        --dkmstree %{buildroot}/var/lib/dkms
57dkms install-fakeroot -m %{kmod_name} -v %{kmod_ver} -c dkms.conf \
58        --dkmstree %{buildroot}/var/lib/dkms \
59        --installtree %{buildroot}/lib/modules
60
61find %{buildroot}/lib/modules/%{kversion} -name "*.ko" | \
62        sed -e "s|%{buildroot}||" > kmod.filelist
63
64rm -rf %{buildroot}/var
65
66
67%post -n kmod-%{kmod_name}%{?kflavor:-%{kflavor}}
68/sbin/depmod -a -F /boot/System.map-%{kversion} %{kversion}
69
70
71%files -n kmod-%{kmod_name}%{?kflavor:-%{kflavor}} -f kmod.filelist
72%defattr(-,root,root,0744)
73
74
75%changelog
76* Sun Apr 26 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org>
77- initial kmp spec file
Note: See TracBrowser for help on using the repository browser.