f60a6cf
%global _hardened_build 1
f60a6cf
f60a6cf
Name:           fido
e7c96ec
Version:        1.1.2
e7c96ec
Release:        1%{?dist}
f60a6cf
Summary:        Multi-threaded file watch utility
f60a6cf
Group:          System Environment/Daemons
f60a6cf
f60a6cf
License:        GPLv2+ and LGPLv2+
f60a6cf
URL:            http://www.joedog.org/%{name}-home/
e7c96ec
Source0:        http://download.joedog.org/%{name}/%{name}-%{version}.tar.gz
f60a6cf
f60a6cf
#Upstream whants to keep the static library
f60a6cf
Patch6:         %{name}-shared-library.patch
f60a6cf
f60a6cf
%{?el5:BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)}
f60a6cf
f60a6cf
%if 0%{?fedora} || 0%{?rhel} >= 7
f60a6cf
BuildRequires:    systemd
28e126c
%{?systemd_requires}
f60a6cf
%else
f60a6cf
Requires(post):  /sbin/chkconfig
f60a6cf
Requires(preun): /sbin/chkconfig
f60a6cf
Requires(preun): initscripts
f60a6cf
%endif
f60a6cf
BuildRequires:   libtool, libjoedog-devel
f60a6cf
f60a6cf
f60a6cf
%description
f60a6cf
A multi-threaded file watch utility. It can monitor files for changes in
f60a6cf
content or modification times. If it notices a change, it will kick off a
f60a6cf
user-defined script.
f60a6cf
f60a6cf
f60a6cf
%prep
f60a6cf
%setup -q
f60a6cf
f60a6cf
%patch6
f60a6cf
f60a6cf
rm -f *.m4
f60a6cf
rm -rf include/joedog/*.h
f60a6cf
sed -i -e 's/AC_PROG_SHELL//' configure.in
f60a6cf
autoreconf --install --force
f60a6cf
f60a6cf
f60a6cf
%build
f60a6cf
%configure
f60a6cf
make %{?_smp_mflags}
f60a6cf
f60a6cf
f60a6cf
%install
f60a6cf
%if 0%{?el5}
f60a6cf
rm -rf %{buildroot}
f60a6cf
make install DESTDIR=%{buildroot}
f60a6cf
%else
f60a6cf
%make_install
f60a6cf
%endif
f60a6cf
f60a6cf
%if 0%{?fedora} || 0%{?rhel} >= 7
f60a6cf
#systemd
1ab8687
install -D -p -m 0644 utils/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
f60a6cf
%else
f60a6cf
#SysVinit
f60a6cf
install -D -p -m 0644 utils/%{name}-redhat-config %{buildroot}%{_sysconfdir}/sysconfig/%{name}
d8c448c
%{?el6:install -D -p -m 0755 utils/%{name}-redhat-start %{buildroot}%{_initddir}/%{name}}
d8c448c
%{?el5:install -D -p -m 0755 utils/%{name}-redhat-start %{buildroot}%{_initrddir}/%{name}}
f60a6cf
%endif
f60a6cf
f60a6cf
#prepare sample configs for doc
f60a6cf
for _file in doc/*.conf
f60a6cf
do
f60a6cf
    ln -f "${_file}" "${_file}.sample"
f60a6cf
done
f60a6cf
f60a6cf
#provide a reasonable minimal config as starting point
f60a6cf
sed -e 's/^verbose  = true/verbose = false/' \
f60a6cf
  %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf.sample \
f60a6cf
  > %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
f60a6cf
rm -f %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf.sample
f60a6cf
f60a6cf
f60a6cf
%clean
f60a6cf
%{?el5:rm -rf %{buildroot}}
f60a6cf
f60a6cf
f60a6cf
%files
f60a6cf
%doc ChangeLog README COPYING
f60a6cf
%doc doc/*.sample
f60a6cf
%{_sbindir}/%{name}
f60a6cf
%{_mandir}/man*/*
f60a6cf
%{_sysconfdir}/%{name}/rules
f60a6cf
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
f60a6cf
f60a6cf
%if 0%{?fedora} || 0%{?rhel} >= 7
f60a6cf
#systemd
f60a6cf
%{_unitdir}/%{name}.service
f60a6cf
f60a6cf
f60a6cf
%post
f60a6cf
%systemd_post %{name}.service
f60a6cf
f60a6cf
%preun
f60a6cf
%systemd_preun %{name}.service
f60a6cf
f60a6cf
%postun
f60a6cf
%systemd_postun_with_restart %{name}.service
f60a6cf
%else
f60a6cf
#SysVinit
f60a6cf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
f60a6cf
d8c448c
%{?el6:%{_initddir}/%{name}}
d8c448c
%{?el5:%{_initrddir}/%{name}}
f60a6cf
f60a6cf
%post
f60a6cf
/sbin/chkconfig --add %{name}
f60a6cf
f60a6cf
%preun
f60a6cf
if [ $1 -eq 0 ] ; then
f60a6cf
    /sbin/service %{name} stop >/dev/null 2>&1
