File inotify-tools.spec of Package inotify-tools

# norootforbuild

%define soname		0

Name:           inotify-tools
Version:        3.13
Release:        3
Summary:        Command Line Utilities for inotify
Url:            http://inotify-tools.sourceforge.net/
Group:          System/Filesystems
License:        GNU General Public License (GPL)
Vendor:         openSUSE-Education
BuildRequires:  gcc glibc-devel make gettext gettext-devel intltool
BuildRequires:  doxygen
BuildRequires:  autoconf automake libtool
Requires:       libinotifytools%{soname} = %{version}
Source:         %{name}-%{version}.tar.bz2
Patch1:         inotify-tools-old-doxygen.patch
Patch2:         inotify-tools-3.13-no-return-in-nonvoid-function.patch
BuildRoot:      %{_tmppath}/build-%{name}-%{version}

%description
inotify-tools is a set of command line utilities for the Linux inotify
filesystem change notification system. It currently consists of only one
utility, "inotifywait", which is used to wait for changes to a file from
a shell script.


%package -n libinotifytools%{soname}
Summary:                Library for inotify
Group:			Development/Libraries/C and C++

%description -n libinotifytools%{soname}
Library needed by inotify.


%package -n libinotifytools-devel
Summary:		Development files for inotify
Group:			Development/Libraries/C and C++
Requires:		libinotifytools%{soname} = %{version}

%description -n libinotifytools-devel
Files needed to develop applications based on libinotify.


%prep
%setup -q -n "inotify-tools-%{version}"
%if 0%{?suse_version} < 1020
%patch1 -p0
%endif
%patch2 -p1

%build
%configure --enable-doxygen --disable-static
%__make %{?jobs:-j%{jobs}}

%check
%__make check

%install
%makeinstall
echo -n libinotifytools.files
for f in AUTHORS ChangeLog COPYING NEWS README; do
	%__install -D -m 0644 "$f" "%{buildroot}%{_docdir}/libinotifytools/$f"
	echo '%doc %{_docdir}/libinotifytools/'"$f" >> libinotifytools.files
done

%__install -d "%{buildroot}%{_docdir}/libinotifytools"
%__mv "%{buildroot}%{_datadir}/doc/inotify-tools" \
	"%{buildroot}%{_docdir}/libinotifytools/html"
find "%{buildroot}%{_libdir}" -name "*.la" -exec rm {} \;

%clean
%__rm -rf "%{buildroot}"

%post -n libinotifytools%{soname} -p /sbin/ldconfig
%postun -n libinotifytools%{soname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/inotifywait
%{_bindir}/inotifywatch
%doc %{_mandir}/man1/inotifywait.1*
%doc %{_mandir}/man1/inotifywatch.1*

%files -n libinotifytools%{soname} -f libinotifytools.files
%defattr(-,root,root)
%{_libdir}/libinotifytools.so.%{soname}
%{_libdir}/libinotifytools.so.%{soname}.*

%files -n libinotifytools-devel
%defattr(-,root,root)
%dir %{_docdir}/libinotifytools
%doc %{_docdir}/libinotifytools/html
%{_includedir}/inotifytools
%{_libdir}/libinotifytools.so

%changelog