File incron.spec of Package incron

# vim: set ts=4 sw=4 et:

# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/


Name:           incron
Version:        0.5.10
Release:        0
Summary:        Inotify Cron System
License:        GPL-2.0+
Group:          Productivity/Networking/Other
Url:            http://inotify.aiken.cz/?section=incron&page=about
Source:         http://inotify.aiken.cz/download/incron/incron-%{version}.tar.bz2
Source1:        incron.init
Source2:        %{name}-rpmlintrc
Patch1:         incron-makefile.patch
Patch2:         incron-remove_build_timestamp.patch
Patch3:         incron-fix_ftbfs_gcc47.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++
PreReq:         permissions

%description
This program is an "inotify cron" system. It consists of a daemon and a table
manipulator. You can use it a similar way as the regular cron. The difference
is that the inotify cron handles filesystem events rather than time periods.

%prep
%setup -q
%patch1
%patch2
%patch3 -p1

%build
export CXXFLAGS="%{optflags} -fPIE -fpie"
export LDFLAGS="%{optflags} -pie"
%__make %{?_smp_mflags} \
    PREFIX="%{_prefix}"

%install
%__make install \
    DESTDIR="%{buildroot}" \
    PREFIX="%{_prefix}"

%__install -D -m0755 "%{SOURCE1}" "%{buildroot}%{_initrddir}/incron"
%__install -d "%{buildroot}%{_sbindir}"
%__ln_s "%{_initrddir}/incron" "%{buildroot}%{_sbindir}/rcincron"

%__rm -rf "%{buildroot}%{_datadir}/doc"

%__install -D -m0600 incron.conf.example "%{buildroot}%{_sysconfdir}/incron.conf"

%if %suse_version >= 1140
%post
%set_permissions %{_bindir}/incrontab
%fillup_and_insserv -f incron

%preun
%stop_on_removal incron

%postun
%restart_on_update incron
%insserv_cleanup

%verifyscript
%verify_permissions -e %{_bindir}/incrontab
%endif

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

%files
%defattr(-,root,root)
%doc CHANGELOG COPYING LICENSE* README TODO incron.conf.example
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/incron.conf
%dir %attr(0700,root,root) %{_sysconfdir}/incron.d
%{_initrddir}/incron
%{_bindir}/incrontab
%{_sbindir}/incrond
%{_sbindir}/rcincron
%doc %{_mandir}/man1/incrontab.1*
%doc %{_mandir}/man5/incron.conf.5*
%doc %{_mandir}/man5/incrontab.5*
%doc %{_mandir}/man8/incrond.8*
%dir %attr(0700,root,root) %{_localstatedir}/spool/incron

%changelog
openSUSE Build Service is sponsored by