f60a6cf
    /sbin/chkconfig --del %{name}
f60a6cf
fi
f60a6cf
f60a6cf
%postun
f60a6cf
if [ "$1" -ge "1" ] ; then
f60a6cf
    /sbin/service %{name} condrestart >/dev/null 2>&1 || :
f60a6cf
fi
f60a6cf
%endif
f60a6cf
f60a6cf
f60a6cf
%changelog
e7c96ec
* Tue Sep 23 2014 Roman Mohr <roman@fenkhuber.at> - 1.1.2-1
e7c96ec
- fix the possibility that fido misses some age tests and fails to fire an alert
e7c96ec
af0ae34
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-3
af0ae34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
af0ae34
3d1496f
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-2
3d1496f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
3d1496f
9c58c5e
* Fri May 23 2014 Roman Mohr <roman@fenkhuber.at> - 1.1.1-1
9c58c5e
- degraded from alarm to a log entry if monitored files are only sometimes
9c58c5e
  locked by another process.
9c58c5e
1ab8687
* Tue Nov 19 2013 Roman Mohr <roman@fenkhuber.at> - 1.1.0-1
1ab8687
- upstream 1.1.0
1ab8687
- removing patches 0 to 5, as upstream now includes them
1ab8687
- removing unneeded direct dependency to libjoedog
1ab8687
52a5208
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-7
52a5208
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
52a5208
d8c448c
* Wed Jun 26 2013 Roman Mohr <roman@fenkhuber.at> - 1.0.7-6
d8c448c
- Use %%{_initrddir} instead of %%{_initddir} for el5
d8c448c
f60a6cf
* Mon Jun 24 2013 Roman Mohr <roman@fenkhuber.at> - 1.0.7-5
f60a6cf
- trimmed/rearranged BuildRequires
f60a6cf
- nuked explicit Requires: libjoedog
f60a6cf
- removed article from Summary
f60a6cf
f60a6cf
* Mon Jun 24 2013 Roman Mohr <roman@fenkhuber.at> - 1.0.7-4
f60a6cf
- Use libjoedog instead of the bundled satic library
f60a6cf
- Fixed hardening build
f60a6cf
- Added missing Group for EPEL5
f60a6cf
f60a6cf
* Tue Jun 11 2013 Roman Mohr <roman@fenkhuber.at> - 1.0.7-3
f60a6cf
- Refactoring spec to support EPEL builds
f60a6cf
- Hunting down some more memory leaks
f60a6cf
f60a6cf
* Sun Jun 09 2013 Roman Mohr <roman@fenkhuber.at> - 1.0.7-2
f60a6cf
- Added systemd unit file
f60a6cf
- Fixed some memory leaks
f60a6cf
- Fixed a security issue when switching to a non-privileged user
f60a6cf
f60a6cf
* Mon May 20 2013 Roman Mohr <roman@fenkhuber.at> - 1.0.7-1
f60a6cf
- Fixed custom rules in Makefile.in to support DESTDIR
f60a6cf
- Fixed incorrect-fsf-address errors