~ubuntu-branches/ubuntu/hardy/silo/hardy-updates

« back to all changes in this revision

Viewing changes to debian/scripts/dbs-build.mk

  • Committer: Bazaar Package Importer
  • Author(s): Fabio M. Di Nitto
  • Date: 2007-10-25 09:28:08 UTC
  • mfrom: (15.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071025092808-1yhj12t7s4zqsfu5
Tags: 1.4.13a+git20070930-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build with -fno-stack-protector.
  - Change silo.postinst to automatically update the boot block without
    invoking siloconfig and keep asking questions on upgrades.
  - Convert silo.conf to use /dev/disk/by-uuid.
  - Ubuntu maintainer foobar.
  - Fix debian/rules call to dh_installdocs.
  - Drop the requirement of gcc-4.1 and start using default gcc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/make -f
2
 
# Separate tarball/patch build system by Adam Heath <doogie@debian.org>
3
 
# Modified by Ben Collins <bcollins@debian.org>
4
 
 
5
 
SHELL           := /bin/bash -e
6
 
SOURCE_DIR      := build-tree
7
 
STAMP_DIR       := stampdir
8
 
PATCH_DIR       := debian/patches
9
 
 
10
 
patched         := $(STAMP_DIR)/patch
11
 
unpacked        := $(STAMP_DIR)/unpack
12
 
 
13
 
ifdef TAR_DIR
14
 
  BUILD_TREE    := $(SOURCE_DIR)/$(TAR_DIR)
15
 
else
16
 
  BUILD_TREE    := $(SOURCE_DIR)
17
 
endif
18
 
 
19
 
dh_mak_deps := $(shell DH_COMPAT=$(DH_COMPAT) perl debian/scripts/dh_split makedeps)
20
 
dh_gen_deps := $(shell DH_COMPAT=$(DH_COMPAT) perl debian/scripts/dh_split gendeps)
21
 
 
22
 
$(dh_mak_deps): $(dh_gen_deps)
23
 
        perl debian/scripts/dh_split
24
 
 
25
 
setup: $(dh_mak_deps)
26
 
        dh_testdir
27
 
        @-up-scripts
28
 
        $(MAKE) -f debian/rules $(unpacked) $(patched)
29
 
 
30
 
$(patched)/: $(STAMP_DIR)/created $(unpacked)
31
 
        test -d $(STAMP_DIR)/patches || mkdir -p $(STAMP_DIR)/patches
32
 
        @if [ -d "$(PATCH_DIR)" ]; then \
33
 
          mkdir -p $(STAMP_DIR)/log/patches; \
34
 
          for f in `(cd $(PATCH_DIR); find -type f ! -name 'chk-*') | sort | \
35
 
              sed s,'./',,g`; do \
36
 
            stampfile=$(STAMP_DIR)/patches/$$f; \
37
 
            log=$(STAMP_DIR)/log/patches/$$f; \
38
 
            if [ ! -e $$stampfile ]; then \
39
 
              echo -n "Applying patch $(PATCH_DIR)/$$f ... "; \
40
 
              if $(SHELL) debian/scripts/file2cat $(PATCH_DIR)/$$f | \
41
 
                (cd $(BUILD_TREE);patch -p1 --no-backup-if-mismatch) > $$log 2>&1; then \
42
 
                echo successful.; \
43
 
                touch $$stampfile; \
44
 
              else \
45
 
                echo "failed! (check $$log for reason)"; \
46
 
                exit 1; \
47
 
              fi; \
48
 
            else \
49
 
              echo Already applied $(PATCH_DIR)/$$f.; \
50
 
            fi; \
51
 
          done; \
52
 
        fi
53
 
        touch $@
54
 
 
55
 
$(unpacked): $(STAMP_DIR)/created
56
 
        mkdir -p $(STAMP_DIR)/sources $(SOURCE_DIR) $(STAMP_DIR)/log/sources
57
 
        @for f in `find . -type f -maxdepth 1 -name \*.tgz -o -name \*.tar.gz -o \
58
 
                -name \*.tar.bz -o -name \*.tar.bz2 | sort | sed s,'./',,g`; do \
59
 
          stampfile=$(STAMP_DIR)/sources/`basename $$f`; \
60
 
          log=$(STAMP_DIR)/log/sources/`basename $$f`; \
61
 
          if [ ! -e $$stampfile ]; then \
62
 
            echo -n "Extracting source $$f ... "; \
63
 
            if $(SHELL) debian/scripts/file2cat $$f | \
64
 
                (cd $(SOURCE_DIR); tar xv) > $$log 2>&1; then \
65
 
              echo successful.; \
66
 
              touch $$stampfile; \
67
 
            else \
68
 
              echo failed!; \
69
 
              exit 1; \
70
 
            fi; \
71
 
          else \
72
 
            echo Already unpacked $$f.; \
73
 
          fi; \
74
 
        done
75
 
        touch $@
76
 
 
77
 
make_patch:
78
 
        mv $(BUILD_TREE) $(BUILD_TREE).new
79
 
        rm -rf $(STAMP_DIR)
80
 
        $(MAKE) -f debian/rules $(unpacked) $(patched)
81
 
ifndef TAR_DIR
82
 
        diff -urN $(BUILD_TREE) $(BUILD_TREE).new > new.diff
83
 
else
84
 
        (cd $(SOURCE_DIR) && diff -urN $(TAR_DIR) $(TAR_DIR).new || true) > new.diff
85
 
endif
86
 
        rm -rf $(BUILD_TREE)
87
 
        mv $(BUILD_TREE).new $(BUILD_TREE)
88
 
        @echo; ls -l new.diff
89
 
 
90
 
$(STAMP_DIR)/created:
91
 
        test -d $(STAMP_DIR) || mkdir $(STAMP_DIR)
92
 
        touch $(STAMP_DIR)/created