blob: 4733120c2db9c577f37a733e27e397e99ce51993 (
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
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
|
Summary: L7 DPI library
Name: ndpi
Version: @PACKAGE_VERSION@
Release: %{buildnumber}
License: LGPL
Group: Networking/Utilities
URL: http://www.ntop.org/products/deep-packet-inspection/ndpi/
Source: ndpi-%{version}.tgz
Packager: Luca Deri <deri@ntop.org>
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%{?el8:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
AutoReqProv: no
%define debug_package %{nil}
# Make sure .build-id is not part of the package
%define _build_id_links none
%description
nDPI Open and Extensible LGPLv3 Deep Packet Inspection Library.
%package dev
Summary: Header files and development libraries for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description dev
This package contains the header files and development libraries
for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-dev.
%prep
%setup -q
# Execution order:
# install: pre -> (copy) -> post
# upgrade: pre -> (copy) -> post -> preun (old) -> (delete old) -> postun (old)
# un-install: preun -> (delete) -> postun
%pre
%post
%build
PATH=/usr/bin:/bin:/usr/sbin:/sbin
%define includedir /usr/include/ndpi
%{?el6:%define libdir /usr/lib}
%{?el7:%define libdir /usr/lib}
%{?el8:%define libdir /usr/lib64}
%define bindir /usr/bin
%install
PATH=/usr/bin:/bin:/usr/sbin:/sbin
if [ -d $RPM_BUILD_ROOT ]; then
\rm -rf $RPM_BUILD_ROOT
fi
mkdir -p $RPM_BUILD_ROOT%{includedir}
mkdir -p $RPM_BUILD_ROOT%{libdir}
mkdir -p $RPM_BUILD_ROOT%{bindir}
cd $HOME/nDPI; make DESTDIR=$RPM_BUILD_ROOT install;
rm $RPM_BUILD_ROOT/usr/lib/libndpi.so
rm $RPM_BUILD_ROOT/usr/lib/libndpi.so.?
cd $RPM_BUILD_ROOT/usr/lib/; ln -s libndpi.so.@PACKAGE_VERSION@ libndpi.so.@MAJOR_RELEASE@; cd -
cd $RPM_BUILD_ROOT/usr/lib/; ln -s libndpi.so.@PACKAGE_VERSION@ libndpi.so; cd -
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
cp $HOME/nDPI/packages/etc/ld.so.conf.d/ndpi.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d
rm -rf $RPM_BUILD_ROOT/usr/sbin/ndpi
strip $RPM_BUILD_ROOT%{bindir}/*
rm -fr %{buildroot}%{includedir}/ndpi_win32.h
#sed -i -e "s/#include \"ndpi_win32.h\"//g" %{buildroot}%{includedir}/ndpi_main.h
%clean
rm -fr $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
/usr/lib/libndpi.so
/usr/lib/libndpi.so.@MAJOR_RELEASE@
/usr/lib/libndpi.so.@PACKAGE_VERSION@
/usr/bin/ndpiReader
/usr/share/ndpi/ndpiCustomCategory.txt
/usr/share/ndpi/ndpiProtos.txt
/etc/ld.so.conf.d/ndpi.conf
%{libdir}/pkgconfig/libndpi.pc
%preun
%files dev
%defattr(-,root,root,-)
%{includedir}
/usr/lib/libndpi.a
%changelog
* Mon Nov 19 2018 Alfredo Cardigliano <cardigliano@ntop.org> 2.5
- Initial package version
|