1 |
%define module_name ipt_NETFLOW |
2 |
%define dkms_package dkms-%{module_name} |
3 |
|
4 |
Name: %{module_name} |
5 |
Version: 1.8 |
6 |
Release: %mkrel 8 |
7 |
Summary: DKMS-ready module for ipt_netflow an iptables modules |
8 |
License: GPLv3 |
9 |
Source: http://sourceforge.net/projects/ipt_netflow/files/ipt_netflow/%{module_name}-%{version}.tgz |
10 |
# Disable searching for iptables sources, not used anyway |
11 |
Patch0: ipt_NETFLOW-1.8-nosrc.patch |
12 |
# Split build of module and library by fixing dependencies in Makefile |
13 |
Patch1: ipt_NETFLOW-1.8-split-build.patch |
14 |
# Support destdir for installing the library |
15 |
Patch2: ipt_NETFLOW-1.8-destdir.patch |
16 |
# Fix build on recent kernels |
17 |
Patch3: ipt_NETFLOW-1.8-build.patch |
18 |
Group: Development/Kernel |
19 |
BuildRequires: pkgconfig(xtables) pkgconfig(libiptc) |
20 |
|
21 |
%description |
22 |
ipt_netflow is very fast and effective Netflow exporting module for Linux kernel. |
23 |
This is netfilter/iptables module adding support for NETFLOW target. |
24 |
|
25 |
%package -n %{dkms_package} |
26 |
Summary: DKMS-ready module for ipt_netflow an iptables modules |
27 |
Provides: kmod(ipt_NETFLOW.ko) = %{version} |
28 |
Requires(pre): dkms |
29 |
Requires(post): dkms |
30 |
BuildArch: noarch |
31 |
|
32 |
%description -n %{dkms_package} |
33 |
ipt_netflow is very fast and effective Netflow exporting module for Linux kernel. |
34 |
This is netfilter/iptables module adding support for NETFLOW target. |
35 |
|
36 |
This package provides the %{module_name} kernel module(s). |
37 |
|
38 |
%package -n iptables-NETFLOW |
39 |
Summary: The NETFLOW library which will be loaded by iptables when NETFLOW rules are processed |
40 |
Requires: kmod(ipt_NETFLOW.ko) |
41 |
|
42 |
%description -n iptables-NETFLOW |
43 |
The NETFLOW library which will be loaded by iptables when NETFLOW rules are processed. |
44 |
|
45 |
%prep |
46 |
%setup -q -n ipt_netflow-%{version} |
47 |
%apply_patches |
48 |
|
49 |
%build |
50 |
./configure |
51 |
%make libipt_NETFLOW.so |
52 |
|
53 |
%install |
54 |
# Install the library |
55 |
make DESTDIR=%{buildroot} linstall |
56 |
|
57 |
# Install the sources of the module |
58 |
mkdir -p %{buildroot}/usr/src/ |
59 |
mkdir -p %{buildroot}/usr/src/%{module_name}-%{version}-%{release} |
60 |
cp -a ../ipt_netflow-%{version}/*.{c,h} ../ipt_netflow-%{version}/Makefile %{buildroot}/usr/src/%{module_name}-%{version}-%{release} |
61 |
|
62 |
cat > %{buildroot}/usr/src/%{module_name}-%{version}-%{release}/dkms.conf <<EOF |
63 |
|
64 |
PACKAGE_VERSION="%{version}-%{release}" |
65 |
|
66 |
#Items below here should not have to change with each driver version |
67 |
PACKAGE_NAME="%{module_name}" |
68 |
CLEAN="make clean" |
69 |
BUILT_MODULE_NAME[0]="%{module_name}" |
70 |
DEST_MODULE_LOCATION[0]="/kernel/net/netfilter/" |
71 |
AUTOINSTALL=yes |
72 |
EOF |
73 |
|
74 |
%post -n %{dkms_package} |
75 |
dkms add -m %{module_name} -v %{version}-%{release} --rpm_safe_upgrade |
76 |
dkms build -m %{module_name} -v %{version}-%{release} --rpm_safe_upgrade |
77 |
dkms install -m %{module_name} -v %{version}-%{release} --rpm_safe_upgrade |
78 |
|
79 |
%preun -n %{dkms_package} |
80 |
dkms remove -m %{module_name} -v %{version}-%{release} --rpm_safe_upgrade --all || : |
81 |
|
82 |
%files -n %{dkms_package} |
83 |
/usr/src/%{module_name}-%{version}-%{release} |
84 |
|
85 |
%files -n iptables-NETFLOW |
86 |
/%{_lib}/iptables/libipt_NETFLOW.so |