16ca1acdb386f945968689a8594b75e3e10680b4
[openwrt/staging/chunkeey.git] / package / system / procd / Makefile
1 #
2 # Copyright (C) 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:=procd
11 PKG_VERSION:=2014-11-04.1
12
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=git://nbd.name/luci2/procd.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=dc3ea949544090f91a24b05c5fde0bd9ab87f2ce
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 CMAKE_INSTALL:=1
21
22 PKG_LICENSE:=GPL-2.0
23 PKG_LICENSE_FILES:=
24
25 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
29
30 TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
31
32 define Package/procd
33 SECTION:=base
34 CATEGORY:=Base system
35 DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_EGLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand
36 TITLE:=OpenWrt system process manager
37 endef
38
39 define Package/procd-nand
40 SECTION:=utils
41 CATEGORY:=Utilities
42 DEPENDS:=@NAND_SUPPORT +ubi-utils
43 TITLE:=OpenWrt sysupgrade nand helper
44 endef
45
46 define Package/procd/config
47 menu "Configuration"
48 depends on PACKAGE_procd
49
50 config PROCD_SHOW_BOOT
51 bool
52 default n
53 prompt "Print the shutdown to the console as well as logging it to syslog"
54 endmenu
55 endef
56
57 PKG_CONFIG_DEPENDS:= PROCD_SHOW_BOOT
58
59 ifeq ($(CONFIG_PACKAGE_PROCD_SHOW_BOOT),y)
60 CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE
61 endif
62
63 define Package/procd/install
64 $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
65
66 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/
67 $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
68 $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
69 $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
70 endef
71
72 define Package/procd-nand/install
73 $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
74
75 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
76 $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
77 endef
78
79 $(eval $(call BuildPackage,procd))
80 $(eval $(call BuildPackage,procd-nand))