diff --git a/.cvsignore b/.cvsignore index 36bf11a..1b34f8e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -libpcap-0.9.8.tar.gz +libpcap-20090716git6de2de.tar.gz diff --git a/libpcap-0.9.7-shared.patch b/libpcap-0.9.7-shared.patch deleted file mode 100644 index 92fc0d5..0000000 --- a/libpcap-0.9.7-shared.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- libpcap-0.9.7/Makefile.in.shared 2007-07-24 04:35:15.000000000 +0200 -+++ libpcap-0.9.7/Makefile.in 2007-07-24 14:52:43.000000000 +0200 -@@ -22,6 +22,7 @@ - # - # Various configurable paths (remember to edit Makefile.in, not Makefile) - # -+VERSION := $(shell cat VERSION) - - # Top level hierarchy - prefix = @prefix@ -@@ -97,9 +98,14 @@ TAGHDR = \ - TAGFILES = \ - $(SRC) $(HDR) $(TAGHDR) - --CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c - --all: libpcap.a -+ -+CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so.$(VERSION) -+ -+all: libpcap.a libpcap.so.$(VERSION) -+ -+libpcap.so.$(VERSION): $(OBJ) -+ gcc -shared -Wl,-soname -Wl,libpcap.so.$(SOVERSION) $(CFLAGS) -o libpcap.so.$(VERSION) $(OBJ) - - libpcap.a: $(OBJ) - @rm -f $@ -@@ -172,10 +178,13 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt - bpf_filter.o: bpf_filter.c - $(CC) $(CFLAGS) -c bpf_filter.c - --install: libpcap.a -+install: libpcap.a libpcap.so.$(VERSION) - [ -d $(DESTDIR)$(libdir) ] || \ - (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) - $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a -+ $(INSTALL_PROGRAM) libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(VERSION) -+ ln -sf libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(SOVERSION) -+ ln -sf libpcap.so.$(SOVERSION) $(DESTDIR)$(libdir)/libpcap.so - $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a - [ -d $(DESTDIR)$(includedir) ] || \ - (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) diff --git a/libpcap-man.patch b/libpcap-man.patch index 263c37d..e37afbc 100644 --- a/libpcap-man.patch +++ b/libpcap-man.patch @@ -1,23 +1,12 @@ ---- libpcap-0.9.5/pcap.3.man 2006-01-22 21:12:10.000000000 +0100 -+++ libpcap-0.9.5/pcap.3 2006-11-03 15:36:28.000000000 +0100 -@@ -215,9 +215,9 @@ - .I fname - specifies the name of the file to open. The file has - the same format as those used by --.B tcpdump(1) -+.B tcpdump(8) - and --.BR tcpslice(1) . -+.BR tcpslice(8) . - The name "-" in a synonym for - .BR stdin . - Alternatively, you may call -@@ -1283,7 +1283,7 @@ - closes the ``savefile.'' - .PP +diff -up libpcap/pcap.3pcap.in.man libpcap/pcap.3pcap.in +--- libpcap/pcap.3pcap.in.man 2009-07-03 06:01:12.000000000 +0200 ++++ libpcap/pcap.3pcap.in 2009-07-03 15:00:12.000000000 +0200 +@@ -363,7 +363,7 @@ use an + script or some other configuration script to check whether the libpcap + 1.0 APIs are available and use them only if they are. .SH SEE ALSO --tcpdump(1), tcpslice(1) -+tcpdump(8), tcpslice(8) +-autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8), ++autoconf(1), tcpdump(8), tcpslice(8), pcap-filter(@MAN_MISC_INFO@), pfconfig(8), + usermod(1M) .SH AUTHORS - The original authors are: - .LP + The original authors of libpcap are: diff --git a/libpcap-multilib.patch b/libpcap-multilib.patch new file mode 100644 index 0000000..10492d1 --- /dev/null +++ b/libpcap-multilib.patch @@ -0,0 +1,61 @@ +diff -up libpcap/pcap-config.in.multilib libpcap/pcap-config.in +--- libpcap/pcap-config.in.multilib 2009-07-03 06:01:12.000000000 +0200 ++++ libpcap/pcap-config.in 2009-07-09 15:55:48.000000000 +0200 +@@ -29,16 +29,6 @@ do + esac + shift + done +-if [ "@V_RPATH_OPT@" != "" ] +-then +- # +- # If libdir isn't /usr/lib, add it to the run-time linker path. +- # +- if [ "@libdir@" != "/usr/lib" ] +- then +- RPATH=@V_RPATH_OPT@@libdir@ +- fi +-fi + if [ "$static" = 1 ] + then + # +@@ -47,16 +37,16 @@ then + # + if [ "$show_cflags" = 1 -a "$show_libs" = 1 ] + then +- echo "-I@includedir@ -L@libdir@ -lpcap @LIBS@" ++ echo "-lpcap @LIBS@" + elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ] + then +- echo "-I@includedir@ -L@libdir@ @LIBS@" ++ echo "@LIBS@" + elif [ "$show_cflags" = 1 ] + then +- echo "-I@includedir@" ++ echo "" + elif [ "$show_libs" = 1 ] + then +- echo "-L@libdir@ -lpcap @LIBS@" ++ echo "-lpcap @LIBS@" + elif [ "$show_additional_libs" = 1 ] + then + echo "@LIBS@" +@@ -68,15 +58,15 @@ else + # + if [ "$show_cflags" = 1 -a "$show_libs" = 1 ] + then +- echo "-I@includedir@ -L@libdir@ $RPATH -lpcap" ++ echo "-lpcap" + elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ] + then +- echo "-I@includedir@" ++ echo "" + elif [ "$show_cflags" = 1 ] + then +- echo "-I@includedir@" ++ echo "" + elif [ "$show_libs" = 1 ] + then +- echo "-L@libdir@ $RPATH -lpcap" ++ echo "-lpcap" + fi + fi diff --git a/libpcap-oldsoname.patch b/libpcap-oldsoname.patch new file mode 100644 index 0000000..5a25506 --- /dev/null +++ b/libpcap-oldsoname.patch @@ -0,0 +1,21 @@ +diff -up libpcap/Makefile.in.oldsoname libpcap/Makefile.in +--- libpcap/Makefile.in.oldsoname 2009-07-17 00:10:42.000000000 +0200 ++++ libpcap/Makefile.in 2009-07-22 15:53:32.000000000 +0200 +@@ -328,6 +328,8 @@ libpcap.so: $(OBJ) + MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \ + @V_SHLIB_CMD@ @V_SHLIB_OPT@ @V_SONAME_OPT@$@.$$MAJOR_VER $(LDFLAGS) \ + -o $@.$$VER $(OBJ) $(ADDLOBJS) $(LIBS) ++ @V_SHLIB_CMD@ @V_SHLIB_OPT@ @V_SONAME_OPT@$@.0.9 $(LDFLAGS) \ ++ -o $@.0.9.9 $(OBJ) $(ADDLOBJS) $(LIBS) + + # + # The following rule succeeds, but the result is untested. +@@ -542,6 +544,8 @@ install-shared-so: libpcap.so + VER=`cat $(srcdir)/VERSION`; \ + MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \ + $(INSTALL_PROGRAM) libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$VER; \ ++ $(INSTALL_PROGRAM) libpcap.so.0.9.9 $(DESTDIR)$(libdir)/libpcap.so.0.9.9; \ ++ ln -sf libpcap.so.0.9.9 $(DESTDIR)$(libdir)/libpcap.so.0.9; \ + ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \ + ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so + install-shared-dylib: libpcap.dylib diff --git a/libpcap-oneshot.patch b/libpcap-oneshot.patch new file mode 100644 index 0000000..f1db525 --- /dev/null +++ b/libpcap-oneshot.patch @@ -0,0 +1,12 @@ +diff -up libpcap/pcap-linux.c.oneshot libpcap/pcap-linux.c +--- libpcap/pcap-linux.c.oneshot 2009-07-17 00:10:42.000000000 +0200 ++++ libpcap/pcap-linux.c 2009-07-22 14:30:52.000000000 +0200 +@@ -2744,7 +2744,7 @@ static void + pcap_oneshot_mmap(u_char *user, const struct pcap_pkthdr *h, + const u_char *bytes) + { +- struct pkt_for_oneshot *sp = (struct pkt_for_oneshot *)user; ++ struct oneshot_userdata *sp = (struct oneshot_userdata *)user; + bpf_u_int32 copylen; + + *sp->hdr = *h; diff --git a/libpcap-s390.patch b/libpcap-s390.patch index 7731c86..1048182 100644 --- a/libpcap-s390.patch +++ b/libpcap-s390.patch @@ -1,12 +1,14 @@ ---- libpcap-0.7.2/pcap-linux.c.s390 2003-02-26 07:45:32.000000000 +0100 -+++ libpcap-0.7.2/pcap-linux.c 2003-02-27 16:48:48.000000000 +0100 -@@ -1214,6 +1214,9 @@ - fatal_err = 1; - break; - } +diff -up libpcap/pcap-linux.c.s390 libpcap/pcap-linux.c +--- libpcap/pcap-linux.c.s390 2009-07-22 14:33:20.000000000 +0200 ++++ libpcap/pcap-linux.c 2009-07-22 15:22:34.000000000 +0200 +@@ -2377,6 +2377,10 @@ activate_new(pcap_t *handle) + handle->linktype = DLT_LINUX_SLL; + } + + /* Hack to make things work on s390 ctc interfaces */ + if (strncmp("ctc", device, 3) == 0) + handle->linktype = DLT_EN10MB; - } else { - /* - * This is cooked mode. ++ + handle->md.ifindex = iface_get_id(sock_fd, device, + handle->errbuf); + if (handle->md.ifindex == -1) { diff --git a/libpcap.spec b/libpcap.spec index 1a94a44..f9616e5 100644 --- a/libpcap.spec +++ b/libpcap.spec @@ -1,21 +1,23 @@ -%define pcap_sover 0.9 - Name: libpcap Epoch: 14 -Version: 0.9.8 -Release: 4%{?dist} +Version: 1.0.0 +Release: 1.20090716git6de2de%{?dist} Summary: A system-independent interface for user-level packet capture Group: Development/Libraries License: BSD with advertising URL: http://www.tcpdump.org -BuildRequires: glibc-kernheaders >= 2.2.0 bison flex +BuildRequires: glibc-kernheaders >= 2.2.0 bison flex bluez-libs-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz +#Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz +# git snapshot from git://bpf.tcpdump.org/libpcap +Source: libpcap-20090716git6de2de.tar.gz Patch1: libpcap-man.patch -Patch2: libpcap-0.9.7-shared.patch +Patch2: libpcap-multilib.patch Patch3: libpcap-s390.patch Patch4: libpcap-0.8.3-ppp.patch +Patch5: libpcap-oneshot.patch +# temporarily provide old soname +Patch6: libpcap-oldsoname.patch %description Libpcap provides a portable framework for low-level network @@ -47,22 +49,25 @@ This package provides the libraries, include files, and other resources needed for developing libpcap applications. %prep -%setup -q +%setup -q -n libpcap +echo '1.0.0' > VERSION %patch1 -p1 -b .man -%patch2 -p1 -b .shared +%patch2 -p1 -b .multilib %patch3 -p1 -b .s390 %patch4 -p0 -b .ppp +%patch5 -p1 -b .oneshot +%patch6 -p1 -b .oldsoname %build export CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)" -%configure --enable-ipv6 -make SOVERSION=%{pcap_sover} +%configure --enable-ipv6 --enable-bluetooth +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -make SOVERSION=%{pcap_sover} DESTDIR=$RPM_BUILD_ROOT install +make DESTDIR=$RPM_BUILD_ROOT install rm -f $RPM_BUILD_ROOT%{_libdir}/libpcap.a %clean @@ -76,14 +81,22 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %doc LICENSE README CHANGES CREDITS doc/pcap.txt %{_libdir}/libpcap.so.* +%{_mandir}/man7/pcap*.7* %files devel %defattr(-,root,root) +%{_bindir}/pcap-config %{_includedir}/pcap*.h +%{_includedir}/pcap %{_libdir}/libpcap.so -%{_mandir}/man3/pcap.3* +%{_mandir}/man1/pcap-config.1* +%{_mandir}/man3/pcap*.3* +%{_mandir}/man5/pcap*.5* %changelog +* Wed Jul 22 2009 Miroslav Lichvar 14:1.0.0-1.20090716git6de2de +- update to 1.0.0, git snapshot 20090716git6de2de + * Wed Feb 25 2009 Fedora Release Engineering - 14:0.9.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild diff --git a/sources b/sources index 3bd7123..1b9ff27 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5208f24d0328ee7c20b52c43eaa9aa0e libpcap-0.9.8.tar.gz +ac6459eb882d4e1107f8c351eb0131eb libpcap-20090716git6de2de.tar.gz