summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Bogusz2020-04-28 16:48:01 (GMT)
committerJakub Bogusz2020-04-28 16:48:01 (GMT)
commit6911ac18f24a407ba9cd58245c659c20276fa4ef (patch)
tree6759c810bebe964b83b8a00024b3d5eb92f23f95
parent56028d0452ff7c3f72296bef8fdc674c192710c0 (diff)
downloadlibnet-6911ac18f24a407ba9cd58245c659c20276fa4ef.zip
libnet-6911ac18f24a407ba9cd58245c659c20276fa4ef.tar.gz
- updated URLs, updated to 1.2 (new release after >7 years; soname changed)auto/th/libnet-1.2-1
- updated proc patch - removed obsolete leaking-fd patch - added libdir patch (remove -Llibdir from `libnet-config --libs`) - .pc file added, .la file dropped
-rw-r--r--libnet-leaking-fd.patch21
-rw-r--r--libnet-libdir.patch11
-rw-r--r--libnet-proc.patch4
-rw-r--r--libnet.spec85
4 files changed, 77 insertions, 44 deletions
diff --git a/libnet-leaking-fd.patch b/libnet-leaking-fd.patch
deleted file mode 100644
index 397ed3c..0000000
--- a/libnet-leaking-fd.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- libnet/src/libnet_if_addr.c.bak 2008-11-03 17:06:55.493985477 +0100
-+++ libnet/src/libnet_if_addr.c 2008-11-03 17:07:07.317325455 +0100
-@@ -141,6 +141,7 @@
- snprintf(errbuf, LIBNET_ERRBUF_SIZE,
- "%s(): fopen(proc_dev_file) failed: %s\n", __func__,
- strerror(errno));
-+ close(fd);
- return (-1);
- }
- #endif
-@@ -251,7 +263,9 @@
- #endif
-
- } /* while|for */
--
-+
-+ close(fd);
-+
- #ifdef HAVE_LINUX_PROCFS
- if (ferror(fp))
- {
diff --git a/libnet-libdir.patch b/libnet-libdir.patch
new file mode 100644
index 0000000..3655eb6
--- /dev/null
+++ b/libnet-libdir.patch
@@ -0,0 +1,11 @@
+--- libnet-1.2/libnet-config.in.orig 2019-10-07 17:48:13.000000000 +0200
++++ libnet-1.2/libnet-config.in 2020-04-28 18:26:40.773821834 +0200
+@@ -17,7 +17,7 @@
+
+ libnet_defines="@PKG_CONFIG_DEFINES@"
+ libnet_cflags="-I${includedir} @PKG_CONFIG_CFLAGS@"
+-libnet_libs="-L${libdir} @PKG_CONFIG_LIBS@ -lnet"
++libnet_libs="@PKG_CONFIG_LIBS@ -lnet"
+
+ usage()
+ {
diff --git a/libnet-proc.patch b/libnet-proc.patch
index c301a13..31564af 100644
--- a/libnet-proc.patch
+++ b/libnet-proc.patch
@@ -1,5 +1,5 @@
---- libnet/acinclude.m4~ 2004-01-16 00:53:06.000000000 +0100
-+++ libnet/acinclude.m4 2009-08-28 21:58:51.368425567 +0200
+--- libnet-1.2/m4/acinclude.m4~ 2004-01-16 00:53:06.000000000 +0100
++++ libnet-1.2/m4/acinclude.m4 2009-08-28 21:58:51.368425567 +0200
@@ -12,18 +12,9 @@
dnl results: HAVE_LINUX_PROCFS
dnl
diff --git a/libnet.spec b/libnet.spec
index ef0f791..407e4a8 100644
--- a/libnet.spec
+++ b/libnet.spec
@@ -1,20 +1,26 @@
+#
+# Conditional build:
+%bcond_without apidocs # Doxygen documentation in HTML format
+
Summary: C library for portable packet creation and injection
Summary(pl.UTF-8): Biblioteka C do przenośnego tworzenia i wprowadzania pakietów
Summary(pt_BR.UTF-8): API para funções de rede de baixo nível
Name: libnet
-Version: 1.1.6
-Release: 2
+Version: 1.2
+Release: 1
Epoch: 1
License: BSD
Group: Libraries
-Source0: http://downloads.sourceforge.net/libnet-dev/%{name}-%{version}.tar.gz
-# Source0-md5: 710296fe424a49344e5fcc0d09e53317
-Patch0: %{name}-leaking-fd.patch
+#Source0Download: https://github.com/libnet/libnet/releases
+Source0: https://github.com/libnet/libnet/releases/download/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: a36c669e0cdfda6a2aa3adfb1f6fe60a
+Patch0: %{name}-libdir.patch
Patch1: %{name}-proc.patch
-URL: http://sourceforge.net/projects/libnet-dev/
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: libtool
+URL: https://github.com/libnet/libnet
+BuildRequires: autoconf >= 2.69
+BuildRequires: automake >= 1:1.14
+%{?with_apidocs:BuildRequires: doxygen}
+BuildRequires: libtool >= 2:2.4.2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -75,11 +81,28 @@ Biblioteka statyczna libnet.
Arquivos de cabeçalho e bibliotecas usadas no desenvolvimento de
aplicativos estáticos que usam libnet.
+%package apidocs
+Summary: API documentation for libnet
+Summary(pl.UTF-8): Dokumentacja API biblioteki libnet
+Group: Documentation
+%if "%{_rpmversion}" >= "4.6"
+BuildArch: noarch
+%endif
+
+%description apidocs
+API documentation for libnet.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki libnet.
+
%package examples
Summary: libnet - example programs
Summary(pl.UTF-8): libnet - programy przykładowe
Group: Development/Libraries
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+%if "%{_rpmversion}" >= "4.6"
+BuildArch: noarch
+%endif
%description examples
libnet - example programs.
@@ -94,28 +117,39 @@ libnet - programy przykładowe.
%build
%{__libtoolize}
-%{__aclocal}
+%{__aclocal} -I m4
%{__autoconf}
+%{__autoheader}
%{__automake}
-%configure
+%configure \
+ %{!?with_apidocs:--disable-doxygen-html} \
+ --with-link-layer=linux
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_examplesdir}/%{name}-%{version},%{_mandir}/man3} \
- $RPM_BUILD_ROOT{/%{_lib},%{_bindir}}
+install -d $RPM_BUILD_ROOT{/%{_lib},%{_mandir}/man1,%{_examplesdir}/%{name}-%{version}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-mv $RPM_BUILD_ROOT%{_libdir}/libnet.so.* $RPM_BUILD_ROOT/%{_lib}
+cp -p sample/*.[ch] $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/libnet.so.* $RPM_BUILD_ROOT/%{_lib}
ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libnet.so.*.*.*) \
$RPM_BUILD_ROOT%{_libdir}/libnet.so
-install sample/*.[ch] $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-install doc/man/man3/libnet-functions.h.3 $RPM_BUILD_ROOT%{_mandir}/man3
-install libnet-config $RPM_BUILD_ROOT%{_bindir}
+# fix man section
+%{__mv} $RPM_BUILD_ROOT{%{_mandir}/man3/libnet-config.3,%{_mandir}/man1/libnet-config.1}
+
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libnet.la
+
+%if %{with apidocs}
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/libnet
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -125,23 +159,32 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README doc/{CHANGELOG,MIGRATION,PACKET_BUILDING}
+%doc ChangeLog.md LICENSE README.md doc/{MIGRATION,RAWSOCKET}.md
%attr(755,root,root) /%{_lib}/libnet.so.*.*.*
-%attr(755,root,root) %ghost /%{_lib}/libnet.so.1
+%attr(755,root,root) %ghost /%{_lib}/libnet.so.9
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/libnet-config
%attr(755,root,root) %{_libdir}/libnet.so
-%{_libdir}/libnet.la
%{_includedir}/libnet.h
%{_includedir}/libnet
-%{_mandir}/man3/libnet*.h.3*
+%{_pkgconfigdir}/libnet.pc
+%{_mandir}/man1/libnet-config.1*
+%{_mandir}/man3/libnet.3*
+%{_mandir}/man3/libnet-functions.3*
+%{_mandir}/man3/libnet-macros.3*
%files static
%defattr(644,root,root,755)
%{_libdir}/libnet.a
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/html/*.{css,html,js,png}
+%endif
+
%files examples
%defattr(644,root,root,755)
%{_examplesdir}/%{name}-%{version}