python-werkzeug: bump to version 0.11.15
[buildroot-gz.git] / package / swupdate / swupdate.mk
blob688f4eef86c86afcc4d4cd67ee1321c362abfcda
1 ################################################################################
3 # swupdate
5 ################################################################################
7 SWUPDATE_VERSION = 2016.10
8 SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
9 SWUPDATE_LICENSE = GPLv2+, MIT, Public Domain
10 SWUPDATE_LICENSE_FILES = COPYING
12 # swupdate bundles its own version of mongoose (version 3.8)
14 ifeq ($(BR2_PACKAGE_JSON_C),y)
15 SWUPDATE_DEPENDENCIES += json-c
16 SWUPDATE_MAKE_ENV += HAVE_JSON_C=y
17 else
18 SWUPDATE_MAKE_ENV += HAVE_JSON_C=n
19 endif
21 ifeq ($(BR2_PACKAGE_LIBARCHIVE),y)
22 SWUPDATE_DEPENDENCIES += libarchive
23 SWUPDATE_MAKE_ENV += HAVE_LIBARCHIVE=y
24 else
25 SWUPDATE_MAKE_ENV += HAVE_LIBARCHIVE=n
26 endif
28 ifeq ($(BR2_PACKAGE_LIBCONFIG),y)
29 SWUPDATE_DEPENDENCIES += libconfig
30 SWUPDATE_MAKE_ENV += HAVE_LIBCONFIG=y
31 else
32 SWUPDATE_MAKE_ENV += HAVE_LIBCONFIG=n
33 endif
35 ifeq ($(BR2_PACKAGE_LIBCURL),y)
36 SWUPDATE_DEPENDENCIES += libcurl
37 SWUPDATE_MAKE_ENV += HAVE_LIBCURL=y
38 else
39 SWUPDATE_MAKE_ENV += HAVE_LIBCURL=n
40 endif
42 ifeq ($(BR2_PACKAGE_HAS_LUAINTERPRETER),y)
43 SWUPDATE_DEPENDENCIES += luainterpreter host-pkgconf
44 SWUPDATE_MAKE_ENV += HAVE_LUA=y
45 else
46 SWUPDATE_MAKE_ENV += HAVE_LUA=n
47 endif
49 ifeq ($(BR2_PACKAGE_MTD),y)
50 SWUPDATE_DEPENDENCIES += mtd
51 SWUPDATE_MAKE_ENV += HAVE_LIBMTD=y
52 SWUPDATE_MAKE_ENV += HAVE_LIBUBI=y
53 else
54 SWUPDATE_MAKE_ENV += HAVE_LIBMTD=n
55 SWUPDATE_MAKE_ENV += HAVE_LIBUBI=n
56 endif
58 ifeq ($(BR2_PACKAGE_OPENSSL),y)
59 SWUPDATE_DEPENDENCIES += openssl
60 SWUPDATE_MAKE_ENV += HAVE_LIBSSL=y
61 SWUPDATE_MAKE_ENV += HAVE_LIBCRYPTO=y
62 else
63 SWUPDATE_MAKE_ENV += HAVE_LIBSSL=n
64 SWUPDATE_MAKE_ENV += HAVE_LIBCRYPTO=n
65 endif
67 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS),y)
68 SWUPDATE_DEPENDENCIES += uboot-tools
69 SWUPDATE_MAKE_ENV += HAVE_LIBUBOOTENV=y
70 else
71 SWUPDATE_MAKE_ENV += HAVE_LIBUBOOTENV=n
72 endif
74 ifeq ($(BR2_PACKAGE_ZLIB),y)
75 SWUPDATE_DEPENDENCIES += zlib
76 SWUPDATE_MAKE_ENV += HAVE_ZLIB=y
77 else
78 SWUPDATE_MAKE_ENV += HAVE_ZLIB=n
79 endif
81 SWUPDATE_BUILD_CONFIG = $(@D)/.config
83 SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG))
84 SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
86 ifeq ($(BR2_STATIC_LIBS),y)
87 define SWUPDATE_PREFER_STATIC
88 $(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(SWUPDATE_BUILD_CONFIG))
89 endef
90 endif
92 define SWUPDATE_SET_BUILD_OPTIONS
93 $(call KCONFIG_SET_OPT,CONFIG_CROSS_COMPILE,"$(TARGET_CROSS)", \
94 $(SWUPDATE_BUILD_CONFIG))
95 $(call KCONFIG_SET_OPT,CONFIG_SYSROOT,"$(STAGING_DIR)", \
96 $(SWUPDATE_BUILD_CONFIG))
97 $(call KCONFIG_SET_OPT,CONFIG_EXTRA_CFLAGS,"$(TARGET_CFLAGS)", \
98 $(SWUPDATE_BUILD_CONFIG))
99 $(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDFLAGS,"$(TARGET_LDFLAGS)", \
100 $(SWUPDATE_BUILD_CONFIG))
101 endef
103 define SWUPDATE_KCONFIG_FIXUP_CMDS
104 $(SWUPDATE_PREFER_STATIC)
105 $(SWUPDATE_SET_BUILD_OPTIONS)
106 endef
108 define SWUPDATE_BUILD_CMDS
109 $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D)
110 endef
112 define SWUPDATE_INSTALL_TARGET_CMDS
113 $(INSTALL) -D -m 0755 $(@D)/swupdate $(TARGET_DIR)/usr/bin/swupdate
114 $(if $(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE), \
115 mkdir -p $(TARGET_DIR)/var/www/swupdate; \
116 cp -dpf $(@D)/www/* $(TARGET_DIR)/var/www/swupdate)
117 endef
119 # Checks to give errors that the user can understand
120 # Must be before we call to kconfig-package
121 ifeq ($(BR2_PACKAGE_SWUPDATE)$(BR_BUILDING),yy)
122 ifeq ($(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG)),)
123 $(error No Swupdate configuration file specified, check your BR2_PACKAGE_SWUPDATE_CONFIG setting)
124 endif
125 endif
127 $(eval $(kconfig-package))