Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 ##
2 ## libpcap.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package version
25 %define V_tarball 1.3.0
26 %define V_subdir 1.3.0
28 # package information
29 Name: libpcap
30 Summary: Network Packet Capture Library
31 URL: http://www.tcpdump.org/
32 Vendor: The Tcpdump Group
33 Packager: OpenPKG Foundation e.V.
34 Distribution: OpenPKG Community
35 Class: BASE
36 Group: Capturing
37 License: GPL
38 Version: %{V_tarball}
39 Release: 20120800
41 # list of sources
42 Source0: http://www.tcpdump.org/release/libpcap-%{V_tarball}.tar.gz
43 Patch0: libpcap.patch
45 # build information
46 BuildPreReq: OpenPKG, openpkg >= 20100101, make, bison, flex
47 PreReq: OpenPKG, openpkg >= 20100101
49 %description
50 libpcap provides a portable framework for low-level network monitoring and
51 system-independent interface for user-level packet capture. The libpcap
52 interface supports a filtering mechanism based on the architecture in the
53 BSD packet filter. On systems that don't have BPF, all packets are read
54 into user-space and the BPF filters are evaluated in the libpcap library.
56 %track
57 prog libpcap = {
58 version = %{V_tarball}
59 url = http://www.tcpdump.org/
60 regex = libpcap-(__VER__)\.tar\.gz
61 }
63 %prep
64 %setup -q -n libpcap-%{V_subdir}
65 %patch -p0
66 %{l_shtool} subst \
67 -e 's;\(#if defined(PF_PACKET) && defined(SO_ATTACH_FILTER)\)$;\1 \&\& defined(__linux__);g' \
68 gencode.c
70 %build
71 CC="%{l_cc}" \
72 CFLAGS="%{l_cflags -O}" \
73 GREP="grep" \
74 ./configure \
75 --prefix=%{l_prefix} \
76 --mandir=%{l_prefix}/man
77 %{l_make} %{l_mflags -O}
79 %install
80 %{l_shtool} mkdir -f -p -m 755 \
81 $RPM_BUILD_ROOT%{l_prefix}/bin \
82 $RPM_BUILD_ROOT%{l_prefix}/man/man3
83 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
84 ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man3
85 %{l_shtool} move -e '*.3pcap' '%1.3'
86 ) || exit $?
87 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
89 %files -f files
91 %clean