# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
+# Don't include transform-files.mk in your rules files directly;
+# instead use config-package.mk.
+
ifndef _cdbs_rules_transform_files
_cdbs_rules_transform_files = 1
DEB_TRANSFORM_FILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEB_TRANSFORM_FILES_$(package)))
-DEB_TRANSFORM_FILES_DIR=debian/transform_file_copies
+DEB_TRANSFORM_FILES_TMPDIR=debian/transform_file_copies
-debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_DIR)%,$(1))
-undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_DIR)%,%,$(1))
+debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_TMPDIR)%,$(1))
+undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_TMPDIR)%,%,$(1))
common-build-arch common-build-indep:: $(foreach file,$(DEB_TRANSFORM_FILES),$(call debian_transform_files,$(file)))
debian/transform_$(notdir $(call undebian_transform_files,$@))) < $< > $@
$(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%:
+ set -e; \
$(foreach file,$(DEB_TRANSFORM_FILES_$(cdbs_curpkg)), \
- install -d $(DEB_DESTDIR)/$(dir $(file)); \
- cp -a $(DEB_TRANSFORM_FILES_DIR)$(file) \
- $(DEB_DESTDIR)/$(dir $(file));)
+ install -d debian/$(cdbs_curpkg)/$(dir $(file)); \
+ cp -a $(call debian_transform_files,$(file)) \
+ debian/$(cdbs_curpkg)/$(dir $(file));)
clean::
- rm -rf $(DEB_TRANSFORM_FILES_DIR)
+ rm -rf $(DEB_TRANSFORM_FILES_TMPDIR)
endif