%define name    arpscan
%define version 0.5
%define release 2%{?_dist_release}

Summary:	Very simple ARP scanner
Summary(ja):	シンプルな ARP スキャナ
Name:           %{name}
Version:        %{version}
Release:        %{release}
License:	GPL
Group:		Applications/Internet
Packager: 	OOI Keita <ooi.keita@gmail.com>
Distribution: 	Vine Linux
Vendor:		Project Vine
URL:		http://wizard.ae.krakow.pl/~jb/arpscan/
Source0:	http://wizard.ae.krakow.pl/~jb/arpscan/%{name}-%{version}.tar.bz2
Source1:	http://standards.ieee.org/regauth/oui/oui.txt.bz2
Patch:		arpscan_awk.patch
BuildRequires:	gawk
#BuildRequires:	wget
BuildRoot:      %{_tmppath}/%{name}-%{version}-root

%description
Arpscan is a utility that scans local network using ARP protocol
and reports alive hosts. Program is designed for Linux.

%description -l ja
ARPプロトコルを使って、ローカルネットワークをスキャンし、
活動中のホストを報告するユーティリティです。

%prep

%setup -q
%patch -p1

#make db-download
bzcat %{SOURCE1} > oui.txt

%build

make \
    CC=%{__cc} \
    CFLAGS="%{optflags} -DVER=\$(VERSION) -DOUI=\$(OUI)" \
    OUI=%{_datadir}/%{name}/oui

gawk -f oui.awk oui.txt > oui

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_datadir}/%{name}/

install -m0755 %{name} %{buildroot}%{_sbindir}/%{name}
install -m0644 oui %{buildroot}%{_datadir}/%{name}//oui

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%attr(0755,root,root) %{_sbindir}/*
%{_datadir}/%{name}

%changelog
* Sun Sep 14 2008 Shu KONNO <owa@bg.wakwak.com> 0.5-2vl5
- applied new versioning policy, spec in utf-8

* Thu Aug  3 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.5-1vl2
- rebuilt for VineSeed (4.0)

* Sun May 22 2005 OOI Keita <ooi.keita@gmail.com> 0.5-1vl1
- based on mdk

* Sat Jan 08 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.5-1mdk
- initial pld import
