1 %define prefix /usr 2 %define version @VERSION@ 3 4 Summary: packet capture library 5 Name: libpcap 6 Version: %version 7 Release: 1 8 Group: Development/Libraries 9 Copyright: BSD 10 Source: @NAME (a] .tar.gz 11 BuildRoot: /tmp/%{name}-buildroot 12 URL: http://www.tcpdump.org 13 14 %description 15 Packet-capture library LIBPCAP @VERSION@ 16 Now maintained by "The Tcpdump Group" 17 See http://www.tcpdump.org 18 Please send inquiries/comments/reports to tcpdump-workers (a] tcpdump.org 19 20 %prep 21 %setup 22 23 %post 24 ldconfig 25 26 %build 27 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix 28 make 29 30 %install 31 rm -rf $RPM_BUILD_ROOT 32 mkdir -p $RPM_BUILD_ROOT/usr/{lib,include} 33 mkdir -p $RPM_BUILD_ROOT/usr/share/man 34 mkdir -p $RPM_BUILD_ROOT/usr/include/net 35 mkdir -p $RPM_BUILD_ROOT/usr/man/man3 36 make install DESTDIR=$RPM_BUILD_ROOT mandir=/usr/share/man 37 cd $RPM_BUILD_ROOT/usr/lib 38 V1=`echo @VERSION@ | sed 's/\\.[^\.]*$//g'` 39 V2=`echo @VERSION@ | sed 's/\\.[^\.]*\.[^\.]*$//g'` 40 ln -sf libpcap.so.@VERSION@ libpcap.so.$V1 41 if test "$V2" -ne "$V1"; then 42 ln -sf libpcap.so.$V1 libpcap.so.$V2 43 ln -sf libpcap.so.$V2 libpcap.so 44 else 45 ln -sf libpcap.so.$V1 libpcap.so 46 fi 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 55 rm -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