source: trunk/debathena/config/config-build-common/debathena-replace-conffiles.mk @ 22760

Revision 22760, 1.4 KB checked in by andersk, 17 years ago (diff)
Guard against multiple inclusions.
Line 
1# -*- mode: makefile; coding: utf-8 -*-
2
3ifndef _cdbs_rules_debathena_replace_conffiles
4_cdbs_rules_debathena_replace_conffiles = 1
5
6include /usr/share/cdbs/1/rules/debathena-check-conffiles.mk
7
8DEBATHENA_REPLACE_CONFFILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEBATHENA_REPLACE_CONFFILES_$(package)))
9
10DEBATHENA_REPLACE_CONFFILES_DIR = debian/replace_file_copies
11
12debathena_replace_conffiles = $(patsubst %,$(DEBATHENA_REPLACE_CONFFILES_DIR)%,$(1))
13undebathena_replace_conffiles = $(patsubst $(DEBATHENA_REPLACE_CONFFILES_DIR)%,%,$(1))
14
15common-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
29clean::
30        $(foreach file,$(DEBATHENA_REPLACE_CONFFILES),rm -f debian/$(notdir $(file)))
31        rm -rf $(DEBATHENA_REPLACE_CONFFILES_DIR)
32
33endif
Note: See TracBrowser for help on using the repository browser.