packaged the atd daemon
authorMatteo Croce <rootkit85@yahoo.it>
Mon, 21 Apr 2008 20:46:26 +0000 (20:46 +0000)
committerMatteo Croce <rootkit85@yahoo.it>
Mon, 21 Apr 2008 20:46:26 +0000 (20:46 +0000)
SVN-Revision: 10904

utils/at/Makefile [new file with mode: 0644]
utils/at/files/atd.init [new file with mode: 0755]
utils/at/patches/100-cross-compile.patch [new file with mode: 0644]
utils/at/patches/110_getloadavg.patch [new file with mode: 0644]

diff --git a/utils/at/Makefile b/utils/at/Makefile
new file mode 100644 (file)
index 0000000..37cc19d
--- /dev/null
@@ -0,0 +1,45 @@
+# 
+# Copyright (C) 2008 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=at
+PKG_VERSION:=3.1.10ubuntu4
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://archive.ubuntu.com/ubuntu/pool/main/a/at
+PKG_MD5SUM:=64eec8c9e5a6e16e775ee9efe31b8508
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/at
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Delayed job execution and batch processing
+endef
+
+define Package/at/description
+ At and batch read shell commands from standard input
+ storing them as a job to be scheduled for execution in the
+ future.
+endef
+
+export SENDMAIL=/bin/true
+EXTRA_CFLAGS:=-DNEED_YYWRAP -I$(PKG_BUILD_DIR)
+CONFIGURE_ARGS+=--with-daemon_username=nobody --with-daemon_groupname=nogroup
+
+define Package/at/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/atd.init $(1)/etc/init.d/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/at $(1)/usr/bin
+       ln -sf at $(1)/usr/bin/atq
+       ln -sf at $(1)/usr/bin/atrm
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/atd $(1)/usr/sbin
+endef
+
+$(eval $(call BuildPackage,at))
diff --git a/utils/at/files/atd.init b/utils/at/files/atd.init
new file mode 100755 (executable)
index 0000000..cdfc146
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org
+START=50
+
+start() {
+       [ -d /var/spool/cron/atjobs ] || mkdir -p /var/spool/cron/atjobs
+       [ -d /var/spool/cron/atspool ] || mkdir -p /var/spool/cron/atspool
+       [ -f /var/spool/cron/atspool ] || > /var/spool/cron/atjobs/.SEQ
+       chown -R nobody:nogroup /var/spool/cron/atjobs /var/spool/cron/atspool
+       atd
+}
+
+stop() {
+       killall atd
+}
diff --git a/utils/at/patches/100-cross-compile.patch b/utils/at/patches/100-cross-compile.patch
new file mode 100644 (file)
index 0000000..55dd2ca
--- /dev/null
@@ -0,0 +1,11 @@
+--- at-3.1.10ubuntu4/configure 2008-04-21 21:14:40.000000000 +0200
++++ at-3.1.10ubuntu4/configure 2008-04-21 21:18:09.000000000 +0200
+@@ -1037,7 +1037,7 @@
+ echo $ac_n "checking Trying to compile a trivial ANSI C program""... $ac_c" 1>&6
+ echo "configure:1039: checking Trying to compile a trivial ANSI C program" >&5
+ if test "$cross_compiling" = yes; then
+-  { echo "configure: error: Could not compile and run even a trivial ANSI C program - check CC." 1>&2; exit 1; }
++  { echo "configure: error: Could not compile and run even a trivial ANSI C program, ignoring as we're cross compiling." 1>&2 ; }
+ else
+   cat > conftest.$ac_ext <<EOF
+ #line 1044 "configure"
diff --git a/utils/at/patches/110_getloadavg.patch b/utils/at/patches/110_getloadavg.patch
new file mode 100644 (file)
index 0000000..998ddd7
--- /dev/null
@@ -0,0 +1,14 @@
+--- at-3.1.10ubuntu4/getloadavg.c      2008-04-21 21:54:03.000000000 +0200
++++ at-3.1.10ubuntu4/getloadavg.c      2008-04-21 21:54:21.000000000 +0200
+@@ -69,8 +69,9 @@
+ #include <config.h>
+ #endif
+-#include "lisp.h"
+-#include "sysfile.h" /* for encapsulated open, close, read, write */
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
+ #ifndef HAVE_GETLOADAVG