]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
cronie: Update to 1.4.9.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2013 11:30:08 +0000 (13:30 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2013 11:30:08 +0000 (13:30 +0200)
Add anacron.

cronie/cronie.nm
cronie/patches/cronie-1.4.10-use-setenv.patch [new file with mode: 0644]

index 0ad2b6ebb8cf28c14fb81027c80f32f2ae15840d..c541043238187e276f5f371a9e56f9be42b54385 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = cronie
-version    = 1.4.8
+version    = 1.4.9
 release    = 1
 
 groups     = System/Environment/Base
@@ -30,21 +30,44 @@ build
                libselinux-devel
                pam-devel
                readline-devel
+               systemd-units
                texinfo
        end
 
        configure_options += \
                --with-pam \
                --with-audit \
-               --with-selinux
+               --with-selinux \
+               --with-inotify \
+               --enable-anacron \
+               --enable-pie \
+               --enable-relro
 
        install_cmds
-               mkdir -pv %{BUILDROOT}%{localstatedir}/spool/cron
+               mkdir -pv %{BUILDROOT}%{localstatedir}/spool/{ana,}cron
+
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/cron.d
+               touch %{BUILDROOT}%{sysconfdir}/cron.deny
+
+               # Install anacron
+               install -m 644 contrib/anacrontab %{BUILDROOT}%{sysconfdir}/anacrontab
+
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/cron.hourly
+               install -c -m 755 contrib/0anacron %{BUILDROOT}%{sysconfdir}/cron.hourly/0anacron
+               for i in daily weekly monthly; do
+                       touch %{BUILDROOT}%{localstatedir}/spool/anacron/cron.${i}
+               done
+
+               install -c -m 755 contrib/0hourly %{BUILDROOT}%{sysconfdir}/cron.d/0hourly
        end
 end
 
 packages
        package %{name}
+               requires
+                       dailyjobs
+               end
+
                # Just search for new unit files that were just installed.
                script postin
                        systemctl daemon-reload >/dev/null 2>&1 || :
@@ -71,6 +94,47 @@ packages
                end
        end
 
+       package anacron
+               summary = Utility for running regular jobs.
+               description
+                       Anacron is part of cronie that is used for running jobs with regular
+                       periodicity which do not have exact time of day of execution.
+
+                       The default settings of anacron execute the daily, weekly, and monthly
+                       jobs, but anacron allows setting arbitrary periodicity of jobs.
+
+                       Using anacron allows running the periodic jobs even if the system is often
+                       powered off and it also allows randomizing the time of the job execution
+                       for better utilization of resources shared among multiple systems.
+               end
+               groups = System/Base Base
+
+               provides
+                       dailyjobs
+               end
+
+               requires
+                       cronie = %{thisver}
+                       crontabs
+               end
+
+               files
+                       %{sbindir}/anacron
+                       %{sysconfdir}/cron.hourly/0anacron
+                       %{sysconfdir}/anacrontab
+                       %{localstatedir}/spool/anacron
+                       %{mandir}/man*/anacron*
+               end
+
+               configfiles
+                       %{sysconfdir}/anacrontab
+               end
+
+               datafiles
+                       %{localstatedir}/spool/anacron/*
+               end
+       end
+
        package %{name}-debuginfo
                template DEBUGINFO
        end
diff --git a/cronie/patches/cronie-1.4.10-use-setenv.patch b/cronie/patches/cronie-1.4.10-use-setenv.patch
new file mode 100644 (file)
index 0000000..ddbfbbb
--- /dev/null
@@ -0,0 +1,27 @@
+From 5ac31751adfa31c5e5e316afc2f800037bd1cdca Mon Sep 17 00:00:00 2001
+From: Tomas Mraz <tmraz@fedoraproject.org>
+Date: Thu, 6 Jun 2013 20:13:26 +0200
+Subject: [PATCH] Do not use putenv with string literal.
+
+---
+ src/cron.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cron.c b/src/cron.c
+index 9974887..08d0812 100644
+--- a/src/cron.c
++++ b/src/cron.c
+@@ -244,8 +244,8 @@ int main(int argc, char *argv[]) {
+       check_spool_dir();
+       if (ChangePath) {
+-              if (putenv("PATH=" _PATH_DEFPATH) < 0) {
+-                      log_it("CRON", pid, "DEATH", "can't putenv PATH",
++              if (setenv("PATH", _PATH_DEFPATH, 1) < 0) {
++                      log_it("CRON", pid, "DEATH", "can't setenv PATH",
+                               errno);
+                       exit(1);
+               }
+-- 
+1.7.7.6
+