procd: fix PKG_CONFIG_DEPENDS
[openwrt.git] / package / system / procd / Makefile
1 #
2 # Copyright (C) 2014-2015 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:=2015-02-15
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:=7676df3226da5391c2dfda2ed29a40500e04e15b
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-nand-firstboot
47   SECTION:=utils
48   CATEGORY:=Utilities
49   DEPENDS:=procd-nand
50   TITLE:=OpenWrt firstboot nand helper
51 endef
52
53 define Package/procd/config
54 menu "Configuration"
55         depends on PACKAGE_procd
56
57 config PROCD_SHOW_BOOT
58         bool
59         default n
60         prompt "Print the shutdown to the console as well as logging it to syslog"
61
62 config PROCD_ZRAM_TMPFS
63         bool
64         default n
65         prompt "Mount /tmp using zram."
66 endmenu
67 endef
68
69 PKG_CONFIG_DEPENDS:= CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS
70
71 ifeq ($(CONFIG_NAND_SUPPORT),y)
72   CMAKE_OPTIONS += -DBUILD_UPGRADED=1
73 endif
74
75 ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
76   CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
77 endif
78
79 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
80   CMAKE_OPTIONS += -DZRAM_TMPFS=1
81 endif
82
83 define Package/procd/install
84         $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
85
86         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/
87         $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
88         $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
89         $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
90 endef
91
92 define Package/procd-nand/install
93         $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
94
95         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
96         $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
97 endef
98
99 define Package/procd-nand-firstboot/install
100         $(INSTALL_DIR) $(1)/lib/preinit
101
102         $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh
103 endef
104
105 $(eval $(call BuildPackage,procd))
106 $(eval $(call BuildPackage,procd-nand))
107 $(eval $(call BuildPackage,procd-nand-firstboot))