package/utils/e2fsprogs: Update to 1.43.3
[openwrt/openwrt.git] / include / version.mk
1 #
2 # Copyright (C) 2012-2015 OpenWrt.org
3 # Copyright (C) 2016 LEDE Project
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 # Substituted by SDK, do not remove
10 # REVISION:=x
11
12 RELEASE:=Reboot
13
14 PKG_CONFIG_DEPENDS += \
15 CONFIG_VERSION_BUG_URL \
16 CONFIG_VERSION_NUMBER \
17 CONFIG_VERSION_NICK \
18 CONFIG_VERSION_REPO \
19 CONFIG_VERSION_DIST \
20 CONFIG_VERSION_MANUFACTURER \
21 CONFIG_VERSION_MANUFACTURER_URL \
22 CONFIG_VERSION_PRODUCT \
23 CONFIG_VERSION_SUPPORT_URL \
24 CONFIG_VERSION_HWREV \
25
26 qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
27 #'
28
29 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
30
31 VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
32 VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),$(REVISION))
33
34 VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
35 VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),HEAD)
36
37 VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
38 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
39
40 VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
41 VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/snapshots)
42
43 VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
44 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
45 VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
46
47 VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
48 VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),LEDE)
49
50 VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL))
51 VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://www.lede-project.org/)
52
53 VERSION_BUG_URL:=$(call qstrip_escape,$(CONFIG_VERSION_BUG_URL))
54 VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://www.lede-project.org/development.html)
55
56 VERSION_SUPPORT_URL:=$(call qstrip_escape,$(CONFIG_VERSION_SUPPORT_URL))
57 VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://lists.infradead.org/mailman/listinfo/lede-dev)
58
59 VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
60 VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
61
62 VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
63 VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
64
65 define taint2sym
66 $(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1))))))
67 endef
68
69 define taint2name
70 $(lastword $(subst :, ,$(1)))
71 endef
72
73 VERSION_TAINT_SPECS := \
74 -ALL_KMODS:no-all \
75 -IPV6:no-ipv6 \
76 +USE_GLIBC:glibc \
77 +USE_MKLIBS:mklibs \
78 +BUSYBOX_CUSTOM:busybox \
79 +OVERRIDE_PKGS:override \
80
81 VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
82 $(if $(findstring +,$(taint)), \
83 $(if $(call taint2sym,$(taint)),$(call taint2name,$(taint))), \
84 $(if $(call taint2sym,$(taint)),,$(call taint2name,$(taint))) \
85 )))
86
87 PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
88
89 VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
90 -e 's,%V,$(VERSION_NUMBER),g' \
91 -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
92 -e 's,%C,$(VERSION_CODE),g' \
93 -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
94 -e 's,%N,$(VERSION_NICK),g' \
95 -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
96 -e 's,%D,$(VERSION_DIST),g' \
97 -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
98 -e 's,%R,$(REVISION),g' \
99 -e 's,%T,$(BOARD),g' \
100 -e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
101 -e 's,%A,$(ARCH_PACKAGES),g' \
102 -e 's,%t,$(VERSION_TAINTS),g' \
103 -e 's,%M,$(VERSION_MANUFACTURER),g' \
104 -e 's,%m,$(VERSION_MANUFACTURER_URL),g' \
105 -e 's,%b,$(VERSION_BUG_URL),g' \
106 -e 's,%s,$(VERSION_SUPPORT_URL),g' \
107 -e 's,%P,$(VERSION_PRODUCT),g' \
108 -e 's,%h,$(VERSION_HWREV),g'
109
110 VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))