Explorar el Código

Import libdaemon from oldpackages

Ted Hess hace 10 años
padre
commit
80d2e46002
Se han modificado 2 ficheros con 100 adiciones y 0 borrados
  1. 70
    0
      libs/libdaemon/Makefile
  2. 30
    0
      libs/libdaemon/patches/001-daemon_set_verbosity.patch

+ 70
- 0
libs/libdaemon/Makefile Ver fichero

@@ -0,0 +1,70 @@
1
+#
2
+# Copyright (C) 2006-2014 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:=libdaemon
11
+PKG_VERSION:=0.14
12
+PKG_RELEASE:=3
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/
16
+PKG_MD5SUM:=509dc27107c21bcd9fbf2f95f5669563
17
+
18
+PKG_FIXUP:=autoreconf
19
+PKG_INSTALL:=1
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+define Package/libdaemon
24
+  SECTION:=libs
25
+  CATEGORY:=Libraries
26
+  TITLE:=A lightweight C library that eases the writing of UNIX daemons
27
+  URL:=http://0pointer.de/lennart/projects/libdaemon/
28
+endef
29
+
30
+define Package/libdaemon/description
31
+	libdaemon is a lightweight C library that eases the writing of UNIX daemons.
32
+	It consists of the following parts:
33
+	- A wrapper around fork() which does the correct daemonization procedure of a process
34
+	- A wrapper around syslog() for simpler and compatible log output to Syslog or STDERR
35
+	- An API for writing PID files
36
+	- An API for serializing UNIX signals into a pipe for usage with select() or poll()
37
+	- An API for running subprocesses with STDOUT and STDERR redirected to syslog
38
+
39
+	APIs like these are used in most daemon software available. It is not that
40
+	simple to get it done right and code duplication is not a goal.
41
+endef
42
+
43
+define Build/Configure
44
+	$(call Build/Configure/Default, \
45
+		--enable-shared \
46
+		--enable-static \
47
+		--disable-lynx \
48
+		, \
49
+		ac_cv_func_setpgrp_void=yes \
50
+	)
51
+endef
52
+
53
+TARGET_CFLAGS += $(FPIC)
54
+
55
+define Build/InstallDev
56
+	$(INSTALL_DIR) $(1)/usr/include
57
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/libdaemon $(1)/usr/include/
58
+	$(INSTALL_DIR) $(1)/usr/lib
59
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.a $(1)/usr/lib/
60
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so* $(1)/usr/lib/
61
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
62
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdaemon.pc $(1)/usr/lib/pkgconfig/
63
+endef
64
+
65
+define Package/libdaemon/install
66
+	$(INSTALL_DIR) $(1)/usr/lib
67
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so.* $(1)/usr/lib/
68
+endef
69
+
70
+$(eval $(call BuildPackage,libdaemon))

+ 30
- 0
libs/libdaemon/patches/001-daemon_set_verbosity.patch Ver fichero

@@ -0,0 +1,30 @@
1
+From 013963ba35e8fe8897211c0acf5ee98f9a871fc1 Mon Sep 17 00:00:00 2001
2
+From: Michael Heimpold <mhei@heimpold.de>
3
+Date: Fri, 10 Jan 2014 19:38:51 +0100
4
+Subject: [PATCH] daemon_set_verbosity: fix erroneous error message
5
+
6
+When calling this function with a value other than LOG_DEBUG
7
+the error message was triggered erroneously.
8
+
9
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
10
+---
11
+
12
+ libdaemon/dlog.c |    2 +-
13
+ 1 file changed, 1 insertion(+), 1 deletion(-)
14
+
15
+diff --git a/libdaemon/dlog.c b/libdaemon/dlog.c
16
+index 1cc0566..cc2b918 100644
17
+--- a/libdaemon/dlog.c
18
++++ b/libdaemon/dlog.c
19
+@@ -42,7 +42,7 @@ static int daemon_verbosity_level = LOG_INFO;
20
+ void daemon_set_verbosity(int verbosity_prio) {
21
+ 
22
+     /* Allow using negative verbosity levels to hide _all_ messages */
23
+-    if (verbosity_prio > 0 && (verbosity_prio & LOG_PRIMASK) != LOG_PRIMASK)
24
++    if (verbosity_prio > 0 && (verbosity_prio & LOG_PRIMASK) != verbosity_prio)
25
+         daemon_log(LOG_ERR, "The value %d is not a valid priority value", verbosity_prio);
26
+ 
27
+     daemon_verbosity_level = verbosity_prio & LOG_PRIMASK;
28
+-- 
29
+1.7.10.4
30
+