Browse Source

Merge pull request #1978 from philenotfound/master

at: bring back package
Luka Perkov 9 years ago
parent
commit
ec9f76e848

+ 59
- 0
utils/at/Makefile View File

@@ -0,0 +1,59 @@
1
+#
2
+# Copyright (C) 2008-2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=at
11
+PKG_VERSION:=3.1.16
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
15
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
16
+PKG_MD5SUM:=d05da75d9b75d93917ffb16ab48b1e19
17
+
18
+PKG_LICENSE:=GPL-2.0+ GPL-3.0+ ISC
19
+PKG_LICENSE_FILES:=COPYING Copyright
20
+PKG_MAINTAINER:=Phil Eichinger <phil@zankapfel.net>
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+define Package/at
25
+  SECTION:=utils
26
+  CATEGORY:=Utilities
27
+  DEPENDS:=+libelf1
28
+  TITLE:=Delayed job execution and batch processing
29
+  URL:=http://packages.debian.org/stable/at
30
+endef
31
+
32
+define Package/at/description
33
+ At and batch read shell commands from standard input storing them as a job to
34
+ be scheduled for execution in the future.
35
+endef
36
+
37
+export SENDMAIL=/bin/true
38
+EXTRA_CFLAGS:=-DNEED_YYWRAP -I$(PKG_BUILD_DIR) \
39
+	$(TARGET_LDFLAGS)
40
+
41
+CONFIGURE_ARGS+=--prefix=/usr \
42
+		--with-daemon_username=nobody \
43
+		--with-daemon_groupname=nogroup \
44
+		--with-jobdir=/var/spool/cron/atjobs \
45
+		--with-atspool=/var/spool/cron/atspool
46
+
47
+CONFIGURE_VARS += \
48
+	ac_cv_header_security_pam_appl_h=no
49
+
50
+define Package/at/install
51
+	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/etc/init.d/
52
+	$(INSTALL_BIN) ./files/atd.init $(1)/etc/init.d/atd
53
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/at $(1)/usr/bin
54
+	ln -sf at $(1)/usr/bin/atq
55
+	ln -sf at $(1)/usr/bin/atrm
56
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/atd $(1)/usr/sbin
57
+endef
58
+
59
+$(eval $(call BuildPackage,at))

+ 23
- 0
utils/at/files/atd.init View File

@@ -0,0 +1,23 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2011 OpenWrt.org
3
+
4
+START=50
5
+
6
+SERVICE_USE_PID=1
7
+
8
+start() {
9
+	[ -d /var/spool/cron/atjobs ] || {
10
+		mkdir -m 0755 -p /var/spool/cron/atjobs
11
+		touch /var/spool/cron/atjobs/.SEQ
12
+		chown -R nobody:nogroup /var/spool/cron/atjobs
13
+	}
14
+	[ -d /var/spool/cron/atspool ] || {
15
+		mkdir -m 0755 -p /var/spool/cron/atspool
16
+		chown -R nobody:nogroup /var/spool/cron/atspool
17
+	}
18
+	service_start /usr/sbin/atd
19
+}
20
+
21
+stop() {
22
+	service_stop /usr/sbin/atd
23
+}

+ 59
- 0
utils/at/patches/100-remove-glibc-assumption.patch View File

@@ -0,0 +1,59 @@
1
+From 7f811d9c4ebc9444e613e251c31d6bf537a24dc1 Mon Sep 17 00:00:00 2001
2
+From: Khem Raj <raj.khem@gmail.com>
3
+Date: Mon, 13 Apr 2015 16:35:30 -0700
4
+Subject: [PATCH] remove glibc assumption
5
+
6
+glibc time.h header has an undocumented __isleap macro
7
+that we are using anf musl is missing it.
8
+Since it is undocumented & does not appear
9
+on any other libc, stop using it and just define the macro in
10
+locally  instead.
11
+
12
+Upstream-Status: Pending
13
+
14
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
15
+[patch from: http://patchwork.openembedded.org/patch/91893/ ]
16
+Signed-off-by: Phil Eichinger <phil@zankapfel.net>
17
+---
18
+ parsetime.y | 11 +++++++----
19
+ 1 file changed, 7 insertions(+), 4 deletions(-)
20
+
21
+diff --git a/parsetime.y b/parsetime.y
22
+index 7005e88..324e6d3 100644
23
+--- a/parsetime.y
24
++++ b/parsetime.y
25
+@@ -8,6 +8,9 @@
26
+ 
27
+ #define YYDEBUG 1
28
+ 
29
++#define is_leap_year(y) \
30
++    ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
31
++
32
+ struct tm exectm;
33
+ static int isgmt;
34
+ static int yearspec;
35
+@@ -217,8 +220,8 @@ date            : month_name day_number
36
+ 				 mnum == 12) && dnum > 31)
37
+ 			    || ((mnum ==  4 || mnum ==  6 || mnum ==  9 ||
38
+ 			         mnum == 11) && dnum > 30)
39
+-			    || (mnum ==  2 && dnum > 29 &&  __isleap(ynum+1900))
40
+-			    || (mnum ==  2 && dnum > 28 && !__isleap(ynum+1900))
41
++			    || (mnum ==  2 && dnum > 29 &&  is_leap_year(ynum+1900))
42
++			    || (mnum ==  2 && dnum > 28 && !is_leap_year(ynum+1900))
43
+ 			   )
44
+ 			{
45
+ 			    yyerror("Error in day of month");
46
+@@ -261,8 +264,8 @@ date            : month_name day_number
47
+ 				 mnum == 12) && dnum > 31)
48
+ 			    || ((mnum ==  4 || mnum ==  6 || mnum ==  9 ||
49
+ 			         mnum == 11) && dnum > 30)
50
+-			    || (mnum ==  2 && dnum > 29 &&  __isleap(ynum+1900))
51
+-			    || (mnum ==  2 && dnum > 28 && !__isleap(ynum+1900))
52
++			    || (mnum ==  2 && dnum > 29 &&  is_leap_year(ynum+1900))
53
++			    || (mnum ==  2 && dnum > 28 && !is_leap_year(ynum+1900))
54
+ 			   )
55
+ 			{
56
+ 			    yyerror("Error in day of month");
57
+-- 
58
+2.1.4
59
+

+ 14
- 0
utils/at/patches/110-getloadavg.patch View File

@@ -0,0 +1,14 @@
1
+--- a/getloadavg.c
2
++++ b/getloadavg.c
3
+@@ -69,8 +69,9 @@ Boston, MA  02110-1301  USA */
4
+ #include <config.h>
5
+ #endif
6
+ 
7
+-#include "lisp.h"
8
+-#include "sysfile.h" /* for encapsulated open, close, read, write */
9
++#include <sys/types.h>
10
++#include <sys/stat.h>
11
++#include <fcntl.h>
12
+ 
13
+ #ifndef HAVE_GETLOADAVG
14
+