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