incron-vl.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. %bcond_with systemd
  2. Summary: Inotify cron system
  3. Name: incron
  4. Version: 0.5.12
  5. Release: 5%{?_dist_release}%{?with_systemd:.systemd}
  6. Group: System Environment/Base
  7. Vendor: Project Vine
  8. Distribution: Vine Linux
  9. Packager: tomop
  10. License: GPLv2
  11. URL: https://github.com/ar-/incron
  12. Source0: https://github.com/ar-/incron/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
  13. Source1: incrond.init
  14. Source2: incrond.service
  15. Patch0: incron-0.5.10-gcc.patch
  16. Patch1: incron-0.5.12-prevent-zombies.patch
  17. # https://github.com/ar-/incron/pull/45/commits/134900ea1dd19834ba6e6c7e7e07611a0e0d78a0
  18. Patch2: incron-fix-segv-on-mkdir.patch
  19. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  20. %if %{with systemd}
  21. %{?systemd_requires}
  22. %else
  23. Requires(post): /sbin/chkconfig
  24. Requires(preun): /sbin/chkconfig, /sbin/service
  25. Requires(postun): /sbin/service
  26. %endif
  27. %description
  28. This program is an "inotify cron" system.
  29. It consists of a daemon and a table manipulator.
  30. You can use it a similar way as the regular cron.
  31. The difference is that the inotify cron handles
  32. filesystem events rather than time periods.
  33. %prep
  34. %setup -q
  35. %patch0 -p1 -b .gcc
  36. %patch1 -p1 -b .zombie
  37. %patch2 -p1 -b .mkdir
  38. %if %{with systemd}
  39. sed -i -e 's|/var/run|/run|' \
  40. appinst.h \
  41. incron.conf.5 \
  42. incron.conf.example \
  43. incroncfg.cpp
  44. %endif
  45. %build
  46. make %{?_smp_mflags} CXXFLAGS="%{optflags}"
  47. %install
  48. rm -rf %{buildroot}
  49. #install files manually since source Makefile tries to do it as root
  50. install -D -p incrond %{buildroot}%{_sbindir}/incrond
  51. install -D -p -m 4755 incrontab %{buildroot}%{_bindir}/incrontab
  52. install -d %{buildroot}%{_localstatedir}/spool/%{name}
  53. install -d %{buildroot}%{_sysconfdir}/%{name}.d
  54. install -D -p -m 0644 incron.conf.example %{buildroot}%{_sysconfdir}/%{name}.conf
  55. %if %{with systemd}
  56. install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/incrond.service
  57. %else
  58. install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_initdir}/incrond
  59. %endif
  60. # install manpages
  61. make install-man MANPATH="%{buildroot}%{_mandir}" INSTALL="install -D -p"
  62. %post
  63. %if %{with systemd}
  64. %systemd_post incrond.service
  65. %else
  66. if [ $1 -eq 1 ]; then
  67. /sbin/chkconfig --add incrond
  68. fi
  69. %endif
  70. %preun
  71. %if %{with systemd}
  72. %systemd_preun incrond.service
  73. %else
  74. if [ $1 -eq 0 ]; then
  75. /sbin/service %{name} stop >/dev/null 2>&1 || :
  76. /sbin/chkconfig --del incrond
  77. fi
  78. %endif
  79. %postun
  80. %if %{with systemd}
  81. %systemd_postun_with_restart incrond.service
  82. %else
  83. if [ $1 -ge 1 ]; then
  84. /sbin/service incrond condrestart >/dev/null 2>&1 || :
  85. fi
  86. %endif
  87. %clean
  88. rm -rf %{buildroot}
  89. %files
  90. %defattr(-,root,root,-)
  91. %license COPYING LICENSE*
  92. %doc CHANGELOG README TODO
  93. %attr(4755,root,root) %{_bindir}/incrontab
  94. %{_sbindir}/incrond
  95. %if %{with systemd}
  96. %{_unitdir}/incrond.service
  97. %else
  98. %{_initdir}/incrond
  99. %endif
  100. %config(noreplace) %{_sysconfdir}/%{name}.conf
  101. %{_mandir}/man1/incrontab.1.gz
  102. %{_mandir}/man5/incrontab.5.gz
  103. %{_mandir}/man5/incron.conf.5.gz
  104. %{_mandir}/man8/incrond.8.gz
  105. %dir %{_localstatedir}/spool/%{name}
  106. %dir %{_sysconfdir}/%{name}.d
  107. %changelog
  108. * Sun Apr 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.12-5
  109. - added R(postun):.
  110. - added systemd stuff (disabled as default).
  111. * Mon Dec 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.12-4
  112. - imported Patch2.
  113. * Mon Nov 04 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.12-3
  114. - replaced Patch1.
  115. * Sat Jul 9 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.12-2
  116. - added Patch1.
  117. * Thu Jul 7 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.12-1
  118. - new upstream release.
  119. * Sun Jan 12 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.10-2
  120. - rebuilt with current environment.
  121. * Fri May 04 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5.10-1
  122. - new upstream release.
  123. - built for Vine Linux.
  124. * Thu Feb 16 2012 Jon Ciesla <limburgher@gmail.com> - 0.5.9-4
  125. - Migrate to systemd, BZ 789688.
  126. - gcc47 patch.
  127. * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.9-3
  128. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  129. * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.9-2
  130. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  131. * Mon Dec 21 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> 0.5.9-1
  132. - Upstream released new version
  133. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.8-2
  134. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  135. * Wed Feb 25 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> 0.5.8-1
  136. - Upstream released new version
  137. - GCC 4.4 fixes
  138. - Drop GCC 4.3 patch, fixed upstream
  139. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.7-2
  140. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  141. * Sat Feb 09 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 0.5.7-1
  142. - Sync with upstream
  143. * Tue Mar 13 2007 <ruben@rubenkerkhof.com> 0.5.5-1
  144. - Sync with upstream
  145. * Mon Feb 12 2007 <ruben@rubenkerkhof.com> 0.5.4-1
  146. - Update to new upstream version
  147. - Upstream fixed permissions on pidfile
  148. - New manpage for incron.conf
  149. - Upstream fixed example conf file
  150. * Sun Feb 04 2007 <ruben@rubenkerkhof.com> 0.5.1-1
  151. - Updated to new upstream version
  152. - Upstream fixed the incorrect encoding of the LICENSE-GPL file
  153. * Sat Jan 27 2007 <ruben@rubenkerkhof.com> 0.5.0-1
  154. - Updated to new upstream version
  155. - Changed the service name in the scriptlets
  156. - Added a configuration file
  157. - Included GPL License
  158. * Sat Jan 27 2007 <ruben@rubenkerkhof.com> 0.4.0-1
  159. - First try at packaging it up