]>
Commit | Line | Data |
---|---|---|
6911ac18 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # Doxygen documentation in HTML format | |
4 | ||
0d9bca01 | 5 | Summary: C library for portable packet creation and injection |
dccddd41 ER |
6 | Summary(pl.UTF-8): Biblioteka C do przenośnego tworzenia i wprowadzania pakietów |
7 | Summary(pt_BR.UTF-8): API para funções de rede de baixo nível | |
5b413584 | 8 | Name: libnet |
6911ac18 JB |
9 | Version: 1.2 |
10 | Release: 1 | |
5b413584 AM |
11 | Epoch: 1 |
12 | License: BSD | |
13 | Group: Libraries | |
6911ac18 JB |
14 | #Source0Download: https://github.com/libnet/libnet/releases |
15 | Source0: https://github.com/libnet/libnet/releases/download/v%{version}/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: a36c669e0cdfda6a2aa3adfb1f6fe60a | |
17 | Patch0: %{name}-libdir.patch | |
8ecf55bf | 18 | Patch1: %{name}-proc.patch |
6911ac18 JB |
19 | URL: https://github.com/libnet/libnet |
20 | BuildRequires: autoconf >= 2.69 | |
21 | BuildRequires: automake >= 1:1.14 | |
22 | %{?with_apidocs:BuildRequires: doxygen} | |
23 | BuildRequires: libtool >= 2:2.4.2 | |
5b413584 AM |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
25 | ||
26 | %description | |
c257df84 | 27 | The Network Library provides a simple API for commonly used low-level |
28 | network functions (mainly packet injection). Using libnet, it is easy | |
29 | to build and write arbitrary network packets. It provides a portable | |
30 | framework for low-level network packet writing and handling (use | |
31 | libnet in conjunction with libpcap and you can write some really cool | |
32 | stuff). Libnet includes packet creation at the IP layer and at the | |
33 | link layer as well as a host of supplementary and complementary | |
34 | functionality. | |
5b413584 | 35 | |
1d706b6c | 36 | %description -l pl.UTF-8 |
0d9bca01 | 37 | Biblioteka dostarcza API dla popularnych niskopoziomowych funkcji |
1d706b6c JR |
38 | sieciowych (głównie wprowadzania pakietów). Przy użyciu libnet można |
39 | łatwo stworzyć dowolne pakiety sieciowe. Biblioteka dostarcza | |
40 | przenośny szkielet do niskopoziomowego zapisu i obsługi pakietów | |
41 | sieciowych (w połączeniu z libpcap można napisać coś naprawdę | |
42 | fajnego). Libnet obejmuje tworzenie pakietów w warstwie IP i | |
43 | połączenia, a także funkcjonalność dodatkową i uzupełniającą. | |
44 | ||
45 | %description -l pt_BR.UTF-8 | |
46 | Este pacote fornece uma API simples para funções de rede de baixo | |
47 | nível comumente usadas (principalmente injeção de pacotes). Usando | |
48 | libnet, é simples construir e enviar pacotes de rede arbitrários. | |
52e6c97d | 49 | |
5b413584 AM |
50 | %package devel |
51 | Summary: Header files and develpment documentation for libnet | |
dccddd41 ER |
52 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumetacja do libnet |
53 | Summary(pt_BR.UTF-8): Arquivos do pacote libnet para desenvolvimento | |
5b413584 | 54 | Group: Development/Libraries |
8b3be3d6 | 55 | Requires: %{name} = %{epoch}:%{version}-%{release} |
5b413584 AM |
56 | |
57 | %description devel | |
58 | Header files and develpment documentation for libnet. | |
59 | ||
1d706b6c JR |
60 | %description devel -l pl.UTF-8 |
61 | Pliki nagłówkowe i dokumentacja do libnet. | |
5b413584 | 62 | |
1d706b6c JR |
63 | %description devel -l pt_BR.UTF-8 |
64 | Arquivos de cabeçalho e bibliotecas usadas no desenvolvimento de | |
52e6c97d | 65 | aplicativos que usam libnet. |
66 | ||
5b413584 AM |
67 | %package static |
68 | Summary: Static libnet library | |
dccddd41 ER |
69 | Summary(pl.UTF-8): Biblioteka statyczna libnet |
70 | Summary(pt_BR.UTF-8): Arquivos do pacote libnet para desenvolvimento estático | |
5b413584 | 71 | Group: Development/Libraries |
8b3be3d6 | 72 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} |
5b413584 AM |
73 | |
74 | %description static | |
75 | Static libnet library. | |
76 | ||
1d706b6c | 77 | %description static -l pl.UTF-8 |
5b413584 AM |
78 | Biblioteka statyczna libnet. |
79 | ||
1d706b6c JR |
80 | %description static -l pt_BR.UTF-8 |
81 | Arquivos de cabeçalho e bibliotecas usadas no desenvolvimento de | |
82 | aplicativos estáticos que usam libnet. | |
52e6c97d | 83 | |
6911ac18 JB |
84 | %package apidocs |
85 | Summary: API documentation for libnet | |
86 | Summary(pl.UTF-8): Dokumentacja API biblioteki libnet | |
87 | Group: Documentation | |
6911ac18 | 88 | BuildArch: noarch |
6911ac18 JB |
89 | |
90 | %description apidocs | |
91 | API documentation for libnet. | |
92 | ||
93 | %description apidocs -l pl.UTF-8 | |
94 | Dokumentacja API biblioteki libnet. | |
95 | ||
5ba38c4a | 96 | %package examples |
a60bca6f | 97 | Summary: libnet - example programs |
dccddd41 | 98 | Summary(pl.UTF-8): libnet - programy przykładowe |
a60bca6f | 99 | Group: Development/Libraries |
8b3be3d6 | 100 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} |
6911ac18 | 101 | BuildArch: noarch |
5ba38c4a MW |
102 | |
103 | %description examples | |
2659d242 | 104 | libnet - example programs. |
5ba38c4a | 105 | |
1d706b6c JR |
106 | %description examples -l pl.UTF-8 |
107 | libnet - programy przykładowe. | |
5ba38c4a | 108 | |
5b413584 | 109 | %prep |
437de0b7 | 110 | %setup -q |
8ecf55bf JR |
111 | %patch0 -p1 |
112 | %patch1 -p1 | |
5b413584 AM |
113 | |
114 | %build | |
2659d242 | 115 | %{__libtoolize} |
6911ac18 | 116 | %{__aclocal} -I m4 |
2659d242 | 117 | %{__autoconf} |
6911ac18 | 118 | %{__autoheader} |
2659d242 | 119 | %{__automake} |
6911ac18 JB |
120 | %configure \ |
121 | %{!?with_apidocs:--disable-doxygen-html} \ | |
122 | --with-link-layer=linux | |
437de0b7 JR |
123 | |
124 | %{__make} | |
5b413584 AM |
125 | |
126 | %install | |
127 | rm -rf $RPM_BUILD_ROOT | |
6911ac18 | 128 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_mandir}/man1,%{_examplesdir}/%{name}-%{version}} |
5b413584 | 129 | |
c257df84 | 130 | %{__make} install \ |
c36384c4 | 131 | DESTDIR=$RPM_BUILD_ROOT |
5b413584 | 132 | |
6911ac18 JB |
133 | cp -p sample/*.[ch] $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
134 | ||
135 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libnet.so.* $RPM_BUILD_ROOT/%{_lib} | |
0694c078 JR |
136 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libnet.so.*.*.*) \ |
137 | $RPM_BUILD_ROOT%{_libdir}/libnet.so | |
138 | ||
6911ac18 JB |
139 | # fix man section |
140 | %{__mv} $RPM_BUILD_ROOT{%{_mandir}/man3/libnet-config.3,%{_mandir}/man1/libnet-config.1} | |
141 | ||
142 | # obsoleted by pkg-config | |
143 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libnet.la | |
144 | ||
145 | %if %{with apidocs} | |
146 | # packaged as %doc | |
147 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/libnet | |
148 | %endif | |
5b413584 | 149 | |
45edf3a0 JB |
150 | %clean |
151 | rm -rf $RPM_BUILD_ROOT | |
5b413584 AM |
152 | |
153 | %post -p /sbin/ldconfig | |
154 | %postun -p /sbin/ldconfig | |
155 | ||
5b413584 AM |
156 | %files |
157 | %defattr(644,root,root,755) | |
6911ac18 | 158 | %doc ChangeLog.md LICENSE README.md doc/{MIGRATION,RAWSOCKET}.md |
331c546a | 159 | %attr(755,root,root) /%{_lib}/libnet.so.*.*.* |
6911ac18 | 160 | %attr(755,root,root) %ghost /%{_lib}/libnet.so.9 |
5b413584 AM |
161 | |
162 | %files devel | |
163 | %defattr(644,root,root,755) | |
99a5615b | 164 | %attr(755,root,root) %{_bindir}/libnet-config |
331c546a | 165 | %attr(755,root,root) %{_libdir}/libnet.so |
331c546a | 166 | %{_includedir}/libnet.h |
5b413584 | 167 | %{_includedir}/libnet |
6911ac18 JB |
168 | %{_pkgconfigdir}/libnet.pc |
169 | %{_mandir}/man1/libnet-config.1* | |
170 | %{_mandir}/man3/libnet.3* | |
171 | %{_mandir}/man3/libnet-functions.3* | |
172 | %{_mandir}/man3/libnet-macros.3* | |
5b413584 AM |
173 | |
174 | %files static | |
175 | %defattr(644,root,root,755) | |
331c546a | 176 | %{_libdir}/libnet.a |
5ba38c4a | 177 | |
6911ac18 JB |
178 | %if %{with apidocs} |
179 | %files apidocs | |
180 | %defattr(644,root,root,755) | |
181 | %doc doc/html/*.{css,html,js,png} | |
182 | %endif | |
183 | ||
5ba38c4a MW |
184 | %files examples |
185 | %defattr(644,root,root,755) | |
186 | %{_examplesdir}/%{name}-%{version} |