Пакет libevent: Specfile

Name: libevent
Version: 1.3b
Release: alt1.1

Summary: An asynchronous event notification library
Group: System/Libraries
License: BSD-style
Url: http://www.monkey.org/~provos/libevent/
Packager: Dmitry V. Levin <ldv@altlinux.org>

# http://www.monkey.org/~provos/libevent-%version.tar.gz
Source: libevent-%version.tar
Source1: Makefile.sample
Source2: README.libevent
Patch: libevent-%version-%release.patch

%def_disable static

%package devel
Summary: Development libevent library, its header files and documentation
Group: Development/C
Requires: %name = %version-%release

%package devel-static
Summary: Static libevent library
Group: Development/C
Requires: %name-devel = %version-%release

%description
The libevent API provides a mechanism to execute a callback function
when a specific event occurs on a file descriptor or after a timeout
has been reached.

libevent is meant to replace the asynchronous event loop found in
event driven network servers.  Currently, libevent supports kqueue(2),
select(2) and epoll(4).

%description devel
The libevent API provides a mechanism to execute a callback function
when a specific event occurs on a file descriptor or after a timeout
has been reached.

libevent is meant to replace the asynchronous event loop found in
event driven network servers.  Currently, libevent supports kqueue(2),
select(2) and epoll(4).

This package contains the header files, documentation, examples and
development library for use in developing applications that use the
libevent library.

%description devel-static
The libevent API provides a mechanism to execute a callback function
when a specific event occurs on a file descriptor or after a timeout
has been reached.

libevent is meant to replace the asynchronous event loop found in
event driven network servers.  Currently, libevent supports kqueue(2),
select(2) and epoll(4).

This package contains the static libevent library necessary to build
statically-linkeed libevent-based applications.

%prep
%setup -q
%patch -p1
sed -ne 's/^[^(),#[:space:]][^(),#]\+[[:space:]]\+\**\([[:alnum:]]\+_[[:alnum:]_]\+\)[[:space:]]*(.*/\1/p' *.h |
	awk '
BEGIN{print "{\n  global:"}{print "    " $0 ";"}
END{print "    decode_int;\n  local: *;\n};"}
	' >libevent.map

%build
autoreconf -fisv
# force epoll and /dev/epoll support
export haveepoll=yes
%configure %{subst_enable static}
%make_build
make verify

%install
%makeinstall

# Relocate shared libraries from %_libdir/ to /%_lib/.
mkdir -p %buildroot/%_lib
for f in %buildroot%_libdir/*.so; do
	t=`objdump -p "$f" |awk '/SONAME/ {print $2}'`
	[ -n "$t" ]
	ln -snf ../../%_lib/"$t" "$f"
done
mv %buildroot%_libdir/*.so.* %buildroot/%_lib/

%define docdir %_docdir/%name-%version
install -pD -m644 %_sourcedir/Makefile.sample \
	%buildroot%docdir/examples/Makefile
install -p -m644 sample/*.c %buildroot%docdir/examples/
install -pm644 %_sourcedir/README.libevent \
	%buildroot%docdir/README

%post -p %post_ldconfig
%postun -p %postun_ldconfig

%files
/%_lib/*.so.*
%dir %docdir
%docdir/README

%files devel
%_bindir/event_rpcgen.py
%_libdir/*.so
%_includedir/*
%_man3dir/*
%dir %docdir
%docdir/examples

%if_enabled static
%files devel-static
%_libdir/*.a
%endif

%changelog
* Mon Feb 11 2008 Grigory Batalov <bga@altlinux.ru> 1.3b-alt1.1
- Rebuilt with python-2.5.

* Fri Apr 13 2007 Dmitry V. Levin <ldv@altlinux.org> 1.3b-alt1
- Updated to 1.3b.

* Fri Apr 13 2007 Dmitry V. Levin <ldv@altlinux.org> 1.1b-alt1
- Updated to 1.1b.

* Fri Apr 13 2007 Dmitry V. Levin <ldv@altlinux.org> 1.1a-alt2
- Made libevent.map autogenerated based on installed header files.

* Sun Mar 25 2007 Fr. Br. George <george@altlinux.ru> 1.1a-alt1.1
- NMU: automatic map generation

* Sun Oct 30 2005 LAKostis <lakostis at altlinux.ru> 1.1a-alt1
- Updated to 1.1a.
- Updated patches.
- Force epoll and /dev/epoll support.
- Update description.

* Mon Aug 15 2005 Dmitry V. Levin <ldv@altlinux.org> 1.0c-alt2
- Restricted list of global symbols exported by the library.
- Fixed typos in manual page.

* Mon Apr 04 2005 Dmitry V. Levin <ldv@altlinux.org> 1.0c-alt1
- Updated to 1.0c.
- Updated patches.

* Tue Mar 01 2005 Dmitry V. Levin <ldv@altlinux.org> 1.0b-alt2
- Relocated shared library from %_libdir to /%_lib (fixes #6156).

* Sun Feb 13 2005 Dmitry V. Levin <ldv@altlinux.org> 1.0b-alt1
- Initial revision.