]>
Commit | Line | Data |
---|---|---|
ab8e2a67 TA |
1 | # -*- mode: makefile; coding: utf-8 -*- |
2 | # Copyright © 2008 Tim Abbott <tabbott@mit.edu> and | |
3 | # Anders Kaseorg <andersk@mit.edu> | |
4 | # | |
5 | # This program is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU General Public License as | |
7 | # published by the Free Software Foundation; either version 2, or (at | |
8 | # your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
18 | # 02111-1307 USA. | |
19 | ||
56709134 TA |
20 | # Don't include transform-files.mk in your rules files directly; |
21 | # instead use config-package.mk. | |
22 | ||
02bde96f TA |
23 | ifndef _cdbs_rules_transform_files |
24 | _cdbs_rules_transform_files = 1 | |
ab8e2a67 TA |
25 | |
26 | include /usr/share/cdbs/1/rules/check-files.mk | |
27 | ||
02bde96f | 28 | DEB_TRANSFORM_FILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEB_TRANSFORM_FILES_$(package))) |
ab8e2a67 | 29 | |
56709134 | 30 | DEB_TRANSFORM_FILES_TMPDIR=debian/transform_file_copies |
ab8e2a67 | 31 | |
56709134 TA |
32 | debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_TMPDIR)%,$(1)) |
33 | undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_TMPDIR)%,%,$(1)) | |
20802782 TA |
34 | debian_transform_script = $(if $(DEB_TRANSFORM_SCRIPT_$(cdbs_curpkg)_$(call undebian_transform_files,$(1))), \ |
35 | $(DEB_TRANSFORM_SCRIPT_$(cdbs_curpkg)_$(call undebian_transform_files,$(1))), \ | |
36 | $(if $(DEB_TRANSFORM_SCRIPT_$(call undebian_transform_files,$(1))), \ | |
37 | $(DEB_TRANSFORM_SCRIPT_$(call undebian_transform_files,$(1))), \ | |
38 | debian/transform_$(notdir $(call undebian_transform_files,$(1))))) | |
ab8e2a67 | 39 | |
be43c288 | 40 | common-build-arch common-build-indep:: $(foreach file,$(DEB_TRANSFORM_FILES),$(call debian_transform_files,$(file))) |
ab8e2a67 | 41 | |
02bde96f | 42 | $(call debian_transform_files,%): $(call debian_check_files,%) |
ab8e2a67 | 43 | mkdir -p $(@D) |
99ecf767 TA |
44 | chmod +x $(call debian_transform_script,$@) |
45 | $(call debian_transform_script,$@) < $< > $@ | |
ab8e2a67 TA |
46 | |
47 | $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%: | |
3aab360a | 48 | set -e; \ |
02bde96f | 49 | $(foreach file,$(DEB_TRANSFORM_FILES_$(cdbs_curpkg)), \ |
a7a01014 | 50 | install -d debian/$(cdbs_curpkg)/$(dir $(file)); \ |
56709134 | 51 | cp -a $(call debian_transform_files,$(file)) \ |
a7a01014 | 52 | debian/$(cdbs_curpkg)/$(dir $(file));) |
ab8e2a67 TA |
53 | |
54 | clean:: | |
56709134 | 55 | rm -rf $(DEB_TRANSFORM_FILES_TMPDIR) |
ab8e2a67 TA |
56 | |
57 | endif |