-Summary: Packet creation and handling library
-Summary(pl): Biblioteka do generacji i obróbki pakietów
+Summary: "libpwrite" Network Routine Library
+Summary(pl): Biblioteka czynno¶ci sieciowych
+Summary(pt_BR): API para funções de rede de baixo nível
Name: libnet
-Group: Development/Libraries
-Group(pl): Programowanie/Biblioteki
-Version: 1.0
-Release: 1
-Source: http://www.packetfactory.net/libnet/dist/%{name}-%{version}.tgz
-Patch: libnet-autoconf.patch
-Copyright: distributable
-URL: http://www.packetfactory.net/libnet
-BuildPreReq: libpcap-devel
-BuildRoot: /tmp/%{name}-%{version}-root
-
-%define _prefix /usr
+Version: 1.0.2a
+Release: 6
+Epoch: 1
+License: BSD
+Group: Libraries
+Source0: http://www.packetfactory.net/libnet/dist/%{name}-%{version}.tar.gz
+Patch0: %{name}-shared.patch
+URL: http://www.packetfactory.net/libnet/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libpcap-devel
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Libnet is a collection of routines to help with the construction and
-sending of network packets at the link layer and the IP layer.
-Use libnet in conjunction with packet capture library (libpcap)
-and you can write some really cool stuff!.
+The Network Library provides a simple API for commonly used low-level
+network functions (mainly packet injection). Using libnet, it is easy
+to build and write arbitrary network packets. It provides a portable
+framework for low-level network packet writing and handling (use
+libnet in conjunction with libpcap and you can write some really cool
+stuff). Libnet includes packet creation at the IP layer and at the
+link layer as well as a host of supplementary and complementary
+functionality.
+
+%description -l pl
+Biblioteka dostarcza API dla popularnych nisko-poziomowych funkcji
+sieciowych (g³ównie wstrzykuj±cych pakiety).
+
+%description -l pt_BR
+Este pacote fornece uma API simples para funções de rede de baixo
+nível comumente usadas (principalmente injeção de pacotes). Usando
+libnet, é simples construir e enviar pacotes de rede arbitrários.
+
+%package devel
+Summary: Header files and develpment documentation for libnet
+Summary(pl): Pliki nag³ówkowe i dokumetacja do libnet
+Summary(pt_BR): Arquivos do pacote libnet para desenvolvimento
+Group: Development/Libraries
+Requires: %{name} = %{version}
+
+%description devel
+Header files and develpment documentation for libnet.
+
+%description devel -l pl
+Pliki nag³ówkowe i dokumetacja do libnet.
+
+%description devel -l pt_BR
+Arquivos de cabeçalho e bibliotecas usadas no desenvolvimento de
+aplicativos que usam libnet.
+
+%package static
+Summary: Static libnet library
+Summary(pl): Biblioteka statyczna libnet
+Summary(pt_BR): Arquivos do pacote libnet para desenvolvimento estático
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}
+
+%description static
+Static libnet library.
-%description -l pl
+%description static -l pl
+Biblioteka statyczna libnet.
-Libnet jest bibliotek± na któr± sk³adaj± siê procedury pomagaj±ce
-w tworzeniu i wysy³aniu pakietów w sieciowych warstwach: danych oraz IP.
-W po³±czeniu z bibliotek± do przechwytywania pakietów (libpcap), libnet
-pozwoli Ci na napisanie naprawdê fajnych rzeczy!.
+%description static -l pt_BR
+Arquivos de cabeçalho e bibliotecas usadas no desenvolvimento de
+aplicativos estáticos que usam libnet.
%prep
%setup -q -n Libnet-%{version}
-%patch -p0
+%patch0 -p1
%build
-CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
-autoconf && %configure \
+%{__aclocal}
+%{__autoconf}
+%configure \
--with-pf_packet=yes
-
-make
-rm -rf doc/{.#CHANGELOG.1.13,CVS,html/CVS}
-rm -rf example/{CVS,html/CVS}
+%{__make} CFLAGS="%{rpmcflags}"
%install
rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT install
-gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man3/*
-gzip -9nf $RPM_BUILD_DIR/Libnet-%{version}/doc/CHANGELOG* \
- $RPM_BUILD_DIR/Libnet-%{version}/doc/README* \
- $RPM_BUILD_DIR/Libnet-%{version}/doc/{COPYING,PORTS,TODO}
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpwrite*
-ln -sf libnet.a $RPM_BUILD_ROOT%{_libdir}/libpwrite.a
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/src/libnet
-cp example/* $RPM_BUILD_ROOT%{_prefix}/src/libnet/
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ MAN_PREFIX=%{_mandir}/man3
+
+ln -sf libnet.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libnet.so
+ln -sf libnet.so $RPM_BUILD_ROOT%{_libdir}/libpwrite.so
+ln -sf libnet.a $RPM_BUILD_ROOT%{_libdir}/libpwrite.a
%clean
rm -rf $RPM_BUILD_ROOT
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
%files
%defattr(644,root,root,755)
+%doc README doc/CHANGELOG*
+%attr(755,root,root) %{_libdir}/lib*.so.*.*
+
+%files devel
+%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man3/*
-%{_includedir}/*
-%{_libdir}/*
-%{_prefix}/src/libnet
-%doc doc/*.gz
+%attr(755,root,root) %{_libdir}/lib*.so
+%{_includedir}/*.h
+%{_includedir}/libnet
+%{_mandir}/man*/*
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/lib*.a