| 1 |
|
| 2 |
> |
| 3 |
> |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
ifndef _cdbs_rules_buildvars |
| 20 |
_cdbs_rules_buildvars = 1 |
| 21 |
|
| 22 |
include /usr/share/dpkg/pkg-info.mk |
| 23 |
include /usr/share/dpkg/architecture.mk |
| 24 |
|
| 25 |
CDBS_VERSION = 0.4.182 |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
DEB_SOURCE_PACKAGE = $(DEB_SOURCE) |
| 52 |
DEB_SUITE ?= $(DEB_DISTRIBUTION) |
| 53 |
|
| 54 |
DEB_NOEPOCH_VERSION = $(lastword \ |
| 55 |
$(subst :,$(space),\ |
| 56 |
$(DEB_VERSION))) |
| 57 |
DEB_UPSTREAM_VERSION = $(DEB_VERSION_UPSTREAM) |
| 58 |
DEB_ISNATIVE = $(strip $(if $(findstring -,$(DEB_VERSION))\ |
| 59 |
,\ |
| 60 |
,native)) |
| 61 |
|
| 62 |
|
| 63 |
ifneq ($(DEB_INDEP_PACKAGES),cdbs) |
| 64 |
ifdef _cdbs_rules_debhelper |
| 65 |
DEB_INDEP_PACKAGES := $(strip $(shell \ |
| 66 |
dh_listpackages -i)) |
| 67 |
DEB_ARCH_PACKAGES := $(filter-out $(DEB_INDEP_PACKAGES),\ |
| 68 |
$(strip $(shell \ |
| 69 |
dh_listpackages -a))) |
| 70 |
else |
| 71 |
DEB_INDEP_PACKAGES := $(strip $(shell \ |
| 72 |
debian/list-packages indep)) |
| 73 |
DEB_ARCH_PACKAGES := $(filter-out $(DEB_INDEP_PACKAGES),\ |
| 74 |
$(strip $(shell \ |
| 75 |
debian/list-packages same))) |
| 76 |
endif |
| 77 |
endif |
| 78 |
|
| 79 |
|
| 80 |
DEB_PACKAGES ?= $(DEB_ARCH_PACKAGES) $(DEB_INDEP_PACKAGES) |
| 81 |
DEB_ALL_PACKAGES ?= $(DEB_PACKAGES) |
| 82 |
DEB_INDEP_REGULAR_PACKAGES ?= $(DEB_INDEP_PACKAGES) |
| 83 |
DEB_ARCH_REGULAR_PACKAGES ?= $(DEB_ARCH_PACKAGES) |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
DEB_SRCDIR ?= . |
| 88 |
DEB_BUILDDIR ?= $(strip $(DEB_SRCDIR)) |
| 89 |
|
| 90 |
|
| 91 |
DEB_ARCH = $(DEB_HOST_ARCH) |
| 92 |
|
| 93 |
ifeq ($(words $(DEB_ALL_PACKAGES)),1) |
| 94 |
DEB_DESTDIR ?= $(CURDIR)/debian/$(strip $(DEB_ALL_PACKAGES))/ |
| 95 |
else |
| 96 |
DEB_DESTDIR ?= $(CURDIR)/debian/tmp/ |
| 97 |
endif |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
cdbs_info = $(info CDBS: $1) |
| 102 |
cdbs_warn = $(info CDBS WARNING: $1) |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
cdbs_warn_deprecated = $(call cdbs_warn,\ |
| 109 |
$1 is deprecated$(if $2, since $2)$(if $3, - please use $3 instead)) |
| 110 |
|
| 111 |
cdbs_curpkg = $(notdir $@) |
| 112 |
|
| 113 |
cdbs_cursrcdir = $(or $(DEB_PKGSRCDIR_$(cdbs_curpkg)),$(DEB_SRCDIR)) |
| 114 |
cdbs_curbuilddir = $(or $(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR)) |
| 115 |
cdbs_curdestdir = $(or $(DEB_DESTDIR_$(cdbs_curpkg)),$(DEB_DESTDIR)) |
| 116 |
|
| 117 |
cdbs_streq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),,yes) |
| 118 |
|
| 119 |
nullstring = |
| 120 |
space = $(nullstring) # <- notice the trailing space (only leading is stripped) |
| 121 |
define newline = |
| 122 |
$(nullstring) |
| 123 |
$(nullstring) |
| 124 |
endef |
| 125 |
comma = , |
| 126 |
open_parenthesis = ( |
| 127 |
close_parenthesis = ) |
| 128 |
cdbs_delimit = $(subst $(space),$2,$(strip $1)) |
| 129 |
|
| 130 |
|
| 131 |
cdbs_uc = $(shell echo '$1' | tr '[:lower:]' '[:upper:]') |
| 132 |
cdbs_lc = $(shell echo '$1' | tr '[:upper:]' '[:lower:]') |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
cdbs_expand_curvar = $(strip \ |
| 139 |
$($(1)_ALL)$(if $($(1)_ALL),$(or $2,$(space)))$(strip \ |
| 140 |
$(if $(filter-out $(origin $(1)_$(cdbs_curpkg)),undefined),$(strip \ |
| 141 |
$($(1)_$(cdbs_curpkg))),$(strip \ |
| 142 |
$($(1)_DEFAULT))))) |
| 143 |
cdbs_expand_allvars = $(strip \ |
| 144 |
$(foreach stem,$(1),$(strip \ |
| 145 |
$($(stem)_ALL))$(strip \ |
| 146 |
$($(stem)))$(strip \ |
| 147 |
$(foreach pkg,$(DEB_ALL_PACKAGES),$(strip \ |
| 148 |
$($(stem)_$(pkg))))))) |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
cdbs_expand_branches = $(strip $(subst WORDDELIMITER,$3,\ |
| 153 |
$(subst BRANCHDELIMITER,$4,\ |
| 154 |
$(call cdbs_delimit,\ |
| 155 |
$(if $2,\ |
| 156 |
$(foreach pkg,$1,\ |
| 157 |
$(call cdbs_delimit,$(foreach branch,$2,\ |
| 158 |
$(pkg)$(branch:%=-%)),$(strip \ |
| 159 |
BRANCHDELIMITER))),\ |
| 160 |
$(if $5,\ |
| 161 |
$(foreach pkg,$1,\ |
| 162 |
$(pkg)-$(5)BRANCHDELIMITER$(pkg)),\ |
| 163 |
$1)),$(strip \ |
| 164 |
WORDDELIMITER))))) |
| 165 |
|
| 166 |
cdbs_findargs-path-or-name = $(strip \ |
| 167 |
$(if $(findstring /,$(firstword $(1))),\ |
| 168 |
-path './$(patsubst ./%,%,$(firstword $(1)))',\ |
| 169 |
-name '$(firstword $(1))') \ |
| 170 |
$(foreach obj,$(wordlist 2,$(words $(1)),$(1)),\ |
| 171 |
-or \ |
| 172 |
$(if $(findstring /,$(obj)),\ |
| 173 |
-path './$(obj:./%=%)',\ |
| 174 |
-name '$(obj)'))) |
| 175 |
|
| 176 |
|
| 177 |
cdbs_expand_nondefaultvar = $(strip $(if $(filter-out undefined default,\ |
| 178 |
$(origin $1)),\ |
| 179 |
$2)) |
| 180 |
|
| 181 |
|
| 182 |
cdbs_set_nondefaultvars = $(strip $(foreach v,$1,\ |
| 183 |
$(call cdbs_expand_nondefaultvar,$v,$v="$($v)"))) |
| 184 |
|
| 185 |
|
| 186 |
cdbs_crossbuild = $(if $(call cdbs_streq,$(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)),,yes) |
| 187 |
|
| 188 |
endif |