package/nodejs: bump version to 5.6.0
[buildroot-gz.git] / package / swupdate / swupdate.mk
blobe22bc08b6a3608a21d1d5fb33333a272d3c49269
1 ################################################################################
3 # swupdate
5 ################################################################################
7 SWUPDATE_VERSION = 2015.07
8 SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
9 SWUPDATE_LICENSE = GPLv2+, MIT, Public Domain
10 SWUPDATE_LICENSE_FILES = COPYING
11 SWUPDATE_PATCH = \
12 https://github.com/sbabic/swupdate/commit/5a5ef5909f5da5b2070d58ffaee924bb8e6a51e1.patch \
13 https://github.com/sbabic/swupdate/commit/f26577423eb65728fcd10f78f9978dd07d51dcb9.patch
15 # swupdate bundles its own version of mongoose (version 3.8) and
16 # lsqlite3 (version 0.8)
18 ifeq ($(BR2_PACKAGE_JSON_C),y)
19 SWUPDATE_DEPENDENCIES += json-c
20 SWUPDATE_MAKE_ENV += HAVE_JSON_C=y
21 else
22 SWUPDATE_MAKE_ENV += HAVE_JSON_C=n
23 endif
25 ifeq ($(BR2_PACKAGE_LIBCONFIG),y)
26 SWUPDATE_DEPENDENCIES += libconfig
27 SWUPDATE_MAKE_ENV += HAVE_LIBCONFIG=y
28 else
29 SWUPDATE_MAKE_ENV += HAVE_LIBCONFIG=n
30 endif
32 ifeq ($(BR2_PACKAGE_LIBCURL),y)
33 SWUPDATE_DEPENDENCIES += libcurl
34 SWUPDATE_MAKE_ENV += HAVE_LIBCURL=y
35 else
36 SWUPDATE_MAKE_ENV += HAVE_LIBCURL=n
37 endif
39 ifeq ($(BR2_PACKAGE_LUA_5_2),y)
40 SWUPDATE_DEPENDENCIES += lua
41 SWUPDATE_MAKE_ENV += HAVE_LUA=y
42 else
43 SWUPDATE_MAKE_ENV += HAVE_LUA=n
44 endif
46 ifeq ($(BR2_PACKAGE_MTD),y)
47 SWUPDATE_DEPENDENCIES += mtd
48 SWUPDATE_MAKE_ENV += HAVE_LIBMTD=y
49 SWUPDATE_MAKE_ENV += HAVE_LIBUBI=y
50 else
51 SWUPDATE_MAKE_ENV += HAVE_LIBMTD=n
52 SWUPDATE_MAKE_ENV += HAVE_LIBUBI=n
53 endif
55 ifeq ($(BR2_PACKAGE_OPENSSL),y)
56 SWUPDATE_DEPENDENCIES += openssl
57 SWUPDATE_MAKE_ENV += HAVE_LIBSSL=y
58 SWUPDATE_MAKE_ENV += HAVE_LIBCRYPTO=y
59 else
60 SWUPDATE_MAKE_ENV += HAVE_LIBSSL=n
61 SWUPDATE_MAKE_ENV += HAVE_LIBCRYPTO=n
62 endif
64 ifeq ($(BR2_PACKAGE_ZLIB),y)
65 SWUPDATE_DEPENDENCIES += zlib
66 SWUPDATE_MAKE_ENV += HAVE_ZLIB=y
67 else
68 SWUPDATE_MAKE_ENV += HAVE_ZLIB=n
69 endif
71 SWUPDATE_BUILD_CONFIG = $(@D)/.config
73 SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG))
74 SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
76 ifeq ($(BR2_PREFER_STATIC_LIB),y)
77 define SWUPDATE_PREFER_STATIC
78 $(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(SWUPDATE_BUILD_CONFIG))
79 endef
80 endif
82 define SWUPDATE_SET_BUILD_OPTIONS
83 $(call KCONFIG_SET_OPT,CONFIG_CROSS_COMPILE,"$(TARGET_CROSS)", \
84 $(SWUPDATE_BUILD_CONFIG))
85 $(call KCONFIG_SET_OPT,CONFIG_SYSROOT,"$(STAGING_DIR)", \
86 $(SWUPDATE_BUILD_CONFIG))
87 $(call KCONFIG_SET_OPT,CONFIG_EXTRA_CFLAGS,"$(TARGET_CFLAGS)", \
88 $(SWUPDATE_BUILD_CONFIG))
89 $(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDFLAGS,"$(TARGET_LDFLAGS)", \
90 $(SWUPDATE_BUILD_CONFIG))
91 endef
93 define SWUPDATE_KCONFIG_FIXUP_CMDS
94 $(SWUPDATE_PREFER_STATIC)
95 $(SWUPDATE_SET_BUILD_OPTIONS)
96 endef
98 define SWUPDATE_BUILD_CMDS
99 $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D)
100 endef
102 define SWUPDATE_INSTALL_TARGET_CMDS
103 $(INSTALL) -D -m 0755 $(@D)/swupdate $(TARGET_DIR)/usr/bin/swupdate
104 $(if $(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE), \
105 mkdir -p $(TARGET_DIR)/var/www/swupdate; \
106 cp -dpf $(@D)/www/* $(TARGET_DIR)/var/www/swupdate)
107 endef
109 # Checks to give errors that the user can understand
110 # Must be before we call to kconfig-package
111 ifeq ($(BR2_PACKAGE_SWUPDATE)$(BR_BUILDING),yy)
112 ifeq ($(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG)),)
113 $(error No Swupdate configuration file specified, check your BR2_PACKAGE_SWUPDATE_CONFIG setting)
114 endif
115 endif
117 $(eval $(kconfig-package))