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