michael@27: ## michael@27: ## libpcap.spec -- OpenPKG RPM Package Specification michael@488: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@27: ## michael@27: ## Permission to use, copy, modify, and distribute this software for michael@27: ## any purpose with or without fee is hereby granted, provided that michael@27: ## the above copyright notice and this permission notice appear in all michael@27: ## copies. michael@27: ## michael@27: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@27: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@27: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@27: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@27: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@27: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@27: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@27: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@27: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@27: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@27: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@27: ## SUCH DAMAGE. michael@27: ## michael@27: michael@488: # package version michael@488: %define V_tarball 1.3.0 michael@488: %define V_subdir 1.3.0 michael@488: michael@27: # package information michael@27: Name: libpcap michael@27: Summary: Network Packet Capture Library michael@27: URL: http://www.tcpdump.org/ michael@27: Vendor: The Tcpdump Group michael@27: Packager: OpenPKG Foundation e.V. michael@27: Distribution: OpenPKG Community michael@27: Class: BASE michael@27: Group: Capturing michael@27: License: GPL michael@488: Version: %{V_tarball} michael@489: Release: 20120800 michael@27: michael@27: # list of sources michael@488: Source0: http://www.tcpdump.org/release/libpcap-%{V_tarball}.tar.gz michael@27: Patch0: libpcap.patch michael@27: michael@27: # build information michael@489: BuildPreReq: OpenPKG, openpkg >= 20100101, make, bison, flex michael@488: PreReq: OpenPKG, openpkg >= 20100101 michael@27: michael@27: %description michael@27: libpcap provides a portable framework for low-level network monitoring and michael@27: system-independent interface for user-level packet capture. The libpcap michael@27: interface supports a filtering mechanism based on the architecture in the michael@27: BSD packet filter. On systems that don't have BPF, all packets are read michael@27: into user-space and the BPF filters are evaluated in the libpcap library. michael@27: michael@27: %track michael@27: prog libpcap = { michael@488: version = %{V_tarball} michael@488: url = http://www.tcpdump.org/ michael@27: regex = libpcap-(__VER__)\.tar\.gz michael@27: } michael@27: michael@27: %prep michael@488: %setup -q -n libpcap-%{V_subdir} michael@27: %patch -p0 michael@489: %{l_shtool} subst \ michael@489: -e 's;\(#if defined(PF_PACKET) && defined(SO_ATTACH_FILTER)\)$;\1 \&\& defined(__linux__);g' \ michael@489: gencode.c michael@27: michael@27: %build michael@27: CC="%{l_cc}" \ michael@27: CFLAGS="%{l_cflags -O}" \ michael@488: GREP="grep" \ michael@27: ./configure \ michael@27: --prefix=%{l_prefix} \ michael@499: --mandir=%{l_prefix}/man michael@27: %{l_make} %{l_mflags -O} michael@27: michael@27: %install michael@27: %{l_shtool} mkdir -f -p -m 755 \ michael@27: $RPM_BUILD_ROOT%{l_prefix}/bin \ michael@27: $RPM_BUILD_ROOT%{l_prefix}/man/man3 michael@27: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@27: ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man3 michael@27: %{l_shtool} move -e '*.3pcap' '%1.3' michael@27: ) || exit $? michael@27: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@27: michael@27: %files -f files michael@27: michael@27: %clean michael@27: