File libev.spec of Package libev
%define realname libev
%define realver 4.33
%define srcext tar.gz
%define so_ver 4
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}%{?so_ver}
Version: %{realver}
Release: %{?extraver:0.}1%{?dist}
License: BSD-2-clause or GPL-2+
Group: System/Libraries
URL: http://software.schmorp.de/pkg/libev.html
Summary: high performance full-featured event loop written in C
# Install-time parameters
Provides: %{realname} = %{version}-%{release}
# Build-time parameters
Source: http://dist.schmorp.de/libev/%{realname}-%{version}%{?extraver}.%{srcext}
%description
Libev is an event loop: you register interest in certain events (such as a file
descriptor being readable or a timeout occurring), and it will manage these
event sources and provide your program with events.
To do this, it must take more or less complete control over your process (or
thread) by executing the event loop handler, and will then communicate events
via a callback mechanism.
You register interest in certain events by registering so-called event watchers,
which are relatively small C structures you initialise with the details of the
event, and then hand it over to libev by starting the watcher.
%package -n %{realname}-devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}
%description -n %{realname}-devel
Development files for %{name}
Libev is an event loop: you register interest in certain events (such as a file
descriptor being readable or a timeout occurring), and it will manage these
event sources and provide your program with events.
To do this, it must take more or less complete control over your process (or
thread) by executing the event loop handler, and will then communicate events
via a callback mechanism.
You register interest in certain events by registering so-called event watchers,
which are relatively small C structures you initialise with the details of the
event, and then hand it over to libev by starting the watcher.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%configure \
--disable-static \
CFLAGS="$_CFLAGS" \
LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%license LICENSE
%doc Changes README
%{_libdir}/%{realname}.so.%{?so_ver}*
# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%license LICENSE
%doc Changes README
%{_libdir}/%{realname}.so
%{_includedir}/ev*.h
%doc %{_mandir}/man3/ev.3*
%exclude %{_libdir}/%{realname}.la
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog