tizen 2.0
[external/module-init-tools.git] / packaging / module-init-tools.spec
1 #sbs-git:slp/pkgs/m/module-init-tools module-init-tools 3.12~pre2 be160e833cedd1ceb8f0543339d7bb1850cbd75a
2
3 Name:           module-init-tools
4 Version: 3.12~pre2
5 Release:        2
6 License:        GPLv2+
7 Summary:        Kernel module management utilities
8 Group:          System/Kernel
9 Source0:         http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-%{version}.tar.gz
10 Source1:        module-init-tools.init
11 Patch0:         document_depmod_m
12 Patch1:         blacklist-warn.diff
13 Patch2:         no_maps_by_default
14 Patch3:         modprobe_bad_output
15 BuildRequires:  glibc-static
16 BuildRequires:  zlib-static
17 BuildRequires:  pkgconfig(zlib)
18
19 %description
20 The module-init-tools package includes various programs needed for automatic
21 loading and unloading of modules under 2.6 and later kernels, as well
22 as other module management programs. Device drivers and filesystems
23 are two examples of loaded and unloaded modules.
24
25 %prep
26 %setup -q -n module-init-tools-%{version}
27 %patch0 -p1
28
29 %build
30 %configure --disable-zlib --disable-static-utils --prefix=/
31
32 make
33
34 %install
35
36 %define BUILDDIR build
37
38 mkdir -p %{buildroot}/bin/
39 mkdir -p %{buildroot}/sbin/
40 mkdir -p %{buildroot}/etc/modprobe.d/
41 mkdir -p %{buildroot}/lib/modules
42
43 cp -af %{BUILDDIR}/lsmod %{buildroot}/bin/
44 cp -af %{BUILDDIR}/insmod \
45        %{BUILDDIR}/modprobe \
46        %{BUILDDIR}/rmmod \
47        %{BUILDDIR}/depmod \
48        %{BUILDDIR}/modinfo \
49        %{buildroot}/sbin/
50
51 ln -s /bin/lsmod %{buildroot}/sbin/lsmod
52
53 cp extra/modprobe.d/aliases.conf %{buildroot}/etc/modprobe.d/
54
55 mkdir -p %{buildroot}/etc/init.d/
56 cp %{_sourcedir}/module-init-tools.init %{buildroot}/etc/init.d/module-init-tools
57 chmod +x %{buildroot}/etc/init.d/module-init-tools
58
59
60 %clean
61 rm -rf %{buildroot}
62
63 %post
64 create_etc_modules() {
65     if [ ! -e /etc/modules ]; then
66         cat <<EOT > /etc/modules
67 # /etc/modules: kernel modules to load at boot time.
68 #   
69 # This file contains the names of kernel modules that should be loaded
70 # at boot time, one per line. Lines beginning with "#" are ignored.
71 # Parameters can be specified after the module name.
72       
73 EOT
74         chmod 644 /etc/modules
75     fi
76 }
77 create_etc_modules
78
79 %files
80 %defattr(-,root,root)
81 /etc/init.d/module-init-tools
82 /etc/modprobe.d/aliases.conf
83 /bin/*
84 /sbin/*
85 %dir /lib/modules
86