• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%define prefix   /usr
2%define version @VERSION@
3
4Summary: packet capture library
5Name: libpcap
6Version: %version
7Release: 1
8Group: Development/Libraries
9Copyright: BSD
10Source: @NAME@.tar.gz
11BuildRoot: /tmp/%{name}-buildroot
12URL: http://www.tcpdump.org
13
14%description
15Packet-capture library LIBPCAP @VERSION@
16Now maintained by "The Tcpdump Group"
17See http://www.tcpdump.org
18Please send inquiries/comments/reports to tcpdump-workers@tcpdump.org
19
20%prep
21%setup
22
23%post
24ldconfig
25
26%build
27CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
28make
29
30%install
31rm -rf $RPM_BUILD_ROOT
32mkdir -p $RPM_BUILD_ROOT/usr/{lib,include}
33mkdir -p $RPM_BUILD_ROOT/usr/share/man
34mkdir -p $RPM_BUILD_ROOT/usr/include/net
35mkdir -p $RPM_BUILD_ROOT/usr/man/man3
36make install DESTDIR=$RPM_BUILD_ROOT mandir=/usr/share/man
37cd $RPM_BUILD_ROOT/usr/lib
38V1=`echo @VERSION@ | sed 's/\\.[^\.]*$//g'`
39V2=`echo @VERSION@ | sed 's/\\.[^\.]*\.[^\.]*$//g'`
40ln -sf libpcap.so.@VERSION@ libpcap.so.$V1
41if test "$V2" -ne "$V1"; then
42    ln -sf libpcap.so.$V1 libpcap.so.$V2
43    ln -sf libpcap.so.$V2 libpcap.so
44else
45    ln -sf libpcap.so.$V1 libpcap.so
46fi
47
48#install -m 755 -o root libpcap.a $RPM_BUILD_ROOT/usr/lib
49#install -m 644 -o root pcap.3 $RPM_BUILD_ROOT/usr/man/man3
50#install -m 644 -o root pcap.h $RPM_BUILD_ROOT/usr/include
51#install -m 644 -o root pcap-bpf.h $RPM_BUILD_ROOT/usr/include/net
52#install -m 644 -o root pcap-namedb.h $RPM_BUILD_ROOT/usr/include
53
54%clean
55rm -rf $RPM_BUILD_ROOT
56
57%files
58%defattr(-,root,root)
59%doc LICENSE CHANGES INSTALL.txt README.linux TODO VERSION CREDITS packaging/pcap.spec
60/usr/lib/libpcap.a
61/usr/share/man/man3/*
62/usr/include/pcap.h
63/usr/include/pcap-bpf.h
64/usr/include/pcap-namedb.h
65/usr/lib/libpcap.so*
66