diff --git a/.cvsignore b/.cvsignore index e69de29..a25a22f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +libpcap-0.9.5.tar.gz diff --git a/libpcap-0.8.3-ppp.patch b/libpcap-0.8.3-ppp.patch new file mode 100644 index 0000000..923b71c --- /dev/null +++ b/libpcap-0.8.3-ppp.patch @@ -0,0 +1,10 @@ +--- gencode.c.old 2004-06-21 19:43:24.611308762 +0100 ++++ gencode.c 2004-06-21 19:43:34.851140716 +0100 +@@ -5004,6 +5004,7 @@ + */ + switch (linktype) { + case DLT_SLIP: ++ case DLT_PPP: + b0 = gen_relation(BPF_JEQ, + gen_load(Q_LINK, gen_loadi(0), 1), + gen_loadi(0), diff --git a/libpcap-man.patch b/libpcap-man.patch new file mode 100644 index 0000000..263c37d --- /dev/null +++ b/libpcap-man.patch @@ -0,0 +1,23 @@ +--- 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 + .SH SEE ALSO +-tcpdump(1), tcpslice(1) ++tcpdump(8), tcpslice(8) + .SH AUTHORS + The original authors are: + .LP diff --git a/libpcap-s390.patch b/libpcap-s390.patch new file mode 100644 index 0000000..7731c86 --- /dev/null +++ b/libpcap-s390.patch @@ -0,0 +1,12 @@ +--- 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; + } ++ /* Hack to make things work on s390 ctc interfaces */ ++ if (strncmp("ctc", device, 3) == 0) ++ handle->linktype = DLT_EN10MB; + } else { + /* + * This is cooked mode. diff --git a/libpcap-shared.patch b/libpcap-shared.patch new file mode 100644 index 0000000..d0394f3 --- /dev/null +++ b/libpcap-shared.patch @@ -0,0 +1,51 @@ +--- libpcap-0.9.5/Makefile.in.shared 2003-12-15 02:35:03.000000000 +0100 ++++ libpcap-0.9.5/Makefile.in 2006-11-28 12:01:14.000000000 +0100 +@@ -22,6 +22,7 @@ + # + # Various configurable paths (remember to edit Makefile.in, not Makefile) + # ++VERSION := $(shell cat VERSION) + + # Top level hierarchy + prefix = @prefix@ +@@ -49,7 +50,7 @@ + DYEXT = @DYEXT@ + + # Standard CFLAGS +-CFLAGS = $(CCOPT) $(INCLS) $(DEFS) ++CFLAGS = $(CCOPT) $(INCLS) $(DEFS) -fPIC -DPIC + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -95,9 +96,14 @@ + 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) -o libpcap.so.$(VERSION) $(OBJ) + + libpcap.a: $(OBJ) + @rm -f $@ +@@ -170,10 +176,13 @@ + 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.spec b/libpcap.spec new file mode 100644 index 0000000..0b8f31f --- /dev/null +++ b/libpcap.spec @@ -0,0 +1,91 @@ +%define pcap_sover 0.9 + +Name: libpcap +Epoch: 14 +Version: 0.9.5 +Release: 1%{?dist} +Summary: A system-independent interface for user-level packet capture +Group: Development/Libraries +License: BSD +URL: http://www.tcpdump.org +BuildRequires: glibc-kernheaders >= 2.2.0 bison flex +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz +Patch1: libpcap-man.patch +Patch2: libpcap-shared.patch +Patch3: libpcap-s390.patch +Patch4: libpcap-0.8.3-ppp.patch + +%description +Libpcap provides a portable framework for low-level network +monitoring. Libpcap can provide network statistics collection, +security monitoring and network debugging. Since almost every system +vendor provides a different interface for packet capture, the libpcap +authors created this system-independent API to ease in porting and to +alleviate the need for several system-dependent packet capture modules +in each application. + +Install libpcap if you need to do low-level network traffic monitoring +on your network. + +%package devel +Summary: Libraries and header files for the libpcap library +Group: Development/Libraries +Requires: %{name} = %{epoch}:%{version}-%{release} + +%description devel +Libpcap provides a portable framework for low-level network +monitoring. Libpcap can provide network statistics collection, +security monitoring and network debugging. Since almost every system +vendor provides a different interface for packet capture, the libpcap +authors created this system-independent API to ease in porting and to +alleviate the need for several system-dependent packet capture modules +in each application. + +This package provides the libraries, include files, and other +resources needed for developing libpcap applications. + +%prep +%setup -q + +%patch1 -p1 -b .man +%patch2 -p1 -b .shared +%patch3 -p1 -b .s390 +%patch4 -p0 -b .ppp + +%build +export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" +%configure --enable-ipv6 +make SOVERSION=%{pcap_sover} + +%install +rm -rf $RPM_BUILD_ROOT + +make SOVERSION=%{pcap_sover} DESTDIR=$RPM_BUILD_ROOT install +rm -f $RPM_BUILD_ROOT%{_libdir}/libpcap.a + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc LICENSE README CHANGES CREDITS doc/pcap.txt +%{_libdir}/libpcap.so.* + +%files devel +%defattr(-,root,root) +%{_includedir}/pcap*.h +%{_libdir}/libpcap.so +%{_mandir}/man3/pcap.3* + +%changelog +* Tue Nov 28 2006 Miroslav Lichvar 14:0.9.5-1 +- split from tcpdump package (#193657) +- update to 0.9.5 +- don't package static library +- maintain soname diff --git a/sources b/sources index e69de29..ca60679 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b0626ad59004fe5767ddd2ce743a2271 libpcap-0.9.5.tar.gz