File fswatch.spec of Package fswatch

#
# spec file for package fswatch
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define libfswatch 11
Name:           fswatch
Version:	1.14.0
Release:	0
License:	GPL-3.0+
Summary:	File change monitor
Url:		https://github.com/emcrisostomo/fswatch
Group:		System/Monitoring
Source:		%name-%version.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	libtool
BuildRequires:	gcc-c++
BuildRequires:  makeinfo
Requires:       libfswatch%{libfswatch} = %{version}-%{release}
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}

%description
Fswatch is a cross-platform file change monitor with multiple
backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos
File Events Notification, Linux inotify, Microsoft Windows and
a stat()-based backend.

%package devel
Summary: 	Development files for %name
Group:		Development/Libraries/C and C++
Requires: 	%name = %version
Requires:	glibc-devel

%description    devel
The %name-devel package contains libraries and header files for
developing applications that use %name.

%package -n libfswatch%{libfswatch}
Summary:        Shared code for the fswatch  program
Group:          System/Libraries

%description	-n libfswatch%{libfswatch}
This subpackage contains libraries that are part of fswatch.
 
%package doc
Summary:	Documentation files for %name
Requires:	%name = %version

%description doc
This package contains the documentation for using %name
%prep
%setup -q

%build
# This fixes the rpmlint error:
# fswatch-devel.x86_64: E: lto-no-text-in-archive
# (Badness: 10000) /usr/lib64/libfswatch.a
%if 0%{?suse_version} > 1500
export CXXFLAGS="%{optflags} -ffat-lto-objects"
%endif

%configure
%__make %{?_smp_mflags}

%check
%__make check

%install
%make_install
%__rm -rf %buildroot%_datadir/doc
%find_lang %name

%post doc
%install_info --info-dir=%_infodir %_infodir/%name.info.gz
%preun doc
%install_info_delete --info-dir=%_infodir %_infodir/%name.info.gz

%post -n libfswatch%{libfswatch} -p /sbin/ldconfig
%postun -n libfswatch%{libfswatch} -p /sbin/ldconfig

%files -f %name.lang
%defattr(-,root,root)
%_bindir/%name

%files devel
%defattr(-,root,root)
%dir %_includedir/libfswatch
%_includedir/libfswatch/*
%_libdir/libfswatch.so
%_libdir/libfswatch.a
%_libdir/libfswatch.la

%files -n libfswatch%{libfswatch} 
%defattr(-,root,root)
%doc AUTHORS.libfswatch NEWS.libfswatch README.libfswatch.md
%_libdir/libfswatch.so.%{libfswatch}*

%files doc
%defattr(-,root,root)
%doc AUTHORS ChangeLog CONTRIBUTING.md COPYING NEWS README.md README.linux
%_mandir/man7/%name.7.gz
%_infodir/%name.info.gz

%changelog
* Tue Dec 24 2019 Simone Sclavi <darkhado@gmail.com>  1.14.0
- Fix Tumbleweed build

* Tue Jun 19 2018 Simone Sclavi <darkhado@gmail.com>  1.14.0
- 1.14.0 release

* Tue Jun 19 2018 Simone Sclavi <darkhado@gmail.com>  1.11.3
- 1.11.3 release

* Tue Jan 09 2018 Simone Sclavi <darkhado@gmail.com>  1.11.2
- 1.11.2 release

* Mon Apr 10 2017 Simone Sclavi <darkhado@gmail.com>  1.9.3
- Initial build
openSUSE Build Service is sponsored by