]> git.pld-linux.org Git - packages/incron.git/blob - incron.spec
- note about systemd pid notice
[packages/incron.git] / incron.spec
1 # TODO:
2 # - processing files from system dir has little side effect:
3 #   if file specified in system (or any) table has inexistent paths, incrond
4 #   will report on the whole table an error without much detail which entry was it:
5 #   haarber incrond[4025]: cannot create watch for system table ble: (2) No such file or directory
6 # - systemd service spits some pid notice on startup, but service startups itself fine:
7 #   Oct 21 21:36:48 haarber incrond[4670]: starting service (version 0.5.10, built on Oct 21 2012 19:20:10)
8 #   Oct 21 21:36:48 haarber systemd[1]: PID file /var/run/incrond.pid not readable (yet?) after start.
9 #   Oct 21 21:36:48 haarber incrond[4671]: loading system tables
10 Summary:        incron :: inotify cron system
11 Name:           incron
12 Version:        0.5.10
13 Release:        5
14 License:        GPL v2
15 Group:          Daemons
16 Source0:        http://inotify.aiken.cz/download/incron/%{name}-%{version}.tar.bz2
17 # Source0-md5:  038190dc64568883a206f3d58269b850
18 Source1:        %{name}.init
19 Source2:        %{name}.service
20 Source3:        %{name}.allow
21 Source4:        %{name}.deny
22 Patch0:         %{name}-DESTDIR.patch
23 Patch1:         %{name}-gcc47.patch
24 Patch2:         %{name}-man_bugs.patch
25 Patch3:         configdir.patch
26 Patch4:         excludefiles.patch
27 URL:            http://incron.aiken.cz/
28 BuildRequires:  rpmbuild(macros) >= 1.644
29 Requires:       systemd-units >= 38
30 Requires(post): fileutils
31 Requires(post,preun,postun):    systemd-units >= 38
32 Requires(post,preun):   /sbin/chkconfig
33 Requires(postun):       /usr/sbin/groupdel
34 Requires(pre):  /bin/id
35 Requires(pre):  /usr/bin/getgid
36 Requires(pre):  /usr/sbin/groupadd
37 Requires(pre):  /usr/sbin/useradd
38 Requires:       rc-scripts
39 Requires:       uname(release) >= 2.6.13
40 Provides:       group(crontab)
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 This program is an "inotify cron" system. It consists of a daemon and
45 a table manipulator. You can use it a similar way as the regular cron.
46 The difference is that the inotify cron handles filesystem events
47 rather than time periods.
48
49 %prep
50 %setup -q
51 %patch0 -p1
52 %patch1 -p1
53 %patch2 -p1
54 %patch3 -p1
55 %patch4 -p1
56
57 %build
58 %{__make} \
59         LDFLAGS="%{rpmldflags} -Wall" \
60         CXX="%{__cxx}" \
61         OPTIMIZE="%{rpmcxxflags}" \
62         DEBUG=""
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{%{name},%{name}.d}} \
67         $RPM_BUILD_ROOT{/var/spool/%{name},%{systemdunitdir}}
68
69 %{__make} install \
70         DESTDIR=$RPM_BUILD_ROOT \
71         PREFIX=%{_prefix}
72
73 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
74 cp -p incron.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
75 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}
76 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
77 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
78
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82 %pre
83 %groupadd -g 117 -r -f crontab
84 %useradd -u 134 -r -d /var/spool/%{name} -s /bin/false -c "crontab User" -g crontab crontab
85
86 %post
87 /sbin/chkconfig --add %{name}
88 %service %{name} restart "incron Daemon"
89 %systemd_post %{name}.service
90
91 %preun
92 if [ "$1" = "0" ]; then
93         %service %{name} stop
94         /sbin/chkconfig --del %{name}
95 fi
96 %systemd_preun %{name}.service
97
98 %postun
99 if [ "$1" = "0" ]; then
100         %userremove crontab
101         %groupremove crontab
102 fi
103 %systemd_reload
104
105 %files
106 %defattr(644,root,root,755)
107 %doc CHANGELOG COPYING README TODO
108 %attr(750,root,crontab) %dir %{_sysconfdir}/%{name}
109 %attr(640,root,crontab) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
110 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.allow
111 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.deny
112 %attr(754,root,root) /etc/rc.d/init.d/%{name}
113 %{systemdunitdir}/%{name}.service
114 %attr(755,root,root) %{_sbindir}/incrond
115 %attr(4755,root,crontab) %{_bindir}/incrontab
116 %dir %attr(751,root,crontab) %{_sysconfdir}/%{name}.d
117 %{_mandir}/man1/incrontab.1*
118 %{_mandir}/man5/incron.conf.5*
119 %{_mandir}/man5/incrontab.5*
120 %{_mandir}/man8/incrond.8*
121 %attr(1730,root,crontab) /var/spool/%{name}
This page took 0.105465 seconds and 3 git commands to generate.