Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=procd
  9. PKG_VERSION:=2015-02-15
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=git://nbd.name/luci2/procd.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=7676df3226da5391c2dfda2ed29a40500e04e15b
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. CMAKE_INSTALL:=1
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=
  19. PKG_MAINTAINER:=John Crispin <[email protected]>
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
  23. define Package/procd
  24. SECTION:=base
  25. CATEGORY:=Base system
  26. DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_EGLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand
  27. TITLE:=OpenWrt system process manager
  28. endef
  29. define Package/procd-nand
  30. SECTION:=utils
  31. CATEGORY:=Utilities
  32. DEPENDS:=@NAND_SUPPORT +ubi-utils
  33. TITLE:=OpenWrt sysupgrade nand helper
  34. endef
  35. define Package/procd-nand-firstboot
  36. SECTION:=utils
  37. CATEGORY:=Utilities
  38. DEPENDS:=procd-nand
  39. TITLE:=OpenWrt firstboot nand helper
  40. endef
  41. define Package/procd/config
  42. menu "Configuration"
  43. depends on PACKAGE_procd
  44. config PROCD_SHOW_BOOT
  45. bool
  46. default n
  47. prompt "Print the shutdown to the console as well as logging it to syslog"
  48. config PROCD_ZRAM_TMPFS
  49. bool
  50. default n
  51. prompt "Mount /tmp using zram."
  52. endmenu
  53. endef
  54. PKG_CONFIG_DEPENDS:= CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS
  55. ifeq ($(CONFIG_NAND_SUPPORT),y)
  56. CMAKE_OPTIONS += -DBUILD_UPGRADED=1
  57. endif
  58. ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
  59. CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
  60. endif
  61. ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
  62. CMAKE_OPTIONS += -DZRAM_TMPFS=1
  63. endif
  64. define Package/procd/install
  65. $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
  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. define Package/procd-nand/install
  72. $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
  73. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
  74. $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
  75. endef
  76. define Package/procd-nand-firstboot/install
  77. $(INSTALL_DIR) $(1)/lib/preinit
  78. $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh
  79. endef
  80. $(eval $(call BuildPackage,procd))
  81. $(eval $(call BuildPackage,procd-nand))
  82. $(eval $(call BuildPackage,procd-nand-firstboot))