forked from veos-sxarr-NEC/vp-kmod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvp-kmod.spec.in
105 lines (87 loc) · 2.74 KB
/
vp-kmod.spec.in
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#
# VP Kernel Module
#
# Copyright (C) 2017-2018 NEC Corporation
# This file is part of VP Kernel Module.
#
# VP Kernel Module is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# VP Kernel Module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with the VP Kernel Module; if not, see
# <http://www.gnu.org/licenses/>.
#
# Define the kmod package name here.
%define kmod_name vp
# Set install prefix to /usr/local
%define _prefix @prefix@
# Define Kernel version for rpm name here.
%define REL_KVER %(uname -r | sed -s "s/\.el.*\.x86_64//" | tr - _)
%define KVER %(uname -r)
Name: %{kmod_name}-kmod
Version: @VERSION@
Release: %{REL_KVER}@RELEASE@%{?dist}
Group: System Environment/Kernel
License: GPLv2
Summary: %{kmod_name} kernel module
Vendor: NEC Corporation
Packager: NEC Corporation
%description
VE Virtual to Physical kernel modules.
%package devel
Summary: Headers for building apps that use vp module
Group: System Environment/Kernel
Requires: %{name} = %{version}-%{release}
#Sources
Source0: @PACKAGE@-@VERSION@.tar.gz
Source10: kmodtool-%{kmod_name}-e17.sh
%description devel
This package contains header required to build applications that
use vp module
# Magic hidden here.
%{expand:%(sh %{SOURCE10} rpmtemplate %{kmod_name} %{KVER} "")}
%prep
%setup -q -a 0
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
%build
%configure --with-release-id=@RELEASE@ --with-kernel=%{KVER}
make %{?_smp_mflags}
%install
%{__rm} -rf $RPM_BUILD_ROOT
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=extra/
make install DESTDIR=$RPM_BUILD_ROOT
%{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/
# Set the module(s) to be executable, so that they will be stripped when packaged.
find $RPM_BUILD_ROOT -type f -name \*.ko -exec %{__chmod} u+x \{\} \;
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%pre
/sbin/depmod -a
if modinfo ve_drv > /dev/null 2>&1;
then
/sbin/modprobe -r ve_drv
fi
if modinfo vp > /dev/null 2>&1;
then
/sbin/modprobe -r vp
fi
%files
%{_sysconfdir}/depmod.d/*
%defattr(-,root,root,-)
/lib/modules/%{KVER}/extra/*.ko
%{_sysconfdir}/modprobe.d/*.conf
%config(noreplace) %{_sysconfdir}/dracut.conf.d/*
%files devel
%defattr(-,root,root,-)
%{_prefix}/src/ve_kernel/Module.symvers
%{_includedir}/*.h
%changelog