4fa591f6e6dc4239bbb528df57a119aa342ea3b9
[openwrt/svn-archive/archive.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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libdaemon
11 PKG_VERSION:=0.14
12 PKG_RELEASE:=1
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_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/libdaemon
23 SECTION:=libs
24 CATEGORY:=Libraries
25 TITLE:=A lightweight C library that eases the writing of UNIX daemons
26 URL:=http://0pointer.de/lennart/projects/libdaemon/
27 endef
28
29 define Package/libdaemon/description
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
37
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 endef
41
42 define Build/Configure
43 $(call Build/Configure/Default, \
44 --enable-shared \
45 --enable-static \
46 --disable-lynx \
47 )
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51
52 define Build/InstallDev
53 $(INSTALL_DIR) $(1)/usr/include
54 $(CP) $(PKG_INSTALL_DIR)/usr/include/libdaemon $(1)/usr/include/
55 $(INSTALL_DIR) $(1)/usr/lib
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.a $(1)/usr/lib/
57 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so* $(1)/usr/lib/
58 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdaemon.pc $(1)/usr/lib/pkgconfig/
60 endef
61
62 define Package/libdaemon/install
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so.* $(1)/usr/lib/
65 endef
66
67 $(eval $(call BuildPackage,libdaemon))