]> git.pld-linux.org Git - packages/libnet.git/blob - libnet.spec
- unconditional noarch subpackages
[packages/libnet.git] / libnet.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # Doxygen documentation in HTML format
4
5 Summary:        C library for portable packet creation and injection
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
8 Name:           libnet
9 Version:        1.2
10 Release:        1
11 Epoch:          1
12 License:        BSD
13 Group:          Libraries
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
18 Patch1:         %{name}-proc.patch
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
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %description
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.
35
36 %description -l pl.UTF-8
37 Biblioteka dostarcza API dla popularnych niskopoziomowych funkcji
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.
49
50 %package devel
51 Summary:        Header files and develpment documentation for libnet
52 Summary(pl.UTF-8):      Pliki nagłówkowe i dokumetacja do libnet
53 Summary(pt_BR.UTF-8):   Arquivos do pacote libnet para desenvolvimento
54 Group:          Development/Libraries
55 Requires:       %{name} = %{epoch}:%{version}-%{release}
56
57 %description devel
58 Header files and develpment documentation for libnet.
59
60 %description devel -l pl.UTF-8
61 Pliki nagłówkowe i dokumentacja do libnet.
62
63 %description devel -l pt_BR.UTF-8
64 Arquivos de cabeçalho e bibliotecas usadas no desenvolvimento de
65 aplicativos que usam libnet.
66
67 %package static
68 Summary:        Static libnet library
69 Summary(pl.UTF-8):      Biblioteka statyczna libnet
70 Summary(pt_BR.UTF-8):   Arquivos do pacote libnet para desenvolvimento estático
71 Group:          Development/Libraries
72 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
73
74 %description static
75 Static libnet library.
76
77 %description static -l pl.UTF-8
78 Biblioteka statyczna libnet.
79
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.
83
84 %package apidocs
85 Summary:        API documentation for libnet
86 Summary(pl.UTF-8):      Dokumentacja API biblioteki libnet
87 Group:          Documentation
88 BuildArch:      noarch
89
90 %description apidocs
91 API documentation for libnet.
92
93 %description apidocs -l pl.UTF-8
94 Dokumentacja API biblioteki libnet.
95
96 %package examples
97 Summary:        libnet - example programs
98 Summary(pl.UTF-8):      libnet - programy przykładowe
99 Group:          Development/Libraries
100 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
101 BuildArch:      noarch
102
103 %description examples
104 libnet - example programs.
105
106 %description examples -l pl.UTF-8
107 libnet - programy przykładowe.
108
109 %prep
110 %setup -q
111 %patch0 -p1
112 %patch1 -p1
113
114 %build
115 %{__libtoolize}
116 %{__aclocal} -I m4
117 %{__autoconf}
118 %{__autoheader}
119 %{__automake}
120 %configure \
121         %{!?with_apidocs:--disable-doxygen-html} \
122         --with-link-layer=linux
123
124 %{__make}
125
126 %install
127 rm -rf $RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT{/%{_lib},%{_mandir}/man1,%{_examplesdir}/%{name}-%{version}}
129
130 %{__make} install \
131         DESTDIR=$RPM_BUILD_ROOT
132
133 cp -p sample/*.[ch] $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
134
135 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libnet.so.* $RPM_BUILD_ROOT/%{_lib}
136 ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libnet.so.*.*.*) \
137         $RPM_BUILD_ROOT%{_libdir}/libnet.so
138
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
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %post   -p /sbin/ldconfig
154 %postun -p /sbin/ldconfig
155
156 %files
157 %defattr(644,root,root,755)
158 %doc ChangeLog.md LICENSE README.md doc/{MIGRATION,RAWSOCKET}.md
159 %attr(755,root,root) /%{_lib}/libnet.so.*.*.*
160 %attr(755,root,root) %ghost /%{_lib}/libnet.so.9
161
162 %files devel
163 %defattr(644,root,root,755)
164 %attr(755,root,root) %{_bindir}/libnet-config
165 %attr(755,root,root) %{_libdir}/libnet.so
166 %{_includedir}/libnet.h
167 %{_includedir}/libnet
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*
173
174 %files static
175 %defattr(644,root,root,755)
176 %{_libdir}/libnet.a
177
178 %if %{with apidocs}
179 %files apidocs
180 %defattr(644,root,root,755)
181 %doc doc/html/*.{css,html,js,png}
182 %endif
183
184 %files examples
185 %defattr(644,root,root,755)
186 %{_examplesdir}/%{name}-%{version}
This page took 0.093135 seconds and 3 git commands to generate.