694827ac15c065236daa08b9830b7d21f1112692
[packages.git] / libs / libdaemon / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libdaemon
12 PKG_VERSION:=0.12
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/
17 PKG_MD5SUM:=76596823cc1a6d1cdf7779b782ff0ee6
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libdaemon
22   SECTION:=libs
23   CATEGORY:=Libraries
24   TITLE:=A lightweight C library that eases the writing of UNIX daemons
25   URL:=http://0pointer.de/lennart/projects/libdaemon/
26 endef
27
28 define Package/libdaemon/description
29         libdaemon is a lightweight C library that eases the writing of UNIX daemons.
30         It consists of the following parts:
31         - A wrapper around fork() which does the correct daemonization procedure of a process
32         - A wrapper around syslog() for simpler and compatible log output to Syslog or STDERR
33         - An API for writing PID files
34         - An API for serializing UNIX signals into a pipe for usage with select() or poll()
35         - An API for running subprocesses with STDOUT and STDERR redirected to syslog
36
37         APIs like these are used in most daemon software available. It is not that
38         simple to get it done right and code duplication is not a goal.
39 endef
40
41 define Build/Configure
42         $(call Build/Configure/Default, \
43                 --enable-shared \
44                 --enable-static \
45                 --disable-lynx \
46         )
47 endef
48
49 define Build/Compile
50         $(MAKE) -C $(PKG_BUILD_DIR) \
51                 DESTDIR="$(PKG_INSTALL_DIR)" \
52                 all install
53 endef
54
55 define Build/InstallDev
56         mkdir -p $(1)/usr/include
57         $(CP) $(PKG_INSTALL_DIR)/usr/include/libdaemon $(1)/usr/include/
58         mkdir -p $(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         mkdir -p $(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))