~ubuntu-branches/ubuntu/precise/config-package-dev/precise

« back to all changes in this revision

Viewing changes to debconf-divert.mk

  • Committer: Bazaar Package Importer
  • Author(s): Tim Abbott
  • Date: 2008-05-03 13:37:12 UTC
  • Revision ID: james.westby@ubuntu.com-20080503133712-fpjefhoe3hbnr30c
Tags: 4.7
* Move homepage field to source package section, so it works.
* Make DEB_TRANSFROM_FILES targets depend on common-build-arch and
  common-build-indep, so it works with architecture-dependent packages.
* Remove useless clean code from transform-files.mk.
* Move divert.mk from binary-fixup to binary-post-install.
* Add debhelper.mk to divert.mk, since we use its
  binary-post-install/package target.
* Change maintainer to me, rather than debathena@mit.edu, since I'll be
  maintaining config-package-dev in Debian.
* Upload to Debian (Closes: #469107)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: makefile; coding: utf-8 -*-
 
2
# Copyright © 2007-2008 Anders Kaseorg <andersk@mit.edu> and
 
3
#                       Tim Abbott <tabbott@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
 
 
20
ifndef _cdbs_rules_debconf_divert
 
21
_cdbs_rules_debconf_divert = 1
 
22
 
 
23
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), config-package-dev (>= 3.2~)
 
24
 
 
25
DEB_DEBCONF_HACK_SCRIPT = /usr/share/config-package-dev/debconf-hack.sh
 
26
 
 
27
DEB_DEBCONF_HACK_PACKAGES += $(foreach package,$(DEB_ALL_PACKAGES), \
 
28
    $(if $(wildcard debian/$(package).debconf-hack),$(package)))
 
29
 
 
30
$(patsubst %,debian-debconf-hack/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: debian-debconf-hack/%:
 
31
        ( \
 
32
            cat $(DEB_DEBCONF_HACK_SCRIPT); \
 
33
            echo 'if [ ! -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
 
34
            echo '    debconf_get $(shell cut -d'       ' -f2 debian/$(cdbs_curpkg).debconf-hack) >/var/cache/$(cdbs_curpkg).debconf-save'; \
 
35
            echo '    debconf_set <<EOF'; \
 
36
            sed 's/$$/  true/' debian/$(cdbs_curpkg).debconf-hack; \
 
37
            echo 'EOF'; \
 
38
            echo 'fi'; \
 
39
        ) >> $(CURDIR)/debian/$(cdbs_curpkg).preinst.debhelper
 
40
        ( \
 
41
            cat $(DEB_DEBCONF_HACK_SCRIPT); \
 
42
            echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
 
43
            echo '    debconf_set </var/cache/$(cdbs_curpkg).debconf-save'; \
 
44
            echo '    rm -f /var/cache/$(cdbs_curpkg).debconf-save'; \
 
45
            echo 'fi'; \
 
46
        ) >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
 
47
        ( \
 
48
            cat $(DEB_DEBCONF_HACK_SCRIPT); \
 
49
            echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
 
50
            echo '    debconf_set </var/cache/$(cdbs_curpkg).debconf-save'; \
 
51
            echo '    rm -f /var/cache/$(cdbs_curpkg).debconf-save'; \
 
52
            echo 'fi'; \
 
53
        ) >> $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper
 
54
 
 
55
$(patsubst %,binary-fixup/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: binary-fixup/%: debian-debconf-hack/%
 
56
 
 
57
endif