/[packages]/cauldron/kmod-vboxadditions/current/SPECS/kmod-vboxadditions.spec
ViewVC logotype

Contents of /cauldron/kmod-vboxadditions/current/SPECS/kmod-vboxadditions.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 810422 - (show annotations) (download)
Tue Jan 13 17:44:33 2015 UTC (4 years, 10 months ago) by tmb
File size: 4878 byte(s)
switch dkms install to posttrans
1 # define driver name, version and release
2 %define drvname vboxadditions
3 %define drvver 4.3.20
4 %define drvrel 1.mga5
5
6 # define core kernel version we build against
7 %define kernver 3.18.1
8 %define kernrel 4.mga5
9
10 # where to build
11 %define topdir ${RPM_BUILD_DIR}/%{name}-%{_arch}
12
13 # source package
14 Name: kmod-%{drvname}
15 Version: %{drvver}
16 Release: %mkrel 10
17 Summary: Prebuilt %{drvname} modules for kernel-%{kernver}-%{kernrel}
18 License: GPLv2
19 URL: http://www.virtualbox.org/
20 Group: System/Kernel and hardware
21 ExclusiveArch: %{ix86} x86_64
22
23 BuildRequires: dkms-%{drvname} = %{drvver}-%{drvrel}
24 %ifarch %{ix86}
25 BuildRequires: kernel-desktop586-devel-%{kernver}-%{kernrel}
26 %endif
27 BuildRequires: kernel-desktop-devel-%{kernver}-%{kernrel}
28 BuildRequires: kernel-server-devel-%{kernver}-%{kernrel}
29
30 %description
31 This package creates prebuilt %{drvname} kernel modules for core kernel.
32
33
34 # obsoletes prebuilt -netbook-latest modules with matching -desktop-latest
35 %define latest_obsoletes_desktop %{drvname}-kernel-netbook-latest < 4.2.4-2
36 %define latest_provides_desktop %{drvname}-kernel-netbook-latest = %{drvver}-%{release}
37
38 ##### mkflavour() ala core kernel #####
39 %define mkflavour() \
40 %package -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
41 Summary: %{drvname} driver for kernel-%{1}-%{kernver}-%{kernrel} \
42 License: GPLv1 \
43 URL: http://www.virtualbox.org/ \
44 Group: System/Kernel and hardware \
45 Provides: kmod(vboxguest.ko) = %{version} \
46 Provides: kmod(vboxsf.ko) = %{version} \
47 Provides: kmod(vboxvideo.ko) = %{version} \
48 Requires(post): dkms-minimal \
49 Requires(preun): dkms-minimal \
50 Requires: kernel-%{1}-%{kernver}-%{kernrel} \
51 Requires(post): kernel-%{1}-%{kernver}-%{kernrel} \
52 Requires(preun): kernel-%{1}-%{kernver}-%{kernrel} \
53 Recommends: %{drvname}-kernel-%{1}-latest \
54 %ifarch %{ix86} \
55 Conflicts: arch(x86_64) \
56 %endif \
57 \
58 %description -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
59 Prebuilt dkms binary kernel modules for the %{drvname} driver version %{drvver} \
60 built for kernel-%{1}-%{kernver}-%{kernrel}. \
61 \
62 %files -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
63 %dir /var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-%{1}-%{kernrel} \
64 /var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-%{1}-%{kernrel}/* \
65 \
66 %posttrans -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
67 %{_sbindir}/dkms install --binary -m %{drvname} -v %{drvver}-%{drvrel} -k %{kernver}-%{1}-%{kernrel} --rpm_safe_upgrade \
68 %{_sbindir}/dkms status -m %{drvname} -v %{drvver}-%{drvrel} \
69 \
70 %preun -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
71 %{_sbindir}/dkms uninstall --binary -m %{drvname} -v %{drvver}-%{drvrel} -k %{kernver}-%{1}-%{kernrel} --rpm_safe_upgrade \
72 \
73 \
74 %package -n %{drvname}-kernel-%{1}-latest \
75 Summary: Virtual rpm for latest %{drvname}-kernel-%{1} driver \
76 License: GPLv2 \
77 URL: http://www.virtualbox.org/ \
78 Group: System/Kernel and hardware \
79 Requires: %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} = %{version}-%{release} \
80 %{expand:%%{?latest_obsoletes_%{1}:Obsoletes: %{latest_obsoletes_%{1}}}} \
81 %{expand:%%{?latest_provides_%{1}:Provides: %{latest_provides_%{1}}}} \
82 %ifarch %{ix86} \
83 Conflicts: arch(x86_64) \
84 %endif \
85 \
86 %description -n %{drvname}-kernel-%{1}-latest \
87 This package is a virtual rpm that aims to make sure you always have the \
88 latest prebuilt %{drvname} driver for kernel-%{1}. \
89 \
90 %files -n %{drvname}-kernel-%{1}-latest
91
92 %ifarch %{ix86}
93 %mkflavour desktop586
94 %endif
95
96 %mkflavour desktop
97 %mkflavour server
98
99
100 %prep
101 rm -rf %{topdir}
102
103 %build
104 %{_sbindir}/dkms add -m %{drvname} -v %{drvver}-%{drvrel} --dkmstree %{topdir}/var/lib/dkms-binary
105 %ifarch %{ix86}
106 %{_sbindir}/dkms build --no-prepare-kernel --no-clean-kernel -m %{drvname} -v %{drvver}-%{drvrel} \
107 -k %{kernver}-desktop586-%{kernrel} --kernelsourcedir /usr/src/kernel-%{kernver}-desktop586-%{kernrel} \
108 --dkmstree %{topdir}/var/lib/dkms-binary
109 %endif
110 for flavour in desktop server; do
111 %{_sbindir}/dkms build --no-prepare-kernel --no-clean-kernel -m %{drvname} -v %{drvver}-%{drvrel} \
112 -k %{kernver}-$flavour-%{kernrel} --kernelsourcedir /usr/src/kernel-%{kernver}-$flavour-%{kernrel} \
113 --dkmstree %{topdir}/var/lib/dkms-binary
114 done
115
116 %install
117 mkdir -p %{buildroot}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}
118 cp -a %{topdir}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-*-%{kernrel} \
119 %{buildroot}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/
120 for dir in %{buildroot}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-*-%{kernrel}; do
121 cp -a /usr/src/%{drvname}-%{drvver}-%{drvrel}/dkms.conf $dir/
122 xz -6e $dir/*/module/vbox*.ko ||:
123 done

  ViewVC Help
Powered by ViewVC 1.1.26