Blob Blame History Raw
%global gitdate 20131221
%global commit  16ba99a863a89dab25cbf8e9ca410b19a7494c42
%global gitrev  %(c=%{commit}; echo ${c:0:7})

Name:           ngrep
Version:        1.45
Release:        15.git%{gitdate}.%{gitrev}%{?dist}
Summary:        Network layer grep tool
License:        BSD with advertising
URL:            http://ngrep.sourceforge.net
# Link below is the release link.
# Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
# However we need to checkout the latest version from VCS repository
# SourceForge has offered snapshot download so we just use it.
Source0:        http://sourceforge.net/code-snapshots/git/n/ng/ngrep/code.git/ngrep-code-%{commit}.zip
Source1:        ngrep-README.fedora
Patch0:         ngrep-gcc-format-security-fix.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libpcap-devel
BuildRequires:  pcre-devel

%description
ngrep strives to provide most of GNU grep's common features, applying them
to the network layer. ngrep is a pcap-aware tool that will allow you to
specify extended regular or hexadecimal expressions to match against data
payloads of packets. It currently recognizes TCP, UDP, ICMP, IGMP and Raw
protocols across Ethernet, PPP, SLIP, FDDI, Token Ring, 802.11 and null
interfaces, and understands bpf filter logic in the same fashion as more
common packet sniffing tools, such as tcpdump and snoop.

%prep
%setup -qn ngrep-code-%{commit}
%patch0 -p1
install -pm644 %{S:1} ./README.fedora

%build
autoreconf -fiv
# Note: building with PCRE instead of GNU regex because of license
# incompatibilities (this one's basically a BSD with advertising clause).
%configure --with-regex=pcre --with-regex-impl=sys \
           --enable-ipv6 \
           --with-pcap-includes=%{_includedir}/pcap
make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" STRIPFLAG=

%install
make install DESTDIR=%{buildroot} BINDIR_INSTALL=%{_sbindir}

%files
%doc doc/CHANGES.txt doc/CREDITS.txt doc/README.txt LICENSE.txt README.fedora
%{_sbindir}/ngrep
%{_mandir}/man8/ngrep.8*

%changelog
* Sat Dec 21 2013 Christopher Meng <rpm@cicku.me> - 1.45-15.git20131221.16ba99a
- Checkout from official repo(BZ#1044630).
- Remove patch for system pcre as configure script can handle it now.
- Add format security check fix due to dumb GCC.

* Mon Aug 26 2013 Christopher Meng <rpm@cicku.me> - 1.45-14
- SPEC Cleanup.
- AArch64 support(BZ#926232).

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 1.45-10
- Rebuild against PCRE 8.30

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Mar 16 2010 Oliver Falk <oliver@linux-kernel.at> 1.45-7
- pcap has moved to /usr/include/pcap, instead of /usr/include :-/

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 1.45-4
- Bump-n-build for GCC 4.3

* Wed Aug 22 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 1.45-3
- License clarification

* Tue Aug 21 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 1.45-2
- Rebuild for BuildID

* Wed Nov 29 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 1.45-1
- Upgrade to 1.45
- Enable IPv6 support
- Rebuild due to libpcap upgrade

* Wed Oct 04 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 1.44-7
- Bump-n-build

* Tue Sep 19 2006 Patrick "Jima" Laughton <jima@beer.tclug.org>	- 1.44-6
- Bump for FC6 rebuild

* Fri Sep 08 2006 Oliver Falk <oliver@linux-kernel.at> - 1.44-5
- Fix BR

* Tue Oct 18 2005 Oliver Falk <oliver@linux-kernel.at> - 1.44-4
- Bug #170967, useless debuginfo was generated

* Wed Aug 24 2005 Oliver Falk <oliver@linux-kernel.at> - 1.44-3
- Bugs from #166481

* Mon Aug 22 2005 Oliver Falk <oliver@linux-kernel.at> - 1.44-2
- Bug #165963
- Merge with package from Ville
  See also https://www.redhat.com/archives/fedora-extras-list/2005-July/msg01009.html

* Thu Aug 11 2005 Oliver Falk <oliver@linux-kernel.at> - 1.44-1
- Initial build for Fedora Extras