2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/
17 PKG_MD5SUM:=6812a5e4063b5016f25e9a0cebbd3dd9
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23 include $(INCLUDE_DIR)/package.mk
25 define Package/libdaemon
28 TITLE:=A lightweight C library that eases the writing of UNIX daemons
30 libdaemon is a lightweight C library that eases the writing of UNIX daemons.\\\
31 It consists of the following parts:\\\
32 - A wrapper around fork() which does the correct daemonization procedure of a process\\\
33 - A wrapper around syslog() for simpler and compatible log output to Syslog or STDERR\\\
34 - An API for writing PID files\\\
35 - An API for serializing UNIX signals into a pipe for usage with select() or poll()\\\
36 - An API for running subprocesses with STDOUT and STDERR redirected to syslog\\\
38 APIs like these are used in most daemon software available. It is not that \\\
39 simple to get it done right and code duplication is not a goal.
40 URL:=http://0pointer.de/lennart/projects/libdaemon/
43 define Build/Configure
44 $(call Build/Configure/Default, \
52 $(MAKE) -C $(PKG_BUILD_DIR) \
53 DESTDIR="$(PKG_INSTALL_DIR)" \
57 define Build/InstallDev
58 mkdir -p $(STAGING_DIR)/usr/include
59 $(CP) $(PKG_INSTALL_DIR)/usr/include/libdaemon $(STAGING_DIR)/usr/include/
60 mkdir -p $(STAGING_DIR)/usr/lib
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.a $(STAGING_DIR)/usr/lib/
62 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so* $(STAGING_DIR)/usr/lib/
63 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdaemon.pc $(STAGING_DIR)/usr/lib/pkgconfig/
65 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libdaemon.pc
66 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libdaemon.pc
69 define Build/UninstallDev
71 $(STAGING_DIR)/usr/include/libdaemon \
72 $(STAGING_DIR)/usr/lib/libdaemon.a \
73 $(STAGING_DIR)/usr/lib/libdaemon.so* \
74 $(STAGING_DIR)/usr/lib/pkgconfig/libdaemon.pc
77 define Package/libdaemon/install
78 install -d -m0755 $(1)/usr/lib
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so.* $(1)/usr/lib/
82 $(eval $(call BuildPackage,libdaemon))