summaryrefslogtreecommitdiff
path: root/packaging/kdbus.spec
blob: 7ee7d2502d161a7dbb07484099f1758b2caff7f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Name:       kdbus
Summary:    kdbus kernel module
Version:    0.20140325.112233cet
Release:    1
Group:      Base/Device Management
License:    GPL-2.0
Source0:    %{name}-%{version}.tar.gz
BuildRequires: unifdef
BuildRequires: kernel-devel
BuildRequires: kmod-compat

%ifarch %{arm}
%define modprefix /boot/
%else
%define modprefix /
%endif

%define x_kernel_devel_uname_r %(/bin/rpm -q --provides $(/bin/rpm -q --whatprovides kernel-devel-uname-r) | sed -ne 's,kernel-devel-uname-r = ,, p')

Requires:   kdbus-kmod-uname-r = %{x_kernel_devel_uname_r}

%description
This package provides kdbus functionality as downloaded
from github.com/gregkh/kdbus

%package kmod
License:        GPL-2.0
Summary:        Kernel module for %{name}
Provides:       kdbus-bus = %{version}
Provides:       kdbus-kmod-uname-r = %{x_kernel_devel_uname_r}

%description kmod
This package provides kernel module %{name} compiled for %{x_kernel_devel_uname_r} kernel.

%package devel
License:        GPL-2.0
Summary:        Development headers for %{name}

%description devel
This package provides %{name} interface header for user space.

%prep
%setup -q

%build
make KERNELDIR=%{modprefix}/lib/modules/%{x_kernel_devel_uname_r}/build %{?_smp_mflags} module

%install
mkdir -p %{buildroot}%{modprefix}lib/modules/%{x_kernel_devel_uname_r}/extra
install -m644 kdbus.ko %{buildroot}%{modprefix}/lib/modules/%{x_kernel_devel_uname_r}/extra/
install -m755 -d %{buildroot}%{_includedir}
[ $(unifdef -U__KERNEL__ kdbus.h > %{buildroot}%{_includedir}/kdbus.h) -gt 1 ] && { echo 'unifdef failed to process file'; exit 1; }

%files kmod
%{modprefix}lib/modules/%{x_kernel_devel_uname_r}/extra/kdbus.ko

%post kmod
/usr/sbin/depmod %{x_kernel_devel_uname_r}

%files devel
%{_includedir}/kdbus.h