2 # - %attr(755,root,root) %{_bindir}/event_rpcgen.py
3 # - needs -levent: /usr/lib64/libevent_extra-1.4.so.2.1.3
6 %bcond_without static_libs # don't build static library
7 %bcond_without dietlibc # don't build static dietlibc library
9 Summary: libevent - an event notification library
10 Summary(pl.UTF-8): libevent - biblioteka powiadamiająca o zdarzeniach
16 Source0: http://www.monkey.org/~provos/%{name}-%{version}-stable.tar.gz
17 # Source0-md5: a00e037e4d3f9e4fe9893e8a2d27918c
18 Patch0: %{name}-fpm.patch
19 Patch1: %{name}.fb-changes.diff
20 Patch2: %{name}-link.patch
21 URL: http://www.monkey.org/~provos/libevent/
22 BuildRequires: autoconf
23 BuildRequires: automake
24 %{?with_dietlibc:BuildRequires: dietlibc-static >= 2:0.31-5}
25 BuildRequires: libtool
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 # to get backslash, we need to escape it from spec parser. therefore "\\|" not "\|" here
29 %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
30 %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
33 The libevent API provides a mechanism to execute a callback function
34 when a specific event occurs on a file descriptor or after a timeout
35 has been reached. It is meant to replace the asynchronous event loop
36 found in event-driven network servers.
38 %description -l pl.UTF-8
39 API libevent dostarcza mechanizm do wykonywania funkcji callback,
40 kiedy nastąpiło określone zdarzenie w deskryptorze pliku lub po
41 określonym czasie. Ma to na celu zastąpienie asynchronicznych pętli w
42 sterowanych zdarzeniami usługach sieciowych.
45 Summary: Header files for libevent library
46 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libevent
47 Group: Development/Libraries
48 Requires: %{name} = %{version}-%{release}
51 Header files for libevent library.
53 %description devel -l pl.UTF-8
54 Pliki nagłówkowe biblioteki libevent.
57 Summary: Static libevent library
58 Summary(pl.UTF-8): Statyczna biblioteka libevent
59 Group: Development/Libraries
60 Requires: %{name}-devel = %{version}-%{release}
63 Static libevent library.
65 %description static -l pl.UTF-8
66 Statyczna biblioteka libevent.
69 Summary: Static dietlibc libevent library
70 Summary(pl.UTF-8): Biblioteka statyczna dietlibc libevent
71 Group: Development/Libraries
72 Requires: %{name}-devel = %{version}-%{release}
75 Static dietlibc libevent library.
77 %description dietlibc -l pl.UTF-8
78 Biblioteka statyczna dietlibc libevent.
81 %setup -q -n %{name}-%{version}-stable
93 CC="diet %{__cc} %{rpmcflags} %{rpmldflags} -Os -D_BSD_SOURCE -D_EVENT_HAVE_FD_MASK" \
97 # libtool sucks, build just the libs
99 mv .libs/libevent.a diet-libevent.a
100 mv .libs/libevent_core.a diet-libevent_core.a
101 mv .libs/libevent_extra.a diet-libevent_extra.a
106 %{!?with_static_libs:--disable-static}
110 rm -rf $RPM_BUILD_ROOT
111 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
114 DESTDIR=$RPM_BUILD_ROOT
117 install diet-libevent.a $RPM_BUILD_ROOT%{dietlibdir}/libevent.a
118 install diet-libevent_core.a $RPM_BUILD_ROOT%{dietlibdir}/libevent_core.a
119 install diet-libevent_extra.a $RPM_BUILD_ROOT%{dietlibdir}/libevent_extra.a
123 rm -rf $RPM_BUILD_ROOT
125 %post -p /sbin/ldconfig
126 %postun -p /sbin/ldconfig
129 %defattr(644,root,root,755)
130 %attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
131 %attr(755,root,root) %ghost %{_libdir}/libevent-1.4.so.2
132 %attr(755,root,root) %{_libdir}/libevent_core-1.4.so.*.*.*
133 %attr(755,root,root) %ghost %{_libdir}/libevent_core-1.4.so.2
134 %attr(755,root,root) %{_libdir}/libevent_extra-1.4.so.*.*.*
135 %attr(755,root,root) %ghost %{_libdir}/libevent_extra-1.4.so.2
138 %defattr(644,root,root,755)
140 #%attr(755,root,root) %{_bindir}/event_rpcgen.py
141 %attr(755,root,root) %{_libdir}/libevent.so
142 %attr(755,root,root) %{_libdir}/libevent_core.so
143 %attr(755,root,root) %{_libdir}/libevent_extra.so
144 %{_libdir}/libevent.la
145 %{_libdir}/libevent_core.la
146 %{_libdir}/libevent_extra.la
147 %{_includedir}/evdns.h
148 %{_includedir}/event*.h
149 %{_includedir}/evhttp.h
150 %{_includedir}/evrpc.h
151 %{_includedir}/evutil.h
152 %{_mandir}/man3/evdns.3*
153 %{_mandir}/man3/event.3*
155 %if %{with static_libs}
157 %defattr(644,root,root,755)
158 %{_libdir}/libevent.a
159 %{_libdir}/libevent_core.a
160 %{_libdir}/libevent_extra.a
165 %defattr(644,root,root,755)
166 %{dietlibdir}/libevent.a
167 %{dietlibdir}/libevent_core.a
168 %{dietlibdir}/libevent_extra.a