/[packages]/backports/8/kmod-virtualbox/current/SPECS/kmod-virtualbox.spec
ViewVC logotype

Contents of /backports/8/kmod-virtualbox/current/SPECS/kmod-virtualbox.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1899963 - (show annotations) (download)
Fri Oct 28 19:19:06 2022 UTC (20 months, 3 weeks ago) by tmb
File size: 5311 byte(s)
rebuild for virtualbox-7.0.2-1.mga8
1 # define driver name, version and release
2 %define drvname virtualbox
3 %define drvver 7.0.2
4 %define drvrel 1.mga8
5
6 # define core kernel version we build against
7 %define kernver 5.19.16
8 %define kernrel 1.mga8
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 # NOTE! use 2 + subrels to stay above updates with rel < 2
17 #define subrel 1
18 Release: %mkrel 2
19 Summary: Prebuilt %{drvname} modules for kernel-%{kernver}-%{kernrel}
20 License: GPLv2
21 URL: http://www.virtualbox.org/
22 Group: System/Kernel and hardware
23 ExclusiveArch: x86_64
24
25 BuildRequires: dkms-%{drvname} = %{drvver}-%{drvrel}
26 %ifarch %{ix86}
27 BuildRequires: kernel-desktop586-devel-%{kernver}-%{kernrel}
28 %endif
29 BuildRequires: kernel-desktop-devel-%{kernver}-%{kernrel}
30 BuildRequires: kernel-server-devel-%{kernver}-%{kernrel}
31
32 %description
33 This package creates prebuilt %{drvname} kernel modules for core kernel.
34
35
36 # obsoletes prebuilt -netbook-latest modules with matching -desktop-latest
37 %define latest_obsoletes_desktop %{drvname}-kernel-netbook-latest < 4.2.4-2
38 %define latest_provides_desktop %{drvname}-kernel-netbook-latest = %{drvver}-%{release}
39
40 ##### mkflavour() ala core kernel #####
41 %define mkflavour() \
42 %package -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
43 Summary: %{drvname} driver for kernel-%{1}-%{kernver}-%{kernrel} \
44 License: GPLv1 \
45 URL: http://www.virtualbox.org/ \
46 Group: System/Kernel and hardware \
47 Provides: kmod(vboxdrv.ko) = %{version} \
48 Provides: installonlypkg(kernel-module) \
49 Requires(post): dkms-minimal \
50 Requires(preun): dkms-minimal \
51 Requires: kernel-%{1}-%{kernver}-%{kernrel} \
52 Requires(post): kernel-%{1}-%{kernver}-%{kernrel} \
53 Requires(preun): kernel-%{1}-%{kernver}-%{kernrel} \
54 Recommends: %{drvname}-kernel-%{1}-latest \
55 %ifarch %{ix86} \
56 Conflicts: arch(x86_64) \
57 %endif \
58 \
59 %description -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
60 Prebuilt dkms binary kernel modules for the %{drvname} driver version %{drvver} \
61 built for kernel-%{1}-%{kernver}-%{kernrel}. \
62 \
63 %files -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
64 %dir /var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-%{1}-%{kernrel} \
65 /var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-%{1}-%{kernrel}/* \
66 \
67 %posttrans -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
68 %{_sbindir}/dkms install --binary -m %{drvname} -v %{drvver}-%{drvrel} -k %{kernver}-%{1}-%{kernrel} --rpm_safe_upgrade \
69 %{_sbindir}/dkms status -m %{drvname} -v %{drvver}-%{drvrel} \
70 set -x \
71 %{_sbindir}/rmmod vboxnetflt &>/dev/null \
72 %{_sbindir}/rmmod vboxnetadp &>/dev/null \
73 %{_sbindir}/rmmod vboxdrv &>/dev/null \
74 %{_sbindir}/modprobe vboxdrv &>/dev/null \
75 %{_sbindir}/modprobe vboxnetflt &>/dev/null \
76 %{_sbindir}/modprobe vboxnetadp &>/dev/null \
77 : \
78 \
79 %preun -n %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} \
80 %{_sbindir}/dkms uninstall --binary -m %{drvname} -v %{drvver}-%{drvrel} -k %{kernver}-%{1}-%{kernrel} --rpm_safe_upgrade \
81 \
82 \
83 %package -n %{drvname}-kernel-%{1}-latest \
84 Summary: Virtual rpm for latest %{drvname}-kernel-%{1} driver \
85 License: GPLv2 \
86 URL: http://www.virtualbox.org/ \
87 Group: System/Kernel and hardware \
88 Requires: %{drvname}-kernel-%{kernver}-%{1}-%{kernrel} = %{version}-%{release} \
89 %{expand:%%{?latest_obsoletes_%{1}:Obsoletes: %{latest_obsoletes_%{1}}}} \
90 %{expand:%%{?latest_provides_%{1}:Provides: %{latest_provides_%{1}}}} \
91 %ifarch %{ix86} \
92 Conflicts: arch(x86_64) \
93 %endif \
94 \
95 %description -n %{drvname}-kernel-%{1}-latest \
96 This package is a virtual rpm that aims to make sure you always have the \
97 latest prebuilt %{drvname} driver for kernel-%{1}. \
98 \
99 %files -n %{drvname}-kernel-%{1}-latest
100
101 %ifarch %{ix86}
102 %mkflavour desktop586
103 %endif
104
105 %mkflavour desktop
106 %mkflavour server
107
108
109 %prep
110 rm -rf %{topdir}
111
112 %build
113 %{_sbindir}/dkms add -m %{drvname} -v %{drvver}-%{drvrel} --dkmstree %{topdir}/var/lib/dkms-binary
114 %ifarch %{ix86}
115 export KERN_VER=%{kernver}-desktop586-%{kernrel}
116 %{_sbindir}/dkms build --no-prepare-kernel --no-clean-kernel -m %{drvname} -v %{drvver}-%{drvrel} \
117 -k %{kernver}-desktop586-%{kernrel} --kernelsourcedir /usr/src/kernel-%{kernver}-desktop586-%{kernrel} \
118 --dkmstree %{topdir}/var/lib/dkms-binary
119 %endif
120 for flavour in desktop server; do
121 export KERN_VER=%{kernver}-$flavour-%{kernrel}
122 %{_sbindir}/dkms build --no-prepare-kernel --no-clean-kernel -m %{drvname} -v %{drvver}-%{drvrel} \
123 -k %{kernver}-$flavour-%{kernrel} --kernelsourcedir /usr/src/kernel-%{kernver}-$flavour-%{kernrel} \
124 --dkmstree %{topdir}/var/lib/dkms-binary
125 done
126
127 %install
128 mkdir -p %{buildroot}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}
129 cp -a %{topdir}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-*-%{kernrel} \
130 %{buildroot}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/
131 for dir in %{buildroot}/var/lib/dkms-binary/%{drvname}/%{drvver}-%{drvrel}/%{kernver}-*-%{kernrel}; do
132 cp -a /usr/src/%{drvname}-%{drvver}-%{drvrel}/dkms.conf $dir/
133 xz -6e $dir/*/module/vbox*.ko ||:
134 done

  ViewVC Help
Powered by ViewVC 1.1.30