1 | # -*- mode: makefile; coding: utf-8 -*- |
---|
2 | |
---|
3 | ifndef _cdbs_rules_debathena_replace_conffiles |
---|
4 | _cdbs_rules_debathena_replace_conffiles = 1 |
---|
5 | |
---|
6 | include /usr/share/cdbs/1/rules/debathena-check-conffiles.mk |
---|
7 | |
---|
8 | DEBATHENA_REPLACE_CONFFILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEBATHENA_REPLACE_CONFFILES_$(package))) |
---|
9 | |
---|
10 | DEBATHENA_REPLACE_CONFFILES_DIR = debian/replace_file_copies |
---|
11 | |
---|
12 | debathena_replace_conffiles = $(patsubst %,$(DEBATHENA_REPLACE_CONFFILES_DIR)%,$(1)) |
---|
13 | undebathena_replace_conffiles = $(patsubst $(DEBATHENA_REPLACE_CONFFILES_DIR)%,%,$(1)) |
---|
14 | |
---|
15 | common-build-indep:: $(foreach file,$(DEBATHENA_REPLACE_CONFFILES),$(call debathena_replace_conffiles,$(file))) |
---|
16 | |
---|
17 | $(call debathena_replace_conffiles,%): $(call debathena_check_conffiles,%) |
---|
18 | mkdir -p $(@D) |
---|
19 | $(if $(DEBATHENA_TRANSFORM_SCRIPT_$(call undebathena_replace_conffiles,$@)), \ |
---|
20 | $(DEBATHENA_TRANSFORM_SCRIPT_$(call undebathena_replace_conffiles,$@)), \ |
---|
21 | debian/transform_$(notdir $(call undebathena_replace_conffiles,$@))) < $< > $@ |
---|
22 | |
---|
23 | $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%: |
---|
24 | $(foreach file,$(DEBATHENA_REPLACE_CONFFILES_$(cdbs_curpkg)), \ |
---|
25 | install -d $(DEB_DESTDIR)/$(dir $(file)); \ |
---|
26 | cp -a $(DEBATHENA_REPLACE_CONFFILES_DIR)$(file) \ |
---|
27 | $(DEB_DESTDIR)/$(dir $(file));) |
---|
28 | |
---|
29 | clean:: |
---|
30 | $(foreach file,$(DEBATHENA_REPLACE_CONFFILES),rm -f debian/$(notdir $(file))) |
---|
31 | rm -rf $(DEBATHENA_REPLACE_CONFFILES_DIR) |
---|
32 | |
---|
33 | endif |
---